Libav 0.7.1
|
00001 00025 #ifndef AVCODEC_VP8_H 00026 #define AVCODEC_VP8_H 00027 00028 #include "vp56.h" 00029 #include "vp56data.h" 00030 #include "vp8dsp.h" 00031 #include "h264pred.h" 00032 00033 #define VP8_MAX_QUANT 127 00034 00035 enum dct_token { 00036 DCT_0, 00037 DCT_1, 00038 DCT_2, 00039 DCT_3, 00040 DCT_4, 00041 DCT_CAT1, 00042 DCT_CAT2, 00043 DCT_CAT3, 00044 DCT_CAT4, 00045 DCT_CAT5, 00046 DCT_CAT6, 00047 DCT_EOB, 00048 00049 NUM_DCT_TOKENS 00050 }; 00051 00052 // used to signal 4x4 intra pred in luma MBs 00053 #define MODE_I4x4 4 00054 00055 enum inter_mvmode { 00056 VP8_MVMODE_ZERO = MODE_I4x4 + 1, 00057 VP8_MVMODE_MV, 00058 VP8_MVMODE_SPLIT 00059 }; 00060 00061 enum inter_splitmvmode { 00062 VP8_SPLITMVMODE_16x8 = 0, 00063 VP8_SPLITMVMODE_8x16, 00064 VP8_SPLITMVMODE_8x8, 00065 VP8_SPLITMVMODE_4x4, 00066 VP8_SPLITMVMODE_NONE, 00067 }; 00068 00069 typedef struct { 00070 uint8_t filter_level; 00071 uint8_t inner_limit; 00072 uint8_t inner_filter; 00073 } VP8FilterStrength; 00074 00075 typedef struct { 00076 uint8_t skip; 00077 // todo: make it possible to check for at least (i4x4 or split_mv) 00078 // in one op. are others needed? 00079 uint8_t mode; 00080 uint8_t ref_frame; 00081 uint8_t partitioning; 00082 VP56mv mv; 00083 VP56mv bmv[16]; 00084 } VP8Macroblock; 00085 00086 typedef struct { 00087 AVCodecContext *avctx; 00088 AVFrame *framep[4]; 00089 AVFrame *next_framep[4]; 00090 uint8_t *edge_emu_buffer; 00091 00092 uint16_t mb_width; /* number of horizontal MB */ 00093 uint16_t mb_height; /* number of vertical MB */ 00094 int linesize; 00095 int uvlinesize; 00096 00097 uint8_t keyframe; 00098 uint8_t deblock_filter; 00099 uint8_t mbskip_enabled; 00100 uint8_t segment; 00101 uint8_t chroma_pred_mode; 00102 uint8_t profile; 00103 VP56mv mv_min; 00104 VP56mv mv_max; 00105 00106 int8_t sign_bias[4]; 00107 int ref_count[3]; 00108 00114 struct { 00115 uint8_t enabled; 00116 uint8_t absolute_vals; 00117 uint8_t update_map; 00118 int8_t base_quant[4]; 00119 int8_t filter_level[4]; 00120 } segmentation; 00121 00122 struct { 00123 uint8_t simple; 00124 uint8_t level; 00125 uint8_t sharpness; 00126 } filter; 00127 00128 VP8Macroblock *macroblocks; 00129 VP8FilterStrength *filter_strength; 00130 00131 uint8_t *intra4x4_pred_mode_top; 00132 uint8_t intra4x4_pred_mode_left[4]; 00133 uint8_t *segmentation_map; 00134 00140 struct { 00141 // [0] - DC qmul [1] - AC qmul 00142 int16_t luma_qmul[2]; 00143 int16_t luma_dc_qmul[2]; 00144 int16_t chroma_qmul[2]; 00145 } qmat[4]; 00146 00147 struct { 00148 uint8_t enabled; 00149 00159 int8_t mode[VP8_MVMODE_SPLIT+1]; 00160 00168 int8_t ref[4]; 00169 } lf_delta; 00170 00175 uint8_t (*top_border)[16+8+8]; 00176 00183 uint8_t (*top_nnz)[9]; 00184 DECLARE_ALIGNED(8, uint8_t, left_nnz)[9]; 00185 00193 DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4]; 00194 VP56RangeCoder c; 00195 DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16]; 00196 DECLARE_ALIGNED(16, DCTELEM, block_dc)[16]; 00197 uint8_t intra4x4_pred_mode_mb[16]; 00198 00205 struct { 00206 uint8_t segmentid[3]; 00207 uint8_t mbskip; 00208 uint8_t intra; 00209 uint8_t last; 00210 uint8_t golden; 00211 uint8_t pred16x16[4]; 00212 uint8_t pred8x8c[3]; 00213 uint8_t token[4][16][3][NUM_DCT_TOKENS-1]; 00214 uint8_t mvc[2][19]; 00215 } prob[2]; 00216 00217 VP8Macroblock *macroblocks_base; 00218 int invisible; 00219 int update_last; 00220 int update_golden; 00221 int update_altref; 00222 00227 int update_probabilities; 00228 00233 int num_coeff_partitions; 00234 VP56RangeCoder coeff_partition[8]; 00235 DSPContext dsp; 00236 VP8DSPContext vp8dsp; 00237 H264PredContext hpc; 00238 vp8_mc_func put_pixels_tab[3][3][3]; 00239 AVFrame frames[5]; 00240 } VP8Context; 00241 00242 #endif /* AVCODEC_VP8_H */