32 #define SPRITE_TRAJ_VLC_BITS 6
34 #define MB_TYPE_B_VLC_BITS 4
84 int16_t *ac_val, *ac_val1;
96 if(s->
mb_x==0 || s->
qscale == qscale_table[xy] || n==1 || n==3){
112 if(s->
mb_y==0 || s->
qscale == qscale_table[xy] || n==2 || n==3){
157 v|= 0x7F >> (7-(bits_count&7));
169 for(len=0; len<32; len++){
189 int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};
190 int sprite_ref[4][2];
191 int virtual_ref[2][2];
198 if (w <= 0 || h <= 0)
222 while((1<<alpha)<w) alpha++;
223 while((1<<beta )<h) beta++;
229 sprite_ref[0][0]= a*vop_ref[0][0] + d[0][0];
230 sprite_ref[0][1]= a*vop_ref[0][1] + d[0][1];
231 sprite_ref[1][0]= a*vop_ref[1][0] + d[0][0] + d[1][0];
232 sprite_ref[1][1]= a*vop_ref[1][1] + d[0][1] + d[1][1];
233 sprite_ref[2][0]= a*vop_ref[2][0] + d[0][0] + d[2][0];
234 sprite_ref[2][1]= a*vop_ref[2][1] + d[0][1] + d[2][1];
236 sprite_ref[0][0]= (a>>1)*(2*vop_ref[0][0] + d[0][0]);
237 sprite_ref[0][1]= (a>>1)*(2*vop_ref[0][1] + d[0][1]);
238 sprite_ref[1][0]= (a>>1)*(2*vop_ref[1][0] + d[0][0] + d[1][0]);
239 sprite_ref[1][1]= (a>>1)*(2*vop_ref[1][1] + d[0][1] + d[1][1]);
240 sprite_ref[2][0]= (a>>1)*(2*vop_ref[2][0] + d[0][0] + d[2][0]);
241 sprite_ref[2][1]= (a>>1)*(2*vop_ref[2][1] + d[0][1] + d[2][1]);
250 virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)
251 +
ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w);
252 virtual_ref[0][1]= 16*vop_ref[0][1]
253 +
ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w);
254 virtual_ref[1][0]= 16*vop_ref[0][0]
255 +
ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h);
256 virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)
257 +
ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h);
276 s->
sprite_offset[1][0]= ((sprite_ref[0][0]>>1)|(sprite_ref[0][0]&1)) - a*(vop_ref[0][0]/2);
277 s->
sprite_offset[1][1]= ((sprite_ref[0][1]>>1)|(sprite_ref[0][1]&1)) - a*(vop_ref[0][1]/2);
287 + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][0])
288 + ( r*sprite_ref[0][1] - virtual_ref[0][1])*(-vop_ref[0][1])
289 + (1<<(alpha+rho-1));
291 + (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-vop_ref[0][0])
292 + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][1])
293 + (1<<(alpha+rho-1));
294 s->
sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1)
295 +( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1)
296 +2*w2*r*sprite_ref[0][0]
298 + (1<<(alpha+rho+1)));
299 s->
sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)
300 +(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1)
301 +2*w2*r*sprite_ref[0][1]
303 + (1<<(alpha+rho+1)));
304 s->
sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
305 s->
sprite_delta[0][1]= (+r*sprite_ref[0][1] - virtual_ref[0][1]);
306 s->
sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1]);
307 s->
sprite_delta[1][1]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
313 min_ab=
FFMIN(alpha, beta);
316 s->
sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+beta+rho-min_ab))
317 + (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-vop_ref[0][0])
318 + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-vop_ref[0][1])
319 + (1<<(alpha+beta+rho-min_ab-1));
320 s->
sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+beta+rho-min_ab))
321 + (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-vop_ref[0][0])
322 + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-vop_ref[0][1])
323 + (1<<(alpha+beta+rho-min_ab-1));
324 s->
sprite_offset[1][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-2*vop_ref[0][0] + 1)
325 + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-2*vop_ref[0][1] + 1)
326 + 2*w2*h3*r*sprite_ref[0][0]
328 + (1<<(alpha+beta+rho-min_ab+1));
329 s->
sprite_offset[1][1]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-2*vop_ref[0][0] + 1)
330 + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-2*vop_ref[0][1] + 1)
331 + 2*w2*h3*r*sprite_ref[0][1]
333 + (1<<(alpha+beta+rho-min_ab+1));
334 s->
sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3;
335 s->
sprite_delta[0][1]= (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3;
336 s->
sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3;
337 s->
sprite_delta[1][1]= (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3;
383 int header_extension=0, mb_num,
len;
388 for(len=0; len<32; len++){
408 int mb_x = 0, mb_y = 0;
414 if (++mb_x == s->
mb_width) mb_x = 0;
416 if(mb_num >= s->
mb_num)
return -1;
431 if(header_extension){
437 check_marker(&s->
gb,
"before time_increment in video packed header");
439 check_marker(&s->
gb,
"before vop_coding_type in video packed header");
480 int x, y, mb_v, sum, dx, dy, shift;
496 if(n) dy -= 1<<(shift + a + 1);
497 else dx -= 1<<(shift + a + 1);
514 if (sum < -len) sum= -
len;
515 else if (sum >= len) sum= len-1;
534 if (code < 0 || code > 9 ){
546 level =
get_bits(&s->
gb, code-1) + (1<<(code-1));
548 level = -
get_bits(&s->
gb, code-1) - (1<<(code-1));
573 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
623 if(dc_pred_dir) dir|=1;
627 int mx, my, pred_x, pred_y,
bits;
647 mot_val[0 ]= mot_val[2 ]=
649 mot_val[1 ]= mot_val[3 ]=
672 mot_val[0 ]= mot_val[2 ]=
674 mot_val[1 ]= mot_val[3 ]=
684 if ((cbpc & 16) == 0) {
703 mot_val[0 ]= mot_val[2 ] =
705 mot_val[1 ]= mot_val[3 ]=
738 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
786 if(dc_pred_dir) dir|=1;
813 if(mb_num >= mb_count)
return 0;
877 int n,
int coded,
int intra,
int rvlc)
918 if (dc_pred_dir == 0)
948 qadd = (s->
qscale - 1) | 1;
986 level= level * qmul + qadd;
999 if (cache&0x80000000) {
1000 if (cache&0x40000000) {
1026 if (level>0) level= level * qmul + qadd;
1027 else level= level * qmul - qadd;
1029 if((
unsigned)(level + 2048) > 4095){
1031 if(level > 2560 || level<-2560){
1036 level= level<0 ? -2048 : 2047;
1045 i+= run + rl->
max_run[run>>7][level/qmul] +1;
1054 level = level + rl->
max_level[run>>7][(run-1)&63] * qmul;
1071 block[scan_table[i]] =
level;
1075 block[scan_table[i]] =
level;
1156 for (i = 0; i < 6; i++) {
1185 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
1187 static int8_t quant_tab[4] = { -1, -2, 1, 2 };
1234 cbp = (cbpc & 3) | (cbpy << 2);
1242 if ((cbpc & 16) == 0) {
1249 s->
mv[0][0][0] = mx;
1250 s->
mv[0][0][1] = my;
1270 s->
mv[0][i][0] = mx;
1271 s->
mv[0][i][1] = my;
1287 s->
mv[0][0][0] = mx;
1288 s->
mv[0][0][1] = my;
1302 s->
mv[0][i][0] = mx;
1303 s->
mv[0][i][1] = my;
1418 s->
last_mv[0][i][0]= s->
mv[0][i][0] = mx;
1419 s->
last_mv[0][i][1]= (s->
mv[0][i][1] = my)*2;
1429 s->
last_mv[1][i][0]= s->
mv[1][i][0] = mx;
1430 s->
last_mv[1][i][1]= (s->
mv[1][i][1] = my)*2;
1471 cbp = (cbpc & 3) | (cbpy << 2);
1484 for (i = 0; i < 6; i++) {
1493 for (i = 0; i < 6; i++) {
1521 int hours, minutes, seconds;
1524 if (time_code & 0x40) {
1525 hours = time_code >> 13;
1526 minutes = time_code >> 7 & 0x3f;
1527 seconds = time_code & 0x3f;
1528 s->
time_base = seconds + 60*(minutes + 60*hours);
1538 int profile_and_level_indication;
1540 profile_and_level_indication =
get_bits(gb, 8);
1542 s->
avctx->
profile = (profile_and_level_indication & 0xf0) >> 4;
1543 s->
avctx->
level = (profile_and_level_indication & 0x0f);
1574 int chroma_format=
get_bits(gb, 2);
1648 if (vo_ver_id == 1) {
1692 for(i=0; i<64; i++){
1706 for(i=0; i<64; i++){
1728 for(i=0; i<64; i++){
1756 int estimation_method=
get_bits(gb, 2);
1757 if(estimation_method<2){
1772 if(!
check_marker(gb,
"in complexity estimation part 1")){
1790 if(!
check_marker(gb,
"in complexity estimation part 2")){
1794 if(estimation_method==1){
1814 if(vo_ver_id != 1) {
1833 int h_sampling_factor_n;
1834 int h_sampling_factor_m;
1835 int v_sampling_factor_n;
1836 int v_sampling_factor_m;
1841 h_sampling_factor_n=
get_bits(gb, 5);
1842 h_sampling_factor_m=
get_bits(gb, 5);
1843 v_sampling_factor_n=
get_bits(gb, 5);
1844 v_sampling_factor_m=
get_bits(gb, 5);
1847 if( h_sampling_factor_n==0 || h_sampling_factor_m==0
1848 || v_sampling_factor_n==0 || v_sampling_factor_m==0){
1870 int ver = 0, build = 0, ver2 = 0, ver3 = 0;
1880 e=sscanf(buf,
"DivX%dBuild%d%c", &ver, &build, &last);
1882 e=sscanf(buf,
"DivX%db%d%c", &ver, &build, &last);
1894 e=sscanf(buf,
"FFmpe%*[^b]b%d", &build)+3;
1896 e=sscanf(buf,
"FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
1898 e=sscanf(buf,
"Lavc%d.%d.%d", &ver, &ver2, &ver3)+1;
1900 build= (ver<<16) + (ver2<<8) + ver3;
1903 if(strcmp(buf,
"ffmpeg")==0){
1912 e=sscanf(buf,
"XviD%d", &build);
1921 int time_incr, time_increment;
1942 av_log(s->
avctx,
AV_LOG_ERROR,
"hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
2092 av_log(s->
avctx,
AV_LOG_DEBUG,
"qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d ce:%d/%d/%d\n",
2107 if(load_backward_shape){
2117 av_log(s->
avctx,
AV_LOG_WARNING,
"looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n");
2141 unsigned startcode, v;
2164 startcode = ((startcode << 8) | v) & 0xffffffff;
2166 if((startcode&0xFFFFFF00) != 0x100)
2201 if(startcode >= 0x120 && startcode <= 0x12F){
2290 #if CONFIG_MPEG4_VDPAU_DECODER
2291 AVCodec ff_mpeg4_vdpau_decoder = {
2292 .
name =
"mpeg4_vdpau",
#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
enum AVPixelFormat ff_hwaccel_pixfmt_list_420[]
static int decode_vop_header(MpegEncContext *s, GetBitContext *gb)
void ff_init_block_index(MpegEncContext *s)
ScanTable intra_v_scantable
RLTable ff_mpeg4_rl_intra
const uint8_t ff_zigzag_direct[64]
const uint8_t ff_mpeg4_c_dc_scale_table[32]
int time_increment_bits
number of bits to represent the fractional part of time
struct MpegEncContext MpegEncContext
MpegEncContext.
#define MV_TYPE_FIELD
2 vectors, one per field
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
int vol_control_parameters
does the stream contain the low_delay flag, used to workaround buggy encoders
int sprite_warping_accuracy
int last_mv[2][2][2]
last MV, used for MV prediction in MPEG1 & B-frame MPEG4
#define SLICE_NOEND
no end marker or error found but mb count exceeded
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void skip_bits_long(GetBitContext *s, int n)
#define MB_TYPE_B_VLC_BITS
VLC ff_h263_intra_MCBPC_vlc
static int mpeg4_is_resync(MpegEncContext *s)
check if the next stuff is a resync marker or the end.
uint16_t chroma_intra_matrix[64]
static int mpeg4_decode_gop_header(MpegEncContext *s, GetBitContext *gb)
int16_t(*[3] ac_val)[16]
used for for mpeg4 AC prediction, all 3 arrays must be continuous
static void align_get_bits(GetBitContext *s)
int v_edge_pos
horizontal / vertical position of the right/bottom edge (pixel replication)
#define SKIP_COUNTER(name, gb, num)
uint16_t chroma_inter_matrix[64]
#define FF_PROFILE_MPEG4_MAIN
#define CODEC_CAP_HWACCEL_VDPAU
#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME
void ff_init_rl(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_vol_header(MpegEncContext *s, GetBitContext *gb)
int real_sprite_warping_points
int num_sprite_warping_points
int ff_mpeg4_decode_partitions(MpegEncContext *s)
Decode the first and second partition.
int mb_num
number of MBs of a picture
int t_frame
time distance of first I -> B, used for interlaced b frames
uint16_t sprite_traj[4][2]
sprite trajectory points
int time_base
time in seconds of last I,P,S Frame
int16_t * ff_h263_pred_motion(MpegEncContext *s, int block, int dir, int *px, int *py)
#define USES_LIST(a, list)
does this mb use listX, note does not work if subMBs
void ff_clean_intra_table_entries(MpegEncContext *s)
Clean dc, ac, coded_block for the current non-intra MB.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int intra_dc_threshold
QP above whch the ac VLC should be used for intra dc.
int sprite_shift[2]
sprite shift [isChroma]
#define USER_DATA_STARTCODE
int mb_num_left
number of MBs left in this video packet (for partitioned Slices only)
int64_t time
time of current frame
int8_t * max_run[2]
encoding & decoding
const uint8_t ff_alternate_vertical_scan[64]
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
#define FF_PROFILE_MPEG4_ADVANCED_CORE
#define MV_DIRECT
bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4) ...
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
const uint16_t ff_mpeg4_resync_prefix[8]
const uint16_t ff_sprite_trajectory_tab[15][2]
uint8_t * pred_dir_table
used to store pred_dir for partitioned decoding
int64_t pts
presentation timestamp in time_base units (time when frame should be shown to user) If AV_NOPTS_VALUE...
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
int resync_marker
could this stream contain resync markers
Picture current_picture
copy of the current picture structure.
const uint8_t ff_mpeg4_DCtab_chrom[13][2]
int cplx_estimation_trash_b
static int mpeg4_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
static int get_bits_count(const GetBitContext *s)
int8_t * max_level[2]
encoding & decoding
int showed_packed_warning
flag for having shown the warning about divxs invalid b frames
uint16_t pp_time
time distance between the last 2 p,s,i frames
uint8_t idct_permutation[64]
idct input permutation.
int mb_height
number of MBs horizontally & vertically
int codec_tag
internal codec_tag upper case converted from avctx codec_tag
const AVRational ff_h263_pixel_aspect[16]
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
static int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level, int *dir_ptr, int encoding)
Predict the dc.
static void ff_update_block_index(MpegEncContext *s)
static int init(AVCodecParserContext *s)
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
int sprite_offset[2][2]
sprite offset[isChroma][isMVY]
#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE
static int mpeg4_decode_sprite_trajectory(MpegEncContext *s, GetBitContext *gb)
#define FF_ASPECT_EXTENDED
int16_t * dc_val[3]
used for mpeg4 DC prediction, all 3 arrays must be continuous
#define UPDATE_CACHE(name, gb)
#define FF_BUG_NO_PADDING
int has_b_frames
Size of the frame reordering buffer in the decoder.
Multithreading support functions.
int mb_skipped
MUST BE SET only during DECODING.
int partitioned_frame
is current frame partitioned
const uint8_t ff_alternate_horizontal_scan[64]
int cplx_estimation_trash_p
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define FF_DEBUG_PICT_INFO
#define MB_TYPE_INTERLACED
#define CODEC_CAP_TRUNCATED
static int mpeg4_decode_block(MpegEncContext *s, DCTELEM *block, int n, int coded, int intra, int rvlc)
Decode a block.
#define INTER_MCBPC_VLC_BITS
#define FF_PROFILE_MPEG4_ADVANCED_CODING
#define CODEC_FLAG_LOW_DELAY
void av_log(void *avcl, int level, const char *fmt,...)
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
const char * name
Name of the codec implementation.
#define FF_PROFILE_MPEG4_HYBRID
int quarter_sample
1->qpel, 0->half pel ME/MC
int low_delay
no reordering needed / has no b-frames
#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE
#define CLOSE_READER(name, gb)
#define INIT_VLC_RL(rl, static_size)
static int check_marker(GetBitContext *s, const char *msg)
void ff_mpeg_flush(AVCodecContext *avctx)
#define SKIP_BITS(name, gb, num)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
int resync_mb_x
x position of last resync marker
int(* decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64])
int ff_h263_decode_init(AVCodecContext *avctx)
int sprite_delta[2][2]
sprite_delta [isY][isMVY]
void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
const uint8_t ff_mpeg4_DCtab_lum[13][2]
uint8_t ff_mpeg4_static_rl_table_store[3][2][2 *MAX_RUN+MAX_LEVEL+3]
VLC ff_h263_inter_MCBPC_vlc
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static const int mb_type_b_map[4]
const uint8_t ff_mpeg4_y_dc_scale_table[32]
static int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr)
Decode the dc value.
Picture * current_picture_ptr
pointer to the current picture
#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)
#define CODEC_CAP_FRAME_THREADS
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
#define LAST_SKIP_BITS(name, gb, num)
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
int block_last_index[12]
last non zero coefficient in block
void ff_mpeg4_pred_ac(MpegEncContext *s, DCTELEM *block, int n, int dir)
Predict the ac.
const int16_t ff_mpeg4_default_non_intra_matrix[64]
uint8_t * mbintra_table
used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION
int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
RL_VLC_ELEM * rl_vlc[32]
decoding only
#define SHOW_UBITS(name, gb, num)
int sprite_brightness_change
#define SPRITE_TRAJ_VLC_BITS
int block_index[6]
index to current MB in block based arrays with edges
int * mb_index2xy
mb_index -> mb_x + mb_y*mb_stride
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
#define MV_TYPE_16X16
1 vector for the whole mb
int first_slice_line
used in mpeg4 too to handle resync markers
void ff_mpeg4_init_tables(void)
#define FF_PROFILE_MPEG4_CORE_SCALABLE
uint16_t inter_matrix[64]
int cplx_estimation_trash_i
#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE
void ff_thread_await_progress(AVFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
#define FF_BUG_XVID_ILACE
main external API structure.
static void close(AVCodecParserContext *s)
ScanTable intra_scantable
int height
picture size. must be a multiple of 16
static int get_xbits(GetBitContext *s, int n)
read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
#define OPEN_READER(name, gb)
int16_t(*[2] motion_val)[2]
motion vector table
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
#define SLICE_END
end marker found
int data_partitioning
data partitioning flag from header
#define FF_PROFILE_MPEG4_SIMPLE
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
#define FF_PROFILE_MPEG4_N_BIT
ScanTable intra_h_scantable
static void skip_bits(GetBitContext *s, int n)
static const AVProfile mpeg4_video_profiles[]
uint8_t * cbp_table
used to store cbp, ac_pred for partitioned decoding
#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE
#define FF_PROFILE_MPEG4_SIMPLE_STUDIO
#define ROUNDED_DIV(a, b)
#define GET_CACHE(name, gb)
DSPContext dsp
pointers for accelerated dsp functions
#define SKIP_CACHE(name, gb, num)
const int16_t ff_mpeg4_default_intra_matrix[64]
int f_code
forward MV resolution
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
static int mpeg4_decode_partition_a(MpegEncContext *s)
Decode first partition.
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
DCTELEM(* block)[64]
points to one of the following blocks
const uint8_t ff_mpeg4_dc_threshold[8]
int h263_pred
use mpeg4/h263 ac/dc predictions
int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s)
uint16_t pb_field_time
like above, just for interlaced
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
int8_t * qscale_table
QP table.
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
void(* clear_blocks)(DCTELEM *blocks)
Picture * next_picture_ptr
pointer to the next picture (for bidir pred)
struct AVCodecContext * avctx
#define SHOW_SBITS(name, gb, num)
static VLC sprite_trajectory
int ff_mpeg4_decode_picture_header(MpegEncContext *s, GetBitContext *gb)
Decode mpeg4 headers.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
#define FF_PROFILE_MPEG4_CORE
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
#define AVERROR_INVALIDDATA
static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count)
decode second partition.
int ff_h263_decode_end(AVCodecContext *avctx)
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
int resync_mb_y
y position of last resync marker
VLC_TYPE(* table)[2]
code, bits
Picture next_picture
copy of the next picture structure.
uint8_t * mbskip_table
mbskip_table[mb]>=1 if MB didn't change stride= mb_width = (width+15)>>4
static int mpeg4_decode_profile_level(MpegEncContext *s, GetBitContext *gb)
int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
Decode the next video packet.
int chroma_qscale
chroma QP
int ff_h263_decode_motion(MpegEncContext *s, int pred, int f_code)
int flags
AVCodecContext.flags (HQ, MV4, ...)
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
static int decode_user_data(MpegEncContext *s, GetBitContext *gb)
Decode the user data stuff in the header.
#define FF_DEBUG_STARTCODE
int workaround_bugs
workaround bugs in encoders which cannot be detected automatically
ScanTable inter_scantable
if inter == intra then intra should be used to reduce tha cache usage
#define FRAME_SKIPPED
return value for header parsers if frame is not coded
#define MV_TYPE_8X8
4 vectors (h263, mpeg4 4MV)
int b_code
backward MV resolution for B Frames (mpeg4)
static int get_amv(MpegEncContext *s, int n)
Get the average motion vector for a GMC MB.
static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
decode partition C of one MB.
AVPixelFormat
Pixel format.
const uint8_t ff_mb_type_b_tab[4][2]
#define CODEC_CAP_DRAW_HORIZ_BAND
#define INTRA_MCBPC_VLC_BITS
uint16_t pb_time
time distance between the last b and p,s,i frame