Blame va/va_dec_vp8.h

Packit Service 9402ce
/*
Packit Service 9402ce
 * Copyright (c) 2007-2012 Intel Corporation. All Rights Reserved.
Packit Service 9402ce
 *
Packit Service 9402ce
 * Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 9402ce
 * copy of this software and associated documentation files (the
Packit Service 9402ce
 * "Software"), to deal in the Software without restriction, including
Packit Service 9402ce
 * without limitation the rights to use, copy, modify, merge, publish,
Packit Service 9402ce
 * distribute, sub license, and/or sell copies of the Software, and to
Packit Service 9402ce
 * permit persons to whom the Software is furnished to do so, subject to
Packit Service 9402ce
 * the following conditions:
Packit Service 9402ce
 *
Packit Service 9402ce
 * The above copyright notice and this permission notice (including the
Packit Service 9402ce
 * next paragraph) shall be included in all copies or substantial portions
Packit Service 9402ce
 * of the Software.
Packit Service 9402ce
 *
Packit Service 9402ce
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Packit Service 9402ce
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit Service 9402ce
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
Packit Service 9402ce
 * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
Packit Service 9402ce
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Packit Service 9402ce
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Packit Service 9402ce
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit Service 9402ce
 */
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \file va_dec_vp.h
Packit Service 9402ce
 * \brief VP8 decoding API
Packit Service 9402ce
 *
Packit Service 9402ce
 * This file contains the \ref api_dec_vp8 "VP8 decoding API".
Packit Service 9402ce
 */
