}
}
-int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
+int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
{
int x, y, wrap, a, c, pred_dc;
int16_t *dc_val;
}
}
-void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
+void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
{
int x, y, wrap, a, c, pred_dc, scale, i;
int16_t *dc_val, *ac_val, *ac_val1;
ac_val1[8 + i] = block[s->dsp.idct_permutation[i ]];
}
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
- int *px, int *py)
+int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
+ int *px, int *py)
{
int wrap;
int16_t *A, *B, *C, (*mot_val)[2];
extern const AVRational ff_h263_pixel_aspect[16];
extern const uint8_t ff_h263_cbpy_tab[16][2];
-extern const uint8_t cbpc_b_tab[4][2];
+extern const uint8_t ff_cbpc_b_tab[4][2];
-extern const uint8_t mvtab[33][2];
+extern const uint8_t ff_mvtab[33][2];
extern const uint8_t ff_h263_intra_MCBPC_code[9];
extern const uint8_t ff_h263_intra_MCBPC_bits[9];
extern const uint8_t ff_h263_inter_MCBPC_code[28];
extern const uint8_t ff_h263_inter_MCBPC_bits[28];
-extern const uint8_t h263_mbtype_b_tab[15][2];
+extern const uint8_t ff_h263_mbtype_b_tab[15][2];
extern VLC ff_h263_intra_MCBPC_vlc;
extern VLC ff_h263_inter_MCBPC_vlc;
extern RLTable ff_h263_rl_inter;
-extern RLTable rl_intra_aic;
+extern RLTable ff_rl_intra_aic;
-extern const uint16_t h263_format[8][2];
-extern const uint8_t modified_quant_tab[2][32];
+extern const uint16_t ff_h263_format[8][2];
+extern const uint8_t ff_modified_quant_tab[2][32];
extern uint16_t ff_mba_max[6];
extern uint8_t ff_mba_length[7];
extern uint8_t ff_h263_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
-int h263_decode_motion(MpegEncContext * s, int pred, int f_code);
+int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code);
av_const int ff_h263_aspect_to_info(AVRational aspect);
int ff_h263_decode_init(AVCodecContext *avctx);
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt);
int ff_h263_decode_end(AVCodecContext *avctx);
-void h263_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-void h263_encode_picture_header(MpegEncContext *s, int picture_number);
-void h263_encode_gob_header(MpegEncContext * s, int mb_line);
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
- int *px, int *py);
-void h263_encode_init(MpegEncContext *s);
-void h263_decode_init_vlc(MpegEncContext *s);
-int h263_decode_picture_header(MpegEncContext *s);
+void ff_h263_encode_mb(MpegEncContext *s,
+ DCTELEM block[6][64],
+ int motion_x, int motion_y);
+void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);
+void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);
+int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
+ int *px, int *py);
+void ff_h263_encode_init(MpegEncContext *s);
+void ff_h263_decode_init_vlc(MpegEncContext *s);
+int ff_h263_decode_picture_header(MpegEncContext *s);
int ff_h263_decode_gob_header(MpegEncContext *s);
void ff_h263_update_motion_val(MpegEncContext * s);
void ff_h263_loop_filter(MpegEncContext * s);
int ff_h263_decode_mba(MpegEncContext *s);
void ff_h263_encode_mba(MpegEncContext *s);
void ff_init_qscale_tab(MpegEncContext *s);
-int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
-void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);
+int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
+void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);
/**
int l, bit_size, code;
if (val == 0) {
- return mvtab[0][1];
+ return ff_mvtab[0][1];
} else {
bit_size = f_code - 1;
/* modulo encoding */
val--;
code = (val >> bit_size) + 1;
- return mvtab[code][1] + 1 + bit_size;
+ return ff_mvtab[code][1] + 1 + bit_size;
}
}
11, 13, 13, 13,/* inter4Q*/
};
-const uint8_t h263_mbtype_b_tab[15][2] = {
+const uint8_t ff_h263_mbtype_b_tab[15][2] = {
{1, 1},
{3, 3},
{1, 5},
{1, 8},
};
-const uint8_t cbpc_b_tab[4][2] = {
+const uint8_t ff_cbpc_b_tab[4][2] = {
{0, 1},
{2, 2},
{7, 3},
{2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
};
-const uint8_t mvtab[33][2] =
+const uint8_t ff_mvtab[33][2] =
{
{1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
{11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
};
/* third non intra table */
-const uint16_t inter_vlc[103][2] = {
+const uint16_t ff_inter_vlc[103][2] = {
{ 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
{ 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
{ 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
{ 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
};
-const int8_t inter_level[102] = {
+const int8_t ff_inter_level[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 1, 2, 3, 4,
5, 6, 1, 2, 3, 4, 1, 2,
1, 1, 1, 1, 1, 1,
};
-const int8_t inter_run[102] = {
+const int8_t ff_inter_run[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 3, 3,
RLTable ff_h263_rl_inter = {
102,
58,
- inter_vlc,
- inter_run,
- inter_level,
+ ff_inter_vlc,
+ ff_inter_run,
+ ff_inter_level,
};
static const uint16_t intra_vlc_aic[103][2] = {
1, 1, 1, 1, 1, 1,
};
-RLTable rl_intra_aic = {
+RLTable ff_rl_intra_aic = {
102,
58,
intra_vlc_aic,
intra_level_aic,
};
-const uint16_t h263_format[8][2] = {
+const uint16_t ff_h263_format[8][2] = {
{ 0, 0 },
{ 128, 96 },
{ 176, 144 },
0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
};
-const uint8_t modified_quant_tab[2][32]={
+const uint8_t ff_modified_quant_tab[2][32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
{
0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
if (MPV_common_init(s) < 0)
return -1;
- h263_decode_init_vlc(s);
+ ff_h263_decode_init_vlc(s);
return 0;
}
} else if (CONFIG_FLV_DECODER && s->h263_flv) {
ret = ff_flv_decode_picture_header(s);
} else {
- ret = h263_decode_picture_header(s);
+ ret = ff_h263_decode_picture_header(s);
}
if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_size);
s->pb_frame = get_bits1(&s->gb);
if (format < 6) {
- s->width = h263_format[format][0];
- s->height = h263_format[format][1];
+ s->width = ff_h263_format[format][0];
+ s->height = ff_h263_format[format][1];
s->avctx->sample_aspect_ratio.num = 12;
s->avctx->sample_aspect_ratio.den = 11;
} else {
/* init vlcs */
/* XXX: find a better solution to handle static init */
-void h263_decode_init_vlc(MpegEncContext *s)
+void ff_h263_decode_init_vlc(MpegEncContext *s)
{
static int done = 0;
&ff_h263_cbpy_tab[0][1], 2, 1,
&ff_h263_cbpy_tab[0][0], 2, 1, 64);
INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 538);
+ &ff_mvtab[0][1], 2, 1,
+ &ff_mvtab[0][0], 2, 1, 538);
init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
- init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]);
+ init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
INIT_VLC_RL(ff_h263_rl_inter, 554);
- INIT_VLC_RL(rl_intra_aic, 554);
+ INIT_VLC_RL(ff_rl_intra_aic, 554);
INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
- &h263_mbtype_b_tab[0][1], 2, 1,
- &h263_mbtype_b_tab[0][0], 2, 1, 80);
+ &ff_h263_mbtype_b_tab[0][1], 2, 1,
+ &ff_h263_mbtype_b_tab[0][0], 2, 1, 80);
INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
- &cbpc_b_tab[0][1], 2, 1,
- &cbpc_b_tab[0][0], 2, 1, 8);
+ &ff_cbpc_b_tab[0][1], 2, 1,
+ &ff_cbpc_b_tab[0][0], 2, 1, 8);
}
}
return -1;
}
-int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
+int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code)
{
int code, val, sign, shift;
code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
if ((cbpc & 16) == 0) {
s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
- mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
- mx = h263_decode_motion(s, pred_x, 1);
+ mx = ff_h263_decode_motion(s, pred_x, 1);
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
- my = h263_decode_motion(s, pred_y, 1);
+ my = ff_h263_decode_motion(s, pred_y, 1);
mot_val[0 ]= mot_val[2 ]=
mot_val[0+stride]= mot_val[2+stride]= mx;
} else {
s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
- mx = h263_decode_motion(s, pred_x, 1);
+ mx = ff_h263_decode_motion(s, pred_x, 1);
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
- my = h263_decode_motion(s, pred_y, 1);
+ my = ff_h263_decode_motion(s, pred_y, 1);
if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
mot_val[0] = mx;
if(s->modified_quant){
if(get_bits1(&s->gb))
- s->qscale= modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
+ s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
else
s->qscale= get_bits(&s->gb, 5);
}else
scan_table = s->intra_scantable.permutated;
if (s->h263_aic && s->mb_intra) {
- rl = &rl_intra_aic;
+ rl = &ff_rl_intra_aic;
i = 0;
if (s->ac_pred) {
if (s->h263_aic_dir)
if (i >= 64){
if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){
//Looks like a hack but no, it's the way it is supposed to work ...
- rl = &rl_intra_aic;
+ rl = &ff_rl_intra_aic;
i = 0;
s->gb= gb;
s->dsp.clear_block(block);
}
not_coded:
if (s->mb_intra && s->h263_aic) {
- h263_pred_acdc(s, block, n);
+ ff_h263_pred_acdc(s, block, n);
i = 63;
}
s->block_last_index[n] = i;
s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
s->mv_type = MV_TYPE_16X16;
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
- mx = h263_decode_motion(s, pred_x, 1);
+ mx = ff_h263_decode_motion(s, pred_x, 1);
if (mx >= 0xffff)
return -1;
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
- my = h263_decode_motion(s, pred_y, 1);
+ my = ff_h263_decode_motion(s, pred_y, 1);
if (my >= 0xffff)
return -1;
s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
s->mv_type = MV_TYPE_8X8;
for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
- mx = h263_decode_motion(s, pred_x, 1);
+ mx = ff_h263_decode_motion(s, pred_x, 1);
if (mx >= 0xffff)
return -1;
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
- my = h263_decode_motion(s, pred_y, 1);
+ my = ff_h263_decode_motion(s, pred_y, 1);
if (my >= 0xffff)
return -1;
s->mv[0][i][0] = mx;
//FIXME UMV
if(USES_LIST(mb_type, 0)){
- int16_t *mot_val= h263_pred_motion(s, 0, 0, &mx, &my);
+ int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &mx, &my);
s->mv_dir = MV_DIR_FORWARD;
- mx = h263_decode_motion(s, mx, 1);
- my = h263_decode_motion(s, my, 1);
+ mx = ff_h263_decode_motion(s, mx, 1);
+ my = ff_h263_decode_motion(s, my, 1);
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
}
if(USES_LIST(mb_type, 1)){
- int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my);
+ int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &mx, &my);
s->mv_dir |= MV_DIR_BACKWARD;
- mx = h263_decode_motion(s, mx, 1);
- my = h263_decode_motion(s, my, 1);
+ mx = ff_h263_decode_motion(s, mx, 1);
+ my = ff_h263_decode_motion(s, my, 1);
s->mv[1][0][0] = mx;
s->mv[1][0][1] = my;
}
while(pb_mv_count--){
- h263_decode_motion(s, 0, 1);
- h263_decode_motion(s, 0, 1);
+ ff_h263_decode_motion(s, 0, 1);
+ ff_h263_decode_motion(s, 0, 1);
}
/* decode each block */
}
/* most is hardcoded. should extend to handle all h263 streams */
-int h263_decode_picture_header(MpegEncContext *s)
+int ff_h263_decode_picture_header(MpegEncContext *s)
{
int format, width, height, i;
uint32_t startcode;
if (format != 7 && format != 6) {
s->h263_plus = 0;
/* H.263v1 */
- width = h263_format[format][0];
- height = h263_format[format][1];
+ width = ff_h263_format[format][0];
+ height = ff_h263_format[format][1];
if (!width)
return -1;
s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info];
}
} else {
- width = h263_format[format][0];
- height = h263_format[format][1];
+ width = ff_h263_format[format][0];
+ height = ff_h263_format[format][1];
s->avctx->sample_aspect_ratio= (AVRational){12,11};
}
if ((width == 0) || (height == 0))
return FF_ASPECT_EXTENDED;
}
-void h263_encode_picture_header(MpegEncContext * s, int picture_number)
+void ff_h263_encode_picture_header(MpegEncContext * s, int picture_number)
{
int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref;
int best_clock_code=1;
put_bits(&s->pb, 1, 0); /* camera off */
put_bits(&s->pb, 1, 0); /* freeze picture release off */
- format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height);
+ format = ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format), s->width, s->height);
if (!s->h263_plus) {
/* H.263v1 */
put_bits(&s->pb, 3, format);
/**
* Encode a group of blocks header.
*/
-void h263_encode_gob_header(MpegEncContext * s, int mb_line)
+void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line)
{
put_bits(&s->pb, 17, 1); /* GBSC */
} else {
i = 0;
if (s->h263_aic && s->mb_intra)
- rl = &rl_intra_aic;
+ rl = &ff_rl_intra_aic;
if(s->alt_inter_vlc && !s->mb_intra){
int aic_vlc_bits=0;
if(level<0) level= -level;
code = get_rl_index(rl, last, run, level);
- aic_code = get_rl_index(&rl_intra_aic, last, run, level);
+ aic_code = get_rl_index(&ff_rl_intra_aic, last, run, level);
inter_vlc_bits += rl->table_vlc[code][1]+1;
- aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1;
+ aic_vlc_bits += ff_rl_intra_aic.table_vlc[aic_code][1]+1;
if (code == rl->n) {
inter_vlc_bits += 1+6+8-1;
}
- if (aic_code == rl_intra_aic.n) {
+ if (aic_code == ff_rl_intra_aic.n) {
aic_vlc_bits += 1+6+8-1;
wrong_pos += run + 1;
}else
}
i = 0;
if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63)
- rl = &rl_intra_aic;
+ rl = &ff_rl_intra_aic;
}
}
}
}
-void h263_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
+void ff_h263_encode_mb(MpegEncContext * s,
+ DCTELEM block[6][64],
+ int motion_x, int motion_y)
{
int cbpc, cbpy, i, cbp, pred_x, pred_y;
int16_t pred_dc;
}
/* motion vectors: 16x16 mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
if (!s->umvplus) {
ff_h263_encode_motion_vector(s, motion_x - pred_x,
for(i=0; i<4; i++){
/* motion vectors: 8x8 mode*/
- h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
motion_x = s->current_picture.f.motion_val[0][s->block_index[i]][0];
motion_y = s->current_picture.f.motion_val[0][s->block_index[i]][1];
if(i<4) scale= s->y_dc_scale;
else scale= s->c_dc_scale;
- pred_dc = h263_pred_dc(s, i, &dc_ptr[i]);
+ pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]);
level -= pred_dc;
/* Quant */
if (level >= 0)
if (val == 0) {
/* zero vector */
code = 0;
- put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
+ put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
} else {
bit_size = f_code - 1;
range = 1 << bit_size;
code = (val >> bit_size) + 1;
bits = val & (range - 1);
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
+ put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
if (bit_size > 0) {
put_bits(&s->pb, bit_size, bits);
}
for(mv=-MAX_MV; mv<=MAX_MV; mv++){
int len;
- if(mv==0) len= mvtab[0][1];
+ if(mv==0) len= ff_mvtab[0][1];
else{
int val, bit_size, code;
val--;
code = (val >> bit_size) + 1;
if(code<33){
- len= mvtab[code][1] + 1 + bit_size;
+ len= ff_mvtab[code][1] + 1 + bit_size;
}else{
- len= mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
+ len= ff_mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
}
}
}
}
-void h263_encode_init(MpegEncContext *s)
+void ff_h263_encode_init(MpegEncContext *s)
{
static int done = 0;
done = 1;
init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
- init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]);
+ init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
- init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
+ init_uni_h263_rl_tab(&ff_rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
init_uni_h263_rl_tab(&ff_h263_rl_inter , NULL, uni_h263_inter_rl_len);
init_mv_penalty_and_fcode(s);
if ((cbpc & 16) == 0) {
/* 16x16 motion prediction */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
if(!s->mcsel){
- mx = h263_decode_motion(s, pred_x, s->f_code);
+ mx = ff_h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
- my = h263_decode_motion(s, pred_y, s->f_code);
+ my = ff_h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
int i;
s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
for(i=0;i<4;i++) {
- int16_t *mot_val= h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
+ int16_t *mot_val= ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ mx = ff_h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
- my = h263_decode_motion(s, pred_y, s->f_code);
+ my = ff_h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
mot_val[0] = mx;
s->field_select[0][0]= get_bits1(&s->gb);
s->field_select[0][1]= get_bits1(&s->gb);
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
for(i=0; i<2; i++){
- mx = h263_decode_motion(s, pred_x, s->f_code);
+ mx = ff_h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
- my = h263_decode_motion(s, pred_y/2, s->f_code);
+ my = ff_h263_decode_motion(s, pred_y/2, s->f_code);
if (my >= 0xffff)
return -1;
s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
s->mv_type = MV_TYPE_16X16;
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ mx = ff_h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
- my = h263_decode_motion(s, pred_y, s->f_code);
+ my = ff_h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
s->mv_type = MV_TYPE_8X8;
for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
+ mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ mx = ff_h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
- my = h263_decode_motion(s, pred_y, s->f_code);
+ my = ff_h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
s->mv[0][i][0] = mx;
if(USES_LIST(mb_type, 0)){
s->mv_dir = MV_DIR_FORWARD;
- mx = h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
- my = h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
+ mx = ff_h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
+ my = ff_h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx;
s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my;
}
if(USES_LIST(mb_type, 1)){
s->mv_dir |= MV_DIR_BACKWARD;
- mx = h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
- my = h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
+ mx = ff_h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
+ my = ff_h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
s->last_mv[1][1][0]= s->last_mv[1][0][0]= s->mv[1][0][0] = mx;
s->last_mv[1][1][1]= s->last_mv[1][0][1]= s->mv[1][0][1] = my;
}
s->mv_dir = MV_DIR_FORWARD;
for(i=0; i<2; i++){
- mx = h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code);
- my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
+ mx = ff_h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code);
+ my = ff_h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
s->last_mv[0][i][0]= s->mv[0][i][0] = mx;
s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2;
}
s->mv_dir |= MV_DIR_BACKWARD;
for(i=0; i<2; i++){
- mx = h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code);
- my = h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code);
+ mx = ff_h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code);
+ my = ff_h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code);
s->last_mv[1][i][0]= s->mv[1][i][0] = mx;
s->last_mv[1][i][1]= (s->mv[1][i][1] = my)*2;
}
if(IS_SKIP(mb_type))
mx=my=0;
else{
- mx = h263_decode_motion(s, 0, 1);
- my = h263_decode_motion(s, 0, 1);
+ mx = ff_h263_decode_motion(s, 0, 1);
+ my = ff_h263_decode_motion(s, 0, 1);
}
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
}
/* motion vectors: 16x16 mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
ff_h263_encode_motion_vector(s, motion_x - pred_x,
motion_y - pred_y, s->f_code);
}
/* motion vectors: 16x8 interlaced mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
pred_y /=2;
put_bits(&s->pb, 1, s->field_select[0][0]);
for(i=0; i<4; i++){
/* motion vectors: 8x8 mode*/
- h263_pred_motion(s, i, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
ff_h263_encode_motion_vector(s, s->current_picture.f.motion_val[0][ s->block_index[i] ][0] - pred_x,
s->current_picture.f.motion_val[0][ s->block_index[i] ][1] - pred_y, s->f_code);
case CODEC_ID_H263:
if (!CONFIG_H263_ENCODER)
return -1;
- if (ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format),
+ if (ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format),
s->width, s->height) == 8) {
av_log(avctx, AV_LOG_INFO,
"The specified picture size of %dx%d is not valid for "
if (CONFIG_H261_ENCODER && s->out_format == FMT_H261)
ff_h261_encode_init(s);
if (CONFIG_H263_ENCODER && s->out_format == FMT_H263)
- h263_encode_init(s);
+ ff_h263_encode_init(s);
if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
ff_msmpeg4_encode_init(s);
if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
case CODEC_ID_RV10:
case CODEC_ID_RV20:
if (CONFIG_H263_ENCODER)
- h263_encode_mb(s, s->block, motion_x, motion_y);
+ ff_h263_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_MJPEG:
if (CONFIG_MJPEG_ENCODER)
case CODEC_ID_H263:
case CODEC_ID_H263P:
if (CONFIG_H263_ENCODER)
- h263_encode_gob_header(s, mb_y);
+ ff_h263_encode_gob_header(s, mb_y);
break;
}
else if (CONFIG_FLV_ENCODER && s->codec_id == CODEC_ID_FLV1)
ff_flv_encode_picture_header(s, picture_number);
else if (CONFIG_H263_ENCODER)
- h263_encode_picture_header(s, picture_number);
+ ff_h263_encode_picture_header(s, picture_number);
break;
case FMT_MPEG1:
if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
if (val == 0) {
/* zero vector */
code = 0;
- put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
+ put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
} else {
bit_size = s->f_code - 1;
range = 1 << bit_size;
code = (val >> bit_size) + 1;
bits = val & (range - 1);
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
+ put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
if (bit_size > 0) {
put_bits(&s->pb, bit_size, bits);
}
s->misc_bits += get_bits_diff(s);
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
msmpeg4v2_encode_motion(s, motion_x - pred_x);
msmpeg4v2_encode_motion(s, motion_y - pred_y);
}else{
s->misc_bits += get_bits_diff(s);
/* motion vector */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
ff_msmpeg4_encode_motion(s, motion_x - pred_x,
motion_y - pred_y);
}
cbp|= cbpy<<2;
if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C;
- h263_pred_motion(s, 0, 0, &mx, &my);
+ ff_h263_pred_motion(s, 0, 0, &mx, &my);
mx= msmpeg4v2_decode_motion(s, mx, 1);
my= msmpeg4v2_decode_motion(s, my, 1);
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
}
- h263_pred_motion(s, 0, 0, &mx, &my);
+ ff_h263_pred_motion(s, 0, 0, &mx, &my);
if (ff_msmpeg4_decode_motion(s, &mx, &my) < 0)
return -1;
s->mv_dir = MV_DIR_FORWARD;
&v2_mb_type[0][1], 2, 1,
&v2_mb_type[0][0], 2, 1, 128);
INIT_VLC_STATIC(&v2_mv_vlc, V2_MV_VLC_BITS, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 538);
+ &ff_mvtab[0][1], 2, 1,
+ &ff_mvtab[0][0], 2, 1, 538);
INIT_VLC_STATIC(&ff_mb_non_intra_vlc[0], MB_NON_INTRA_VLC_BITS, 128,
&wmv2_inter_table[0][0][1], 8, 4,
29, 30, 31, 32, 33, 34, 35, 36,
};
-extern const uint16_t inter_vlc[103][2];
-extern const int8_t inter_level[102];
-extern const int8_t inter_run[102];
+extern const uint16_t ff_inter_vlc[103][2];
+extern const int8_t ff_inter_level[102];
+extern const int8_t ff_inter_run[102];
extern const uint16_t ff_mpeg4_intra_vlc[103][2];
extern const int8_t ff_mpeg4_intra_level[102];
{
102,
58,
- inter_vlc,
- inter_run,
- inter_level,
+ ff_inter_vlc,
+ ff_inter_run,
+ ff_inter_level,
},
};
if (MPV_common_init(s) < 0)
return -1;
- h263_decode_init_vlc(s);
+ ff_h263_decode_init_vlc(s);
/* init rv vlc */
if (!done) {
/**
* table for obtaining the quantizer difference
- * @todo Use with modified_quant_tab from h263data.h.
+ * @todo Use with ff_modified_quant_tab from h263data.h.
*/
static const uint8_t rv34_dquant_tab[2][32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
- h263_encode_init(&s->m); //mv_penalty
+ ff_h263_encode_init(&s->m); //mv_penalty
s->max_ref_frames = FFMAX(FFMIN(avctx->refs, MAX_REF_FRAMES), 1);
#undef NDEBUG
#include <assert.h>
-extern const uint8_t mvtab[33][2];
+extern const uint8_t ff_mvtab[33][2];
static VLC svq1_block_type;
static VLC svq1_motion_component;
&ff_svq1_block_type_vlc[0][0], 2, 1, 6);
INIT_VLC_STATIC(&svq1_motion_component, 7, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 176);
+ &ff_mvtab[0][1], 2, 1,
+ &ff_mvtab[0][0], 2, 1, 176);
for (i = 0; i < 6; i++) {
static const uint8_t sizes[2][6] = {{14, 10, 14, 18, 16, 18}, {10, 10, 14, 14, 14, 16}};
int mx, my, pred_x, pred_y, dxy;
int16_t *motion_ptr;
- motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
+ motion_ptr= ff_h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
if(s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTER){
for(i=0; i<6; i++)
init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32);
s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->mb_type = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int16_t));
s->dummy = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int32_t));
- h263_encode_init(&s->m); //mv_penalty
+ ff_h263_encode_init(&s->m); //mv_penalty
return 0;
}
wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
/* motion vector */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
+ ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
ff_msmpeg4_encode_motion(s, motion_x - pred_x,
motion_y - pred_y);
} else {