Originally committed as revision 21098 to svn://svn.ffmpeg.org/ffmpeg/trunk
Michael Niedermayer authored on 2010/01/09 02:51:48... | ... |
@@ -505,7 +505,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) |
505 | 505 |
int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code; |
506 | 506 |
RLTable *rl; |
507 | 507 |
|
508 |
- rl = &rl_inter; |
|
508 |
+ rl = &ff_h263_rl_inter; |
|
509 | 509 |
if (s->mb_intra && !s->h263_aic) { |
510 | 510 |
/* DC coef */ |
511 | 511 |
level = block[0]; |
... | ... |
@@ -723,10 +723,10 @@ void h263_encode_mb(MpegEncContext * s, |
723 | 723 |
if(s->dquant) cbpc+= 8; |
724 | 724 |
if(s->mv_type==MV_TYPE_16X16){ |
725 | 725 |
put_bits(&s->pb, |
726 |
- inter_MCBPC_bits[cbpc], |
|
727 |
- inter_MCBPC_code[cbpc]); |
|
726 |
+ ff_h263_inter_MCBPC_bits[cbpc], |
|
727 |
+ ff_h263_inter_MCBPC_code[cbpc]); |
|
728 | 728 |
|
729 |
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
729 |
+ put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
730 | 730 |
if(s->dquant) |
731 | 731 |
put_bits(&s->pb, 2, dquant_code[s->dquant+2]); |
732 | 732 |
|
... | ... |
@@ -750,9 +750,9 @@ void h263_encode_mb(MpegEncContext * s, |
750 | 750 |
} |
751 | 751 |
}else{ |
752 | 752 |
put_bits(&s->pb, |
753 |
- inter_MCBPC_bits[cbpc+16], |
|
754 |
- inter_MCBPC_code[cbpc+16]); |
|
755 |
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
753 |
+ ff_h263_inter_MCBPC_bits[cbpc+16], |
|
754 |
+ ff_h263_inter_MCBPC_code[cbpc+16]); |
|
755 |
+ put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
756 | 756 |
if(s->dquant) |
757 | 757 |
put_bits(&s->pb, 2, dquant_code[s->dquant+2]); |
758 | 758 |
|
... | ... |
@@ -845,21 +845,21 @@ void h263_encode_mb(MpegEncContext * s, |
845 | 845 |
if (s->pict_type == FF_I_TYPE) { |
846 | 846 |
if(s->dquant) cbpc+=4; |
847 | 847 |
put_bits(&s->pb, |
848 |
- intra_MCBPC_bits[cbpc], |
|
849 |
- intra_MCBPC_code[cbpc]); |
|
848 |
+ ff_h263_intra_MCBPC_bits[cbpc], |
|
849 |
+ ff_h263_intra_MCBPC_code[cbpc]); |
|
850 | 850 |
} else { |
851 | 851 |
if(s->dquant) cbpc+=8; |
852 | 852 |
put_bits(&s->pb, 1, 0); /* mb coded */ |
853 | 853 |
put_bits(&s->pb, |
854 |
- inter_MCBPC_bits[cbpc + 4], |
|
855 |
- inter_MCBPC_code[cbpc + 4]); |
|
854 |
+ ff_h263_inter_MCBPC_bits[cbpc + 4], |
|
855 |
+ ff_h263_inter_MCBPC_code[cbpc + 4]); |
|
856 | 856 |
} |
857 | 857 |
if (s->h263_aic) { |
858 | 858 |
/* XXX: currently, we do not try to use ac prediction */ |
859 | 859 |
put_bits(&s->pb, 1, 0); /* no AC prediction */ |
860 | 860 |
} |
861 | 861 |
cbpy = cbp >> 2; |
862 |
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
862 |
+ put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
863 | 863 |
if(s->dquant) |
864 | 864 |
put_bits(&s->pb, 2, dquant_code[s->dquant+2]); |
865 | 865 |
|
... | ... |
@@ -1247,11 +1247,11 @@ void h263_encode_init(MpegEncContext *s) |
1247 | 1247 |
if (!done) { |
1248 | 1248 |
done = 1; |
1249 | 1249 |
|
1250 |
- init_rl(&rl_inter, static_rl_table_store[0]); |
|
1250 |
+ init_rl(&ff_h263_rl_inter, static_rl_table_store[0]); |
|
1251 | 1251 |
init_rl(&rl_intra_aic, static_rl_table_store[1]); |
1252 | 1252 |
|
1253 | 1253 |
init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len); |
1254 |
- init_uni_h263_rl_tab(&rl_inter , NULL, uni_h263_inter_rl_len); |
|
1254 |
+ init_uni_h263_rl_tab(&ff_h263_rl_inter , NULL, uni_h263_inter_rl_len); |
|
1255 | 1255 |
|
1256 | 1256 |
init_mv_penalty_and_fcode(s); |
1257 | 1257 |
} |
... | ... |
@@ -1305,9 +1305,9 @@ void h263_encode_init(MpegEncContext *s) |
1305 | 1305 |
/***********************************************/ |
1306 | 1306 |
/* decoding */ |
1307 | 1307 |
|
1308 |
-VLC intra_MCBPC_vlc; |
|
1309 |
-VLC inter_MCBPC_vlc; |
|
1310 |
-VLC cbpy_vlc; |
|
1308 |
+VLC ff_h263_intra_MCBPC_vlc; |
|
1309 |
+VLC ff_h263_inter_MCBPC_vlc; |
|
1310 |
+VLC ff_h263_cbpy_vlc; |
|
1311 | 1311 |
static VLC mv_vlc; |
1312 | 1312 |
static VLC h263_mbtype_b_vlc; |
1313 | 1313 |
static VLC cbpc_b_vlc; |
... | ... |
@@ -1322,21 +1322,21 @@ void h263_decode_init_vlc(MpegEncContext *s) |
1322 | 1322 |
if (!done) { |
1323 | 1323 |
done = 1; |
1324 | 1324 |
|
1325 |
- INIT_VLC_STATIC(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, |
|
1326 |
- intra_MCBPC_bits, 1, 1, |
|
1327 |
- intra_MCBPC_code, 1, 1, 72); |
|
1328 |
- INIT_VLC_STATIC(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, |
|
1329 |
- inter_MCBPC_bits, 1, 1, |
|
1330 |
- inter_MCBPC_code, 1, 1, 198); |
|
1331 |
- INIT_VLC_STATIC(&cbpy_vlc, CBPY_VLC_BITS, 16, |
|
1332 |
- &cbpy_tab[0][1], 2, 1, |
|
1333 |
- &cbpy_tab[0][0], 2, 1, 64); |
|
1325 |
+ INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, |
|
1326 |
+ ff_h263_intra_MCBPC_bits, 1, 1, |
|
1327 |
+ ff_h263_intra_MCBPC_code, 1, 1, 72); |
|
1328 |
+ INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, |
|
1329 |
+ ff_h263_inter_MCBPC_bits, 1, 1, |
|
1330 |
+ ff_h263_inter_MCBPC_code, 1, 1, 198); |
|
1331 |
+ INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, |
|
1332 |
+ &ff_h263_cbpy_tab[0][1], 2, 1, |
|
1333 |
+ &ff_h263_cbpy_tab[0][0], 2, 1, 64); |
|
1334 | 1334 |
INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33, |
1335 | 1335 |
&mvtab[0][1], 2, 1, |
1336 | 1336 |
&mvtab[0][0], 2, 1, 538); |
1337 |
- init_rl(&rl_inter, static_rl_table_store[0]); |
|
1337 |
+ init_rl(&ff_h263_rl_inter, static_rl_table_store[0]); |
|
1338 | 1338 |
init_rl(&rl_intra_aic, static_rl_table_store[1]); |
1339 |
- INIT_VLC_RL(rl_inter, 554); |
|
1339 |
+ INIT_VLC_RL(ff_h263_rl_inter, 554); |
|
1340 | 1340 |
INIT_VLC_RL(rl_intra_aic, 554); |
1341 | 1341 |
INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, |
1342 | 1342 |
&h263_mbtype_b_tab[0][1], 2, 1, |
... | ... |
@@ -1606,13 +1606,13 @@ static void preview_obmc(MpegEncContext *s){ |
1606 | 1606 |
s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; |
1607 | 1607 |
goto end; |
1608 | 1608 |
} |
1609 |
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1609 |
+ cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1610 | 1610 |
}while(cbpc == 20); |
1611 | 1611 |
|
1612 | 1612 |
if(cbpc & 4){ |
1613 | 1613 |
s->current_picture.mb_type[xy]= MB_TYPE_INTRA; |
1614 | 1614 |
}else{ |
1615 |
- get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1615 |
+ get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1616 | 1616 |
if (cbpc & 8) { |
1617 | 1617 |
if(s->modified_quant){ |
1618 | 1618 |
if(get_bits1(&s->gb)) skip_bits(&s->gb, 1); |
... | ... |
@@ -1687,7 +1687,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, |
1687 | 1687 |
int n, int coded) |
1688 | 1688 |
{ |
1689 | 1689 |
int code, level, i, j, last, run; |
1690 |
- RLTable *rl = &rl_inter; |
|
1690 |
+ RLTable *rl = &ff_h263_rl_inter; |
|
1691 | 1691 |
const uint8_t *scan_table; |
1692 | 1692 |
GetBitContext gb= s->gb; |
1693 | 1693 |
|
... | ... |
@@ -1780,7 +1780,7 @@ retry: |
1780 | 1780 |
} |
1781 | 1781 |
i += run; |
1782 | 1782 |
if (i >= 64){ |
1783 |
- if(s->alt_inter_vlc && rl == &rl_inter && !s->mb_intra){ |
|
1783 |
+ if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){ |
|
1784 | 1784 |
//Looks like a hack but no, it's the way it is supposed to work ... |
1785 | 1785 |
rl = &rl_intra_aic; |
1786 | 1786 |
i = 0; |
... | ... |
@@ -1868,7 +1868,7 @@ int ff_h263_decode_mb(MpegEncContext *s, |
1868 | 1868 |
s->mb_skipped = !(s->obmc | s->loop_filter); |
1869 | 1869 |
goto end; |
1870 | 1870 |
} |
1871 |
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1871 |
+ cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1872 | 1872 |
if (cbpc < 0){ |
1873 | 1873 |
av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y); |
1874 | 1874 |
return -1; |
... | ... |
@@ -1883,7 +1883,7 @@ int ff_h263_decode_mb(MpegEncContext *s, |
1883 | 1883 |
|
1884 | 1884 |
if(s->pb_frame && get_bits1(&s->gb)) |
1885 | 1885 |
pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); |
1886 |
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1886 |
+ cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1887 | 1887 |
|
1888 | 1888 |
if(s->alt_inter_vlc==0 || (cbpc & 3)!=3) |
1889 | 1889 |
cbpy ^= 0xF; |
... | ... |
@@ -1977,7 +1977,7 @@ int ff_h263_decode_mb(MpegEncContext *s, |
1977 | 1977 |
goto intra; |
1978 | 1978 |
} |
1979 | 1979 |
|
1980 |
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1980 |
+ cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1981 | 1981 |
|
1982 | 1982 |
if (cbpy < 0){ |
1983 | 1983 |
av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y); |
... | ... |
@@ -2035,7 +2035,7 @@ int ff_h263_decode_mb(MpegEncContext *s, |
2035 | 2035 |
s->current_picture.mb_type[xy]= mb_type; |
2036 | 2036 |
} else { /* I-Frame */ |
2037 | 2037 |
do{ |
2038 |
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
2038 |
+ cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
2039 | 2039 |
if (cbpc < 0){ |
2040 | 2040 |
av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y); |
2041 | 2041 |
return -1; |
... | ... |
@@ -2060,7 +2060,7 @@ intra: |
2060 | 2060 |
|
2061 | 2061 |
if(s->pb_frame && get_bits1(&s->gb)) |
2062 | 2062 |
pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); |
2063 |
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
2063 |
+ cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
2064 | 2064 |
if(cbpy<0){ |
2065 | 2065 |
av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y); |
2066 | 2066 |
return -1; |
... | ... |
@@ -30,21 +30,21 @@ |
30 | 30 |
#define TEX_VLC_BITS 9 |
31 | 31 |
|
32 | 32 |
extern const AVRational ff_h263_pixel_aspect[16]; |
33 |
-extern const uint8_t cbpy_tab[16][2]; |
|
33 |
+extern const uint8_t ff_h263_cbpy_tab[16][2]; |
|
34 | 34 |
|
35 | 35 |
extern const uint8_t mvtab[33][2]; |
36 | 36 |
|
37 |
-extern const uint8_t intra_MCBPC_code[9]; |
|
38 |
-extern const uint8_t intra_MCBPC_bits[9]; |
|
37 |
+extern const uint8_t ff_h263_intra_MCBPC_code[9]; |
|
38 |
+extern const uint8_t ff_h263_intra_MCBPC_bits[9]; |
|
39 | 39 |
|
40 |
-extern const uint8_t inter_MCBPC_code[28]; |
|
41 |
-extern const uint8_t inter_MCBPC_bits[28]; |
|
40 |
+extern const uint8_t ff_h263_inter_MCBPC_code[28]; |
|
41 |
+extern const uint8_t ff_h263_inter_MCBPC_bits[28]; |
|
42 | 42 |
|
43 |
-extern VLC intra_MCBPC_vlc; |
|
44 |
-extern VLC inter_MCBPC_vlc; |
|
45 |
-extern VLC cbpy_vlc; |
|
43 |
+extern VLC ff_h263_intra_MCBPC_vlc; |
|
44 |
+extern VLC ff_h263_inter_MCBPC_vlc; |
|
45 |
+extern VLC ff_h263_cbpy_vlc; |
|
46 | 46 |
|
47 |
-extern RLTable rl_inter; |
|
47 |
+extern RLTable ff_h263_rl_inter; |
|
48 | 48 |
|
49 | 49 |
int h263_decode_motion(MpegEncContext * s, int pred, int f_code); |
50 | 50 |
av_const int ff_h263_aspect_to_info(AVRational aspect); |
... | ... |
@@ -90,7 +90,7 @@ static inline int get_p_cbp(MpegEncContext * s, |
90 | 90 |
const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6); |
91 | 91 |
|
92 | 92 |
for(i=0; i<4; i++){ |
93 |
- int score= inter_MCBPC_bits[i + offset] * lambda; |
|
93 |
+ int score= ff_h263_inter_MCBPC_bits[i + offset] * lambda; |
|
94 | 94 |
if(i&1) score += s->coded_score[5]; |
95 | 95 |
if(i&2) score += s->coded_score[4]; |
96 | 96 |
|
... | ... |
@@ -101,7 +101,7 @@ static inline int get_p_cbp(MpegEncContext * s, |
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
for(i=0; i<16; i++){ |
104 |
- int score= cbpy_tab[i ^ 0xF][1] * lambda; |
|
104 |
+ int score= ff_h263_cbpy_tab[i ^ 0xF][1] * lambda; |
|
105 | 105 |
if(i&1) score += s->coded_score[3]; |
106 | 106 |
if(i&2) score += s->coded_score[2]; |
107 | 107 |
if(i&4) score += s->coded_score[1]; |
... | ... |
@@ -33,12 +33,12 @@ |
33 | 33 |
#include "mpegvideo.h" |
34 | 34 |
|
35 | 35 |
/* intra MCBPC, mb_type = (intra), then (intraq) */ |
36 |
-const uint8_t intra_MCBPC_code[9] = { 1, 1, 2, 3, 1, 1, 2, 3, 1 }; |
|
37 |
-const uint8_t intra_MCBPC_bits[9] = { 1, 3, 3, 3, 4, 6, 6, 6, 9 }; |
|
36 |
+const uint8_t ff_h263_intra_MCBPC_code[9] = { 1, 1, 2, 3, 1, 1, 2, 3, 1 }; |
|
37 |
+const uint8_t ff_h263_intra_MCBPC_bits[9] = { 1, 3, 3, 3, 4, 6, 6, 6, 9 }; |
|
38 | 38 |
|
39 | 39 |
/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */ |
40 | 40 |
/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */ |
41 |
-const uint8_t inter_MCBPC_code[28] = { |
|
41 |
+const uint8_t ff_h263_inter_MCBPC_code[28] = { |
|
42 | 42 |
1, 3, 2, 5, |
43 | 43 |
3, 4, 3, 3, |
44 | 44 |
3, 7, 6, 5, |
... | ... |
@@ -47,7 +47,7 @@ const uint8_t inter_MCBPC_code[28] = { |
47 | 47 |
1, 0, 0, 0, /* Stuffing */ |
48 | 48 |
2, 12, 14, 15, |
49 | 49 |
}; |
50 |
-const uint8_t inter_MCBPC_bits[28] = { |
|
50 |
+const uint8_t ff_h263_inter_MCBPC_bits[28] = { |
|
51 | 51 |
1, 4, 4, 6, /* inter */ |
52 | 52 |
5, 8, 8, 7, /* intra */ |
53 | 53 |
3, 7, 7, 9, /* interQ */ |
... | ... |
@@ -100,7 +100,7 @@ static const uint8_t cbpc_b_tab[4][2] = { |
100 | 100 |
{6, 3}, |
101 | 101 |
}; |
102 | 102 |
|
103 |
-const uint8_t cbpy_tab[16][2] = |
|
103 |
+const uint8_t ff_h263_cbpy_tab[16][2] = |
|
104 | 104 |
{ |
105 | 105 |
{3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4}, |
106 | 106 |
{2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2} |
... | ... |
@@ -177,7 +177,7 @@ const int8_t inter_run[102] = { |
177 | 177 |
35, 36, 37, 38, 39, 40, |
178 | 178 |
}; |
179 | 179 |
|
180 |
-RLTable rl_inter = { |
|
180 |
+RLTable ff_h263_rl_inter = { |
|
181 | 181 |
102, |
182 | 182 |
58, |
183 | 183 |
inter_vlc, |
... | ... |
@@ -556,7 +556,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){ |
556 | 556 |
return mb_num-1; |
557 | 557 |
} |
558 | 558 |
|
559 |
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
559 |
+ cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
560 | 560 |
if (cbpc < 0){ |
561 | 561 |
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y); |
562 | 562 |
return -1; |
... | ... |
@@ -615,7 +615,7 @@ try_again: |
615 | 615 |
continue; |
616 | 616 |
} |
617 | 617 |
|
618 |
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
618 |
+ cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
619 | 619 |
if (cbpc < 0){ |
620 | 620 |
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y); |
621 | 621 |
return -1; |
... | ... |
@@ -712,7 +712,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ |
712 | 712 |
|
713 | 713 |
if(s->pict_type==FF_I_TYPE){ |
714 | 714 |
int ac_pred= get_bits1(&s->gb); |
715 |
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
715 |
+ int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
716 | 716 |
if(cbpy<0){ |
717 | 717 |
av_log(s->avctx, AV_LOG_ERROR, "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); |
718 | 718 |
return -1; |
... | ... |
@@ -724,7 +724,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ |
724 | 724 |
if(IS_INTRA(s->current_picture.mb_type[xy])){ |
725 | 725 |
int dir=0,i; |
726 | 726 |
int ac_pred = get_bits1(&s->gb); |
727 |
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
727 |
+ int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
728 | 728 |
|
729 | 729 |
if(cbpy<0){ |
730 | 730 |
av_log(s->avctx, AV_LOG_ERROR, "I cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); |
... | ... |
@@ -754,7 +754,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ |
754 | 754 |
s->current_picture.qscale_table[xy]= s->qscale; |
755 | 755 |
s->cbp_table[xy]= 0; |
756 | 756 |
}else{ |
757 |
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
757 |
+ int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
758 | 758 |
|
759 | 759 |
if(cbpy<0){ |
760 | 760 |
av_log(s->avctx, AV_LOG_ERROR, "P cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); |
... | ... |
@@ -892,7 +892,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, |
892 | 892 |
return 0; |
893 | 893 |
} |
894 | 894 |
if(rvlc) rl = &rvlc_rl_inter; |
895 |
- else rl = &rl_inter; |
|
895 |
+ else rl = &ff_h263_rl_inter; |
|
896 | 896 |
|
897 | 897 |
scan_table = s->intra_scantable.permutated; |
898 | 898 |
|
... | ... |
@@ -902,7 +902,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, |
902 | 902 |
if(rvlc){ |
903 | 903 |
rl_vlc = rvlc_rl_inter.rl_vlc[0]; |
904 | 904 |
}else{ |
905 |
- rl_vlc = rl_inter.rl_vlc[0]; |
|
905 |
+ rl_vlc = ff_h263_rl_inter.rl_vlc[0]; |
|
906 | 906 |
} |
907 | 907 |
}else{ |
908 | 908 |
qmul = s->qscale << 1; |
... | ... |
@@ -910,7 +910,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, |
910 | 910 |
if(rvlc){ |
911 | 911 |
rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale]; |
912 | 912 |
}else{ |
913 |
- rl_vlc = rl_inter.rl_vlc[s->qscale]; |
|
913 |
+ rl_vlc = ff_h263_rl_inter.rl_vlc[s->qscale]; |
|
914 | 914 |
} |
915 | 915 |
} |
916 | 916 |
} |
... | ... |
@@ -1207,7 +1207,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, |
1207 | 1207 |
} |
1208 | 1208 |
goto end; |
1209 | 1209 |
} |
1210 |
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1210 |
+ cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
|
1211 | 1211 |
if (cbpc < 0){ |
1212 | 1212 |
av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y); |
1213 | 1213 |
return -1; |
... | ... |
@@ -1222,7 +1222,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, |
1222 | 1222 |
if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0) |
1223 | 1223 |
s->mcsel= get_bits1(&s->gb); |
1224 | 1224 |
else s->mcsel= 0; |
1225 |
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F; |
|
1225 |
+ cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F; |
|
1226 | 1226 |
|
1227 | 1227 |
cbp = (cbpc & 3) | (cbpy << 2); |
1228 | 1228 |
if (dquant) { |
... | ... |
@@ -1438,7 +1438,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, |
1438 | 1438 |
s->current_picture.mb_type[xy]= mb_type; |
1439 | 1439 |
} else { /* I-Frame */ |
1440 | 1440 |
do{ |
1441 |
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
1441 |
+ cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); |
|
1442 | 1442 |
if (cbpc < 0){ |
1443 | 1443 |
av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y); |
1444 | 1444 |
return -1; |
... | ... |
@@ -1454,7 +1454,7 @@ intra: |
1454 | 1454 |
else |
1455 | 1455 |
s->current_picture.mb_type[xy]= MB_TYPE_INTRA; |
1456 | 1456 |
|
1457 |
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1457 |
+ cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1458 | 1458 |
if(cbpy<0){ |
1459 | 1459 |
av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y); |
1460 | 1460 |
return -1; |
... | ... |
@@ -315,7 +315,7 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n |
315 | 315 |
} else { |
316 | 316 |
if(last_index<0) return; |
317 | 317 |
i = 0; |
318 |
- rl = &rl_inter; |
|
318 |
+ rl = &ff_h263_rl_inter; |
|
319 | 319 |
bits_tab= uni_mpeg4_inter_rl_bits; |
320 | 320 |
len_tab = uni_mpeg4_inter_rl_len; |
321 | 321 |
} |
... | ... |
@@ -697,10 +697,10 @@ void mpeg4_encode_mb(MpegEncContext * s, |
697 | 697 |
if(s->mv_type==MV_TYPE_16X16){ |
698 | 698 |
if(s->dquant) cbpc+= 8; |
699 | 699 |
put_bits(&s->pb, |
700 |
- inter_MCBPC_bits[cbpc], |
|
701 |
- inter_MCBPC_code[cbpc]); |
|
700 |
+ ff_h263_inter_MCBPC_bits[cbpc], |
|
701 |
+ ff_h263_inter_MCBPC_code[cbpc]); |
|
702 | 702 |
|
703 |
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
703 |
+ put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
704 | 704 |
if(s->dquant) |
705 | 705 |
put_bits(pb2, 2, dquant_code[s->dquant+2]); |
706 | 706 |
|
... | ... |
@@ -722,10 +722,10 @@ void mpeg4_encode_mb(MpegEncContext * s, |
722 | 722 |
}else if(s->mv_type==MV_TYPE_FIELD){ |
723 | 723 |
if(s->dquant) cbpc+= 8; |
724 | 724 |
put_bits(&s->pb, |
725 |
- inter_MCBPC_bits[cbpc], |
|
726 |
- inter_MCBPC_code[cbpc]); |
|
725 |
+ ff_h263_inter_MCBPC_bits[cbpc], |
|
726 |
+ ff_h263_inter_MCBPC_code[cbpc]); |
|
727 | 727 |
|
728 |
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
728 |
+ put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
729 | 729 |
if(s->dquant) |
730 | 730 |
put_bits(pb2, 2, dquant_code[s->dquant+2]); |
731 | 731 |
|
... | ... |
@@ -752,9 +752,9 @@ void mpeg4_encode_mb(MpegEncContext * s, |
752 | 752 |
}else{ |
753 | 753 |
assert(s->mv_type==MV_TYPE_8X8); |
754 | 754 |
put_bits(&s->pb, |
755 |
- inter_MCBPC_bits[cbpc+16], |
|
756 |
- inter_MCBPC_code[cbpc+16]); |
|
757 |
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
755 |
+ ff_h263_inter_MCBPC_bits[cbpc+16], |
|
756 |
+ ff_h263_inter_MCBPC_code[cbpc+16]); |
|
757 |
+ put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
758 | 758 |
|
759 | 759 |
if(!s->progressive_sequence){ |
760 | 760 |
if(cbp) |
... | ... |
@@ -815,18 +815,18 @@ void mpeg4_encode_mb(MpegEncContext * s, |
815 | 815 |
if (s->pict_type == FF_I_TYPE) { |
816 | 816 |
if(s->dquant) cbpc+=4; |
817 | 817 |
put_bits(&s->pb, |
818 |
- intra_MCBPC_bits[cbpc], |
|
819 |
- intra_MCBPC_code[cbpc]); |
|
818 |
+ ff_h263_intra_MCBPC_bits[cbpc], |
|
819 |
+ ff_h263_intra_MCBPC_code[cbpc]); |
|
820 | 820 |
} else { |
821 | 821 |
if(s->dquant) cbpc+=8; |
822 | 822 |
put_bits(&s->pb, 1, 0); /* mb coded */ |
823 | 823 |
put_bits(&s->pb, |
824 |
- inter_MCBPC_bits[cbpc + 4], |
|
825 |
- inter_MCBPC_code[cbpc + 4]); |
|
824 |
+ ff_h263_inter_MCBPC_bits[cbpc + 4], |
|
825 |
+ ff_h263_inter_MCBPC_code[cbpc + 4]); |
|
826 | 826 |
} |
827 | 827 |
put_bits(pb2, 1, s->ac_pred); |
828 | 828 |
cbpy = cbp >> 2; |
829 |
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
|
829 |
+ put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); |
|
830 | 830 |
if(s->dquant) |
831 | 831 |
put_bits(dc_pb, 2, dquant_code[s->dquant+2]); |
832 | 832 |
|
... | ... |
@@ -1255,7 +1255,7 @@ static av_cold int encode_init(AVCodecContext *avctx) |
1255 | 1255 |
init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); |
1256 | 1256 |
|
1257 | 1257 |
init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len); |
1258 |
- init_uni_mpeg4_rl_tab(&rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len); |
|
1258 |
+ init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len); |
|
1259 | 1259 |
} |
1260 | 1260 |
|
1261 | 1261 |
s->min_qcoeff= -2048; |
... | ... |
@@ -576,8 +576,8 @@ void msmpeg4_encode_mb(MpegEncContext * s, |
576 | 576 |
else coded_cbp= cbp; |
577 | 577 |
|
578 | 578 |
put_bits(&s->pb, |
579 |
- cbpy_tab[coded_cbp>>2][1], |
|
580 |
- cbpy_tab[coded_cbp>>2][0]); |
|
579 |
+ ff_h263_cbpy_tab[coded_cbp>>2][1], |
|
580 |
+ ff_h263_cbpy_tab[coded_cbp>>2][0]); |
|
581 | 581 |
|
582 | 582 |
s->misc_bits += get_bits_diff(s); |
583 | 583 |
|
... | ... |
@@ -637,8 +637,8 @@ void msmpeg4_encode_mb(MpegEncContext * s, |
637 | 637 |
} |
638 | 638 |
put_bits(&s->pb, 1, 0); /* no AC prediction yet */ |
639 | 639 |
put_bits(&s->pb, |
640 |
- cbpy_tab[cbp>>2][1], |
|
641 |
- cbpy_tab[cbp>>2][0]); |
|
640 |
+ ff_h263_cbpy_tab[cbp>>2][1], |
|
641 |
+ ff_h263_cbpy_tab[cbp>>2][0]); |
|
642 | 642 |
}else{ |
643 | 643 |
if (s->pict_type == FF_I_TYPE) { |
644 | 644 |
put_bits(&s->pb, |
... | ... |
@@ -1146,7 +1146,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) |
1146 | 1146 |
if (!s->mb_intra) { |
1147 | 1147 |
int mx, my, cbpy; |
1148 | 1148 |
|
1149 |
- cbpy= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1149 |
+ cbpy= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
|
1150 | 1150 |
if(cbpy<0){ |
1151 | 1151 |
av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); |
1152 | 1152 |
return -1; |
... | ... |
@@ -1166,10 +1166,10 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) |
1166 | 1166 |
} else { |
1167 | 1167 |
if(s->msmpeg4_version==2){ |
1168 | 1168 |
s->ac_pred = get_bits1(&s->gb); |
1169 |
- cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors |
|
1169 |
+ cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors |
|
1170 | 1170 |
} else{ |
1171 | 1171 |
s->ac_pred = 0; |
1172 |
- cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors |
|
1172 |
+ cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors |
|
1173 | 1173 |
if(s->pict_type==FF_P_TYPE) cbp^=0x3C; |
1174 | 1174 |
} |
1175 | 1175 |
} |
... | ... |
@@ -1326,9 +1326,9 @@ av_cold int ff_msmpeg4_decode_init(MpegEncContext *s) |
1326 | 1326 |
&v2_dc_chroma_table[0][1], 8, 4, |
1327 | 1327 |
&v2_dc_chroma_table[0][0], 8, 4, 1506); |
1328 | 1328 |
|
1329 |
- INIT_VLC_STATIC(&cbpy_vlc, CBPY_VLC_BITS, 16, |
|
1330 |
- &cbpy_tab[0][1], 2, 1, |
|
1331 |
- &cbpy_tab[0][0], 2, 1, 64); |
|
1329 |
+ INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, |
|
1330 |
+ &ff_h263_cbpy_tab[0][1], 2, 1, |
|
1331 |
+ &ff_h263_cbpy_tab[0][0], 2, 1, 64); |
|
1332 | 1332 |
INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, |
1333 | 1333 |
&v2_intra_cbpc[0][1], 2, 1, |
1334 | 1334 |
&v2_intra_cbpc[0][0], 2, 1, 8); |
... | ... |
@@ -1357,11 +1357,11 @@ av_cold int ff_msmpeg4_decode_init(MpegEncContext *s) |
1357 | 1357 |
&ff_msmp4_mb_i_table[0][0], 4, 2, 536); |
1358 | 1358 |
|
1359 | 1359 |
INIT_VLC_STATIC(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8, |
1360 |
- intra_MCBPC_bits, 1, 1, |
|
1361 |
- intra_MCBPC_code, 1, 1, 64); |
|
1360 |
+ ff_h263_intra_MCBPC_bits, 1, 1, |
|
1361 |
+ ff_h263_intra_MCBPC_code, 1, 1, 64); |
|
1362 | 1362 |
INIT_VLC_STATIC(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25, |
1363 |
- inter_MCBPC_bits, 1, 1, |
|
1364 |
- inter_MCBPC_code, 1, 1, 104); |
|
1363 |
+ ff_h263_inter_MCBPC_bits, 1, 1, |
|
1364 |
+ ff_h263_inter_MCBPC_code, 1, 1, 104); |
|
1365 | 1365 |
|
1366 | 1366 |
INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, |
1367 | 1367 |
&table_inter_intra[0][1], 2, 1, |