Packit Service 9402ce
Packit Service 9402ce
#ifndef VA_DEC_VP8_H
Packit Service 9402ce
#define VA_DEC_VP8_H
Packit Service 9402ce
Packit Service 9402ce
#ifdef __cplusplus
Packit Service 9402ce
extern "C" {
Packit Service 9402ce
#endif
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \defgroup api_dec_vp8 VP8 decoding API
Packit Service 9402ce
 *
Packit Service 9402ce
 * @{
Packit Service 9402ce
 */
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \brief VPX Bool Coder Context structure 
Packit Service 9402ce
 *
Packit Service 9402ce
 * This common structure is defined for potential sharing by other VP formats
Packit Service 9402ce
 *
Packit Service 9402ce
 */
Packit Service 9402ce
typedef struct _VABoolCoderContextVPX
Packit Service 9402ce
{
Packit Service 9402ce
    /* partition 0 "range" */
Packit Service 9402ce
    uint8_t range;
Packit Service 9402ce
    /* partition 0 "value" */
Packit Service 9402ce
    uint8_t value;
Packit Service 9402ce
    /*
Packit Service 9402ce
     * 'partition 0 number of shifts before an output byte is available'
Packit Service 9402ce
     * it is the number of remaining bits in 'value' for decoding, range [0, 7].
Packit Service 9402ce
     */
Packit Service 9402ce
Packit Service 9402ce
    uint8_t count;
Packit Service 9402ce
} VABoolCoderContextVPX;
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \brief VP8 Decoding Picture Parameter Buffer Structure
Packit Service 9402ce
 *
Packit Service 9402ce
 * This structure conveys frame level parameters and should be sent once
Packit Service 9402ce
 * per frame.
Packit Service 9402ce
 *
Packit Service 9402ce
 */
Packit Service 9402ce
typedef struct  _VAPictureParameterBufferVP8
Packit Service 9402ce
{
Packit Service 9402ce
    /* frame width in pixels */
Packit Service 9402ce
    uint32_t frame_width;
Packit Service 9402ce
    /* frame height in pixels */
Packit Service 9402ce
    uint32_t frame_height;
Packit Service 9402ce
Packit Service 9402ce
    /* specifies the "last" reference frame */
Packit Service 9402ce
    VASurfaceID last_ref_frame;
Packit Service 9402ce
    /* specifies the "golden" reference frame */
Packit Service 9402ce
    VASurfaceID golden_ref_frame;
Packit Service 9402ce
    /* specifies the "alternate" referrence frame */
Packit Service 9402ce
    VASurfaceID alt_ref_frame;
Packit Service 9402ce
    /* specifies the out-of-loop deblocked frame, not used currently */
Packit Service 9402ce
    VASurfaceID out_of_loop_frame;
Packit Service 9402ce
Packit Service 9402ce
    union {
Packit Service 9402ce
        struct {
Packit Service 9402ce
	    /* same as key_frame in bitstream syntax, 0 means a key frame */
Packit Service 9402ce
            uint32_t key_frame			: 1; 
Packit Service 9402ce
	    /* same as version in bitstream syntax */
Packit Service 9402ce
            uint32_t version			: 3;
Packit Service 9402ce
	    /* same as segmentation_enabled in bitstream syntax */
Packit Service 9402ce
            uint32_t segmentation_enabled		: 1;
Packit Service 9402ce
	    /* same as update_mb_segmentation_map in bitstream syntax */
Packit Service 9402ce
            uint32_t update_mb_segmentation_map	: 1;
Packit Service 9402ce
	    /* same as update_segment_feature_data in bitstream syntax */
Packit Service 9402ce
            uint32_t update_segment_feature_data	: 1;
Packit Service 9402ce
	    /* same as filter_type in bitstream syntax */
Packit Service 9402ce
            uint32_t filter_type			: 1; 
Packit Service 9402ce
	    /* same as sharpness_level in bitstream syntax */
Packit Service 9402ce
            uint32_t sharpness_level		: 3; 
Packit Service 9402ce
	    /* same as loop_filter_adj_enable in bitstream syntax */
Packit Service 9402ce
            uint32_t loop_filter_adj_enable		: 1; 
Packit Service 9402ce
	    /* same as mode_ref_lf_delta_update in bitstream syntax */
Packit Service 9402ce
            uint32_t mode_ref_lf_delta_update	: 1; 
Packit Service 9402ce
	    /* same as sign_bias_golden in bitstream syntax */
Packit Service 9402ce
            uint32_t sign_bias_golden		: 1; 
Packit Service 9402ce
	    /* same as sign_bias_alternate in bitstream syntax */
Packit Service 9402ce
            uint32_t sign_bias_alternate		: 1; 
Packit Service 9402ce
	    /* same as mb_no_coeff_skip in bitstream syntax */
Packit Service 9402ce
            uint32_t mb_no_coeff_skip		: 1; 
Packit Service 9402ce
	    /* flag to indicate that loop filter should be disabled */
Packit Service 9402ce
            uint32_t loop_filter_disable		: 1; 
Packit Service 9402ce
        } bits;
Packit Service 9402ce
        uint32_t value;
Packit Service 9402ce
    } pic_fields;
Packit Service 9402ce
Packit Service 9402ce
    /*
Packit Service 9402ce
     * probabilities of the segment_id decoding tree and same as 
Packit Service 9402ce
     * mb_segment_tree_probs in the spec.
Packit Service 9402ce
     */
Packit Service 9402ce
    uint8_t mb_segment_tree_probs[3];
Packit Service 9402ce
Packit Service 9402ce
    /* Post-adjustment loop filter levels for the 4 segments */
Packit Service 9402ce
    uint8_t loop_filter_level[4];
Packit Service 9402ce
    /* loop filter deltas for reference frame based MB level adjustment */
Packit Service 9402ce
    int8_t loop_filter_deltas_ref_frame[4];
Packit Service 9402ce
    /* loop filter deltas for coding mode based MB level adjustment */
Packit Service 9402ce
    int8_t loop_filter_deltas_mode[4];
Packit Service 9402ce
Packit Service 9402ce
    /* same as prob_skip_false in bitstream syntax */
Packit Service 9402ce
    uint8_t prob_skip_false;
Packit Service 9402ce
    /* same as prob_intra in bitstream syntax */
Packit Service 9402ce
    uint8_t prob_intra;
Packit Service 9402ce
    /* same as prob_last in bitstream syntax */
Packit Service 9402ce
    uint8_t prob_last;
Packit Service 9402ce
    /* same as prob_gf in bitstream syntax */
Packit Service 9402ce
    uint8_t prob_gf;
Packit Service 9402ce
Packit Service 9402ce
    /* 
Packit Service 9402ce
     * list of 4 probabilities of the luma intra prediction mode decoding
Packit Service 9402ce
     * tree and same as y_mode_probs in frame header
Packit Service 9402ce
     */
Packit Service 9402ce
    uint8_t y_mode_probs[4]; 
Packit Service 9402ce
    /*
Packit Service 9402ce
     * list of 3 probabilities of the chroma intra prediction mode decoding
Packit Service 9402ce
     * tree and same as uv_mode_probs in frame header
Packit Service 9402ce
     */
Packit Service 9402ce
    uint8_t uv_mode_probs[3];
Packit Service 9402ce
    /* 
Packit Service 9402ce
     * updated mv decoding probabilities and same as mv_probs in 
Packit Service 9402ce
     * frame header
Packit Service 9402ce
     */
Packit Service 9402ce
    uint8_t mv_probs[2][19];
Packit Service 9402ce
Packit Service 9402ce
    VABoolCoderContextVPX bool_coder_ctx;
Packit Service 9402ce
Packit Service 9402ce
    /** \brief Reserved bytes for future use, must be zero */
Packit Service 9402ce
    uint32_t                va_reserved[VA_PADDING_LOW];
Packit Service 9402ce
} VAPictureParameterBufferVP8;
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \brief VP8 Slice Parameter Buffer Structure
Packit Service 9402ce
 *
Packit Service 9402ce
 * This structure conveys parameters related to data partitions and should be 
Packit Service 9402ce
 * sent once per frame. Slice data buffer of VASliceDataBufferType is used
Packit Service 9402ce
 * to send the partition data.
Packit Service 9402ce
 *
Packit Service 9402ce
 */
Packit Service 9402ce
typedef struct  _VASliceParameterBufferVP8
Packit Service 9402ce
{
Packit Service 9402ce
    /*
Packit Service 9402ce
     * number of bytes in the slice data buffer for the partitions 
Packit Service 9402ce
     */
Packit Service 9402ce
    uint32_t slice_data_size;
Packit Service 9402ce
    /*
Packit Service 9402ce
     * offset to the first byte of partition data (control partition)
Packit Service 9402ce
     */
Packit Service 9402ce
    uint32_t slice_data_offset;
Packit Service 9402ce
    /*
Packit Service 9402ce
     * see VA_SLICE_DATA_FLAG_XXX definitions
Packit Service 9402ce
     */
Packit Service 9402ce
    uint32_t slice_data_flag; 
Packit Service 9402ce
    /*
Packit Service 9402ce
     * offset to the first bit of MB from the first byte of partition data(slice_data_offset)
Packit Service 9402ce
     */
Packit Service 9402ce
    uint32_t macroblock_offset;
Packit Service 9402ce
Packit Service 9402ce
    /*
Packit Service 9402ce
     * Partitions
Packit Service 9402ce
     * (1<
Packit Service 9402ce
     */
Packit Service 9402ce
    uint8_t num_of_partitions;
Packit Service 9402ce
    /*
Packit Service 9402ce
     * partition_size[0] is remaining bytes of control partition after parsed by application.
Packit Service 9402ce
     * exclude current byte for the remaining bits in bool_coder_ctx.
Packit Service 9402ce
     * exclude the uncompress data chunk since first_part_size 'excluding the uncompressed data chunk'
Packit Service 9402ce
     */
Packit Service 9402ce
    uint32_t partition_size[9];
Packit Service 9402ce
Packit Service 9402ce
    /** \brief Reserved bytes for future use, must be zero */
Packit Service 9402ce
    uint32_t                va_reserved[VA_PADDING_LOW];
Packit Service 9402ce
} VASliceParameterBufferVP8;
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \brief VP8 Coefficient Probability Data Buffer Structure
Packit Service 9402ce
 *
Packit Service 9402ce
 * Contains the contents of the token probability table, which may be 
Packit Service 9402ce
 * incrementally modified in the frame header. There are four dimensions to 
Packit Service 9402ce
 * the token probability array. The outermost dimension is indexed by the 
Packit Service 9402ce
 * type of plane being decoded; the next dimension is selected by the 
Packit Service 9402ce
 * position of the coefficient being decoded; the third dimension, * roughly 
Packit Service 9402ce
 * speaking, measures the "local complexity" or extent to which nearby 
Packit Service 9402ce
 * coefficients are non-zero; the fourth, and final, dimension of the token 
Packit Service 9402ce
 * probability array is indexed by the position in the token tree structure, 
Packit Service 9402ce
 * as are all tree probability arrays. This structure is sent once per frame.
Packit Service 9402ce
 *
Packit Service 9402ce
 */
Packit Service 9402ce
typedef struct _VAProbabilityDataBufferVP8
Packit Service 9402ce
{
Packit Service 9402ce
    uint8_t dct_coeff_probs[4][8][3][11];
Packit Service 9402ce
Packit Service 9402ce
    /** \brief Reserved bytes for future use, must be zero */
Packit Service 9402ce
    uint32_t                va_reserved[VA_PADDING_LOW];
Packit Service 9402ce
} VAProbabilityDataBufferVP8;
Packit Service 9402ce
Packit Service 9402ce
/**
Packit Service 9402ce
 * \brief VP8 Inverse Quantization Matrix Buffer Structure
Packit Service 9402ce
 *
Packit Service 9402ce
 * Contains quantization indices for yac(0),ydc(1),y2dc(2),y2ac(3),uvdc(4),
Packit Service 9402ce
 * uvac(5) for each segment (0-3). When segmentation is disabled, only  
Packit Service 9402ce
 * quantization_index[0][] will be used. This structure is sent once per frame.
Packit Service 9402ce
 */
Packit Service 9402ce
typedef struct _VAIQMatrixBufferVP8
Packit Service 9402ce
{
Packit Service 9402ce
    /* 
Packit Service 9402ce
     * array first dimensional is segment and 2nd dimensional is Q index
Packit Service 9402ce
     * all Q indexs should be clipped to be range [0, 127]
Packit Service 9402ce
     */
Packit Service 9402ce
    uint16_t quantization_index[4][6];
Packit Service 9402ce
Packit Service 9402ce
    /** \brief Reserved bytes for future use, must be zero */
Packit Service 9402ce
    uint32_t                va_reserved[VA_PADDING_LOW];
Packit Service 9402ce
} VAIQMatrixBufferVP8;
Packit Service 9402ce
Packit Service 9402ce
/**@}*/
Packit Service 9402ce
Packit Service 9402ce
#ifdef __cplusplus
Packit Service 9402ce
}
Packit Service 9402ce
#endif
Packit Service 9402ce
Packit Service 9402ce
#endif /* VA_DEC_VP8_H */