45 int c_wrap, c_xy, l_wrap, l_xy;
48 l_xy= (2*s->
mb_y-1)*l_wrap + s->
mb_x*2 - 1;
50 c_xy= (s->
mb_y-1)*c_wrap + s->
mb_x - 1;
60 memset(s->
ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*
sizeof(int16_t));
61 memset(s->
ac_val[1] + c_xy, 0, (c_wrap +1)*16*
sizeof(int16_t));
62 memset(s->
ac_val[2] + c_xy, 0, (c_wrap +1)*16*
sizeof(int16_t));
74 #define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0]))
75 #define tab_bias (tab_size/2)
95 s->
mv[1][i][0] = mx ? s->
mv[0][i][0] - p_mx
98 s->
mv[0][i][0] = p_mx*time_pb/time_pp + mx;
99 s->
mv[1][i][0] = mx ? s->
mv[0][i][0] - p_mx
100 : p_mx*(time_pb - time_pp)/time_pp;
105 s->
mv[1][i][1] = my ? s->
mv[0][i][1] - p_my
108 s->
mv[0][i][1] = p_my*time_pb/time_pp + my;
109 s->
mv[1][i][1] = my ? s->
mv[0][i][1] - p_my
110 : p_my*(time_pb - time_pp)/time_pp;
131 if(
IS_8X8(colocated_mb_type)){
160 s->
mv[0][1][0] = s->
mv[0][2][0] = s->
mv[0][3][0] = s->
mv[0][0][0];
161 s->
mv[0][1][1] = s->
mv[0][2][1] = s->
mv[0][3][1] = s->
mv[0][0][1];
162 s->
mv[1][1][0] = s->
mv[1][2][0] = s->
mv[1][3][0] = s->
mv[1][0][0];
163 s->
mv[1][1][1] = s->
mv[1][2][1] = s->
mv[1][3][1] = s->
mv[1][0][1];
#define MV_TYPE_FIELD
2 vectors, one per field
int last_mv[2][2][2]
last MV, used for MV prediction in MPEG1 & B-frame MPEG4
int16_t(*[3] ac_val)[16]
used for for mpeg4 AC prediction, all 3 arrays must be continuous
int16_t(*[2][2] p_field_mv_table)[2]
MV table (2MV per MB) interlaced p-frame encoding.
void ff_mpeg4_clean_buffers(MpegEncContext *s)
uint16_t pp_time
time distance between the last 2 p,s,i frames
#define FF_BUG_DIRECT_BLOCKSIZE
int16_t * dc_val[3]
used for mpeg4 DC prediction, all 3 arrays must be continuous
int16_t direct_scale_mv[2][64]
precomputed to avoid divisions in ff_mpeg4_set_direct_mv
static void memsetw(short *tab, int val, int n)
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
int quarter_sample
1->qpel, 0->half pel ME/MC
uint8_t ff_mpeg4_static_rl_table_store[3][2][2 *MAX_RUN+MAX_LEVEL+3]
int block_index[6]
index to current MB in block based arrays with edges
#define MB_TYPE_INTERLACED
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
#define MV_TYPE_16X16
1 vector for the whole mb
int16_t(*[2] motion_val)[2]
motion vector table
int8_t * ref_index[2]
motion reference frame index the order in which these are stored can depend on the codec...
int f_code
forward MV resolution
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s)
uint16_t pb_field_time
like above, just for interlaced
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
struct AVCodecContext * avctx
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
static void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i)
int workaround_bugs
Work around bugs in encoders which sometimes cannot be detected automatically.
Picture next_picture
copy of the next picture structure.
#define MV_TYPE_8X8
4 vectors (h263, mpeg4 4MV)
int b_code
backward MV resolution for B Frames (mpeg4)
uint16_t pb_time
time distance between the last b and p,s,i frame