00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AVCODEC_VC1_H
00024 #define AVCODEC_VC1_H
00025
00026 #include "avcodec.h"
00027 #include "mpegvideo.h"
00028 #include "intrax8.h"
00029
00032 enum VC1Code{
00033 VC1_CODE_RES0 = 0x00000100,
00034 VC1_CODE_ENDOFSEQ = 0x0000010A,
00035 VC1_CODE_SLICE,
00036 VC1_CODE_FIELD,
00037 VC1_CODE_FRAME,
00038 VC1_CODE_ENTRYPOINT,
00039 VC1_CODE_SEQHDR,
00040 };
00042
00043 #define IS_MARKER(x) (((x) & ~0xFF) == VC1_CODE_RES0)
00044
00047 enum Profile {
00048 PROFILE_SIMPLE,
00049 PROFILE_MAIN,
00050 PROFILE_COMPLEX,
00051 PROFILE_ADVANCED
00052 };
00054
00057 enum QuantMode {
00058 QUANT_FRAME_IMPLICIT,
00059 QUANT_FRAME_EXPLICIT,
00060 QUANT_NON_UNIFORM,
00061 QUANT_UNIFORM
00062 };
00064
00067 enum DQProfile {
00068 DQPROFILE_FOUR_EDGES,
00069 DQPROFILE_DOUBLE_EDGES,
00070 DQPROFILE_SINGLE_EDGE,
00071 DQPROFILE_ALL_MBS
00072 };
00074
00078 enum DQSingleEdge {
00079 DQSINGLE_BEDGE_LEFT,
00080 DQSINGLE_BEDGE_TOP,
00081 DQSINGLE_BEDGE_RIGHT,
00082 DQSINGLE_BEDGE_BOTTOM
00083 };
00085
00088 enum DQDoubleEdge {
00089 DQDOUBLE_BEDGE_TOPLEFT,
00090 DQDOUBLE_BEDGE_TOPRIGHT,
00091 DQDOUBLE_BEDGE_BOTTOMRIGHT,
00092 DQDOUBLE_BEDGE_BOTTOMLEFT
00093 };
00095
00098 enum MVModes {
00099 MV_PMODE_1MV_HPEL_BILIN,
00100 MV_PMODE_1MV,
00101 MV_PMODE_1MV_HPEL,
00102 MV_PMODE_MIXED_MV,
00103 MV_PMODE_INTENSITY_COMP
00104 };
00106
00109 enum BMVTypes {
00110 BMV_TYPE_BACKWARD,
00111 BMV_TYPE_FORWARD,
00112 BMV_TYPE_INTERPOLATED
00113 };
00115
00118 enum TransformTypes {
00119 TT_8X8,
00120 TT_8X4_BOTTOM,
00121 TT_8X4_TOP,
00122 TT_8X4,
00123 TT_4X8_RIGHT,
00124 TT_4X8_LEFT,
00125 TT_4X8,
00126 TT_4X4
00127 };
00129
00130 enum CodingSet {
00131 CS_HIGH_MOT_INTRA = 0,
00132 CS_HIGH_MOT_INTER,
00133 CS_LOW_MOT_INTRA,
00134 CS_LOW_MOT_INTER,
00135 CS_MID_RATE_INTRA,
00136 CS_MID_RATE_INTER,
00137 CS_HIGH_RATE_INTRA,
00138 CS_HIGH_RATE_INTER
00139 };
00140
00143 enum COTypes {
00144 CONDOVER_NONE = 0,
00145 CONDOVER_ALL,
00146 CONDOVER_SELECT
00147 };
00149
00150
00155 typedef struct VC1Context{
00156 MpegEncContext s;
00157 IntraX8Context x8;
00158
00159 int bits;
00160
00163 int res_sm;
00164 int res_x8;
00165 int multires;
00166 int res_fasttx;
00167 int res_transtab;
00168 int rangered;
00169
00170 int res_rtm_flag;
00171 int reserved;
00172
00173
00176 int level;
00177 int chromaformat;
00178 int postprocflag;
00179 int broadcast;
00180 int interlace;
00181 int tfcntrflag;
00182 int panscanflag;
00183 int refdist_flag;
00184 int extended_dmv;
00185 int color_prim;
00186 int transfer_char;
00187 int matrix_coef;
00188 int hrd_param_flag;
00189
00190 int psf;
00191
00192
00197 int profile;
00198 int frmrtq_postproc;
00199 int bitrtq_postproc;
00200 int fastuvmc;
00201 int extended_mv;
00202 int dquant;
00203 int vstransform;
00204 int overlap;
00205 int quantizer_mode;
00206 int finterpflag;
00207
00208
00211 uint8_t mv_mode;
00212 uint8_t mv_mode2;
00213 int k_x;
00214 int k_y;
00215 int range_x, range_y;
00216 uint8_t pq, altpq;
00217 const uint8_t* zz_8x4;
00218 const uint8_t* zz_4x8;
00219
00221 uint8_t dquantfrm;
00222 uint8_t dqprofile;
00223 uint8_t dqsbedge;
00224 uint8_t dqbilevel;
00226
00230 int c_ac_table_index;
00231 int y_ac_table_index;
00232
00233 int ttfrm;
00234 uint8_t ttmbf;
00235 uint8_t ttblk4x4;
00236 int codingset;
00237 int codingset2;
00238 int pqindex;
00239 int a_avail, c_avail;
00240 uint8_t *mb_type_base, *mb_type[3];
00241
00242
00245 uint8_t lumscale;
00246 uint8_t lumshift;
00248 int16_t bfraction;
00249 uint8_t halfpq;
00250 uint8_t respic;
00251 int buffer_fullness;
00252
00258 uint8_t mvrange;
00259 uint8_t pquantizer;
00260 VLC *cbpcy_vlc;
00261 int tt_index;
00262 uint8_t* mv_type_mb_plane;
00263 uint8_t* direct_mb_plane;
00264 int mv_type_is_raw;
00265 int dmb_is_raw;
00266 int skip_is_raw;
00267 uint8_t luty[256], lutuv[256];
00268 int use_ic;
00269 int rnd;
00270
00273 uint8_t rangeredfrm;
00274 uint8_t interpfrm;
00276
00279 uint8_t fcm;
00280 uint8_t numpanscanwin;
00281 uint8_t tfcntr;
00282 uint8_t rptfrm, tff, rff;
00283 uint16_t topleftx;
00284 uint16_t toplefty;
00285 uint16_t bottomrightx;
00286 uint16_t bottomrighty;
00287 uint8_t uvsamp;
00288 uint8_t postproc;
00289 int hrd_num_leaky_buckets;
00290 uint8_t bit_rate_exponent;
00291 uint8_t buffer_size_exponent;
00292 uint8_t* acpred_plane;
00293 int acpred_is_raw;
00294 uint8_t* over_flags_plane;
00295 int overflg_is_raw;
00296 uint8_t condover;
00297 uint16_t *hrd_rate, *hrd_buffer;
00298 uint8_t *hrd_fullness;
00299 uint8_t range_mapy_flag;
00300 uint8_t range_mapuv_flag;
00301 uint8_t range_mapy;
00302 uint8_t range_mapuv;
00304
00305 int p_frame_skipped;
00306 int bi_type;
00307 int x8_type;
00308
00309 uint32_t *cbp_base, *cbp;
00310 uint8_t bfraction_lut_index;
00311 uint8_t broken_link;
00312 uint8_t closed_entry;
00313 } VC1Context;
00314
00315 #endif