History

avcodec/ituh263dec: Avoid superfluous VLC structures

Of all these VLCs here, only VLC.table was really used after init, so use the ff_vlc_init_tables API to get rid of them.

Andreas Rheinhardt committed 3 years ago

Commit ff886fc1 parent 5a9e1854 files · +54 −53Browse files

Unified · Split

4 files
  1. libavcodec/h263dec.h +4 −4
  2. libavcodec/ituh263dec.c +35 −34
  3. libavcodec/mpeg4videodec.c +9 −9
  4. libavcodec/msmpeg4dec.c +6 −6
libavcodec/h263dec.h+4−4
@@ -33,10 +33,10 @@ · 32 unmodified lines
33#define CBPY_VLC_BITS 633#define CBPY_VLC_BITS 6
34#define TEX_VLC_BITS 934#define TEX_VLC_BITS 9
35 35
36extern VLC ff_h263_intra_MCBPC_vlc;36extern VLCElem ff_h263_intra_MCBPC_vlc[];
37extern VLC ff_h263_inter_MCBPC_vlc;37extern VLCElem ff_h263_inter_MCBPC_vlc[];
38extern VLC ff_h263_cbpy_vlc;38extern VLCElem ff_h263_cbpy_vlc[];
39extern VLC ff_h263_mv_vlc;39extern VLCElem ff_h263_mv_vlc[];
40 40
41extern const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[];41extern const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[];
42 42
libavcodec/ituh263dec.c+35−34
@@ -99,38 +99,38 @@ void ff_h263_show_pict_info(MpegEncContext *s){ · 98 unmodified lines
99/***********************************************/99/***********************************************/
100/* decoding */100/* decoding */
101 101
102VLC ff_h263_intra_MCBPC_vlc;102VLCElem ff_h263_intra_MCBPC_vlc[72];
103VLC ff_h263_inter_MCBPC_vlc;103VLCElem ff_h263_inter_MCBPC_vlc[198];
104VLC ff_h263_cbpy_vlc;104VLCElem ff_h263_cbpy_vlc[64];
105VLC ff_h263_mv_vlc;105VLCElem ff_h263_mv_vlc[538];
106static VLC h263_mbtype_b_vlc;106static VLCElem h263_mbtype_b_vlc[80];
107static VLC cbpc_b_vlc;107static VLCElem cbpc_b_vlc[8];
108 108
109/* init vlcs */109/* init vlcs */
110 110
111static av_cold void h263_decode_init_vlc(void)111static av_cold void h263_decode_init_vlc(void)
112{112{
113 VLC_INIT_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,113 VLC_INIT_STATIC_TABLE(ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
114 ff_h263_intra_MCBPC_bits, 1, 1,114 ff_h263_intra_MCBPC_bits, 1, 1,
115 ff_h263_intra_MCBPC_code, 1, 1, 72);115 ff_h263_intra_MCBPC_code, 1, 1, 0);
116 VLC_INIT_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,116 VLC_INIT_STATIC_TABLE(ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
117 ff_h263_inter_MCBPC_bits, 1, 1,117 ff_h263_inter_MCBPC_bits, 1, 1,
118 ff_h263_inter_MCBPC_code, 1, 1, 198);118 ff_h263_inter_MCBPC_code, 1, 1, 0);
119 VLC_INIT_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,119 VLC_INIT_STATIC_TABLE(ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,
120 &ff_h263_cbpy_tab[0][1], 2, 1,120 &ff_h263_cbpy_tab[0][1], 2, 1,
121 &ff_h263_cbpy_tab[0][0], 2, 1, 64);121 &ff_h263_cbpy_tab[0][0], 2, 1, 0);
122 VLC_INIT_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33,122 VLC_INIT_STATIC_TABLE(ff_h263_mv_vlc, H263_MV_VLC_BITS, 33,
123 &ff_mvtab[0][1], 2, 1,123 &ff_mvtab[0][1], 2, 1,
124 &ff_mvtab[0][0], 2, 1, 538);124 &ff_mvtab[0][0], 2, 1, 0);
125 ff_h263_init_rl_inter();125 ff_h263_init_rl_inter();
126 VLC_INIT_RL(ff_h263_rl_inter, 554);126 VLC_INIT_RL(ff_h263_rl_inter, 554);
127 INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554);127 INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554);
128 VLC_INIT_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,128 VLC_INIT_STATIC_TABLE(h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
129 &ff_h263_mbtype_b_tab[0][1], 2, 1,129 &ff_h263_mbtype_b_tab[0][1], 2, 1,
130 &ff_h263_mbtype_b_tab[0][0], 2, 1, 80);130 &ff_h263_mbtype_b_tab[0][0], 2, 1, 0);
131 VLC_INIT_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,131 VLC_INIT_STATIC_TABLE(cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
132 &ff_cbpc_b_tab[0][1], 2, 1,132 &ff_cbpc_b_tab[0][1], 2, 1,
133 &ff_cbpc_b_tab[0][0], 2, 1, 8);133 &ff_cbpc_b_tab[0][0], 2, 1, 0);
134}134}
135 135
136av_cold void ff_h263_decode_init_vlc(void)136av_cold void ff_h263_decode_init_vlc(void)
@@ -273,7 +273,7 @@ int ff_h263_resync(MpegEncContext *s){ · 136 unmodified lines
273int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code)273int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code)
274{274{
275 int code, val, sign, shift;275 int code, val, sign, shift;
276 code = get_vlc2(&s->gb, ff_h263_mv_vlc.table, H263_MV_VLC_BITS, 2);276 code = get_vlc2(&s->gb, ff_h263_mv_vlc, H263_MV_VLC_BITS, 2);
277 277
278 if (code == 0)278 if (code == 0)
279 return pred;279 return pred;
@@ -366,13 +366,13 @@ static void preview_obmc(MpegEncContext *s){ · 86 unmodified lines
366 s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;366 s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
367 goto end;367 goto end;
368 }368 }
369 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);369 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2);
370 }while(cbpc == 20);370 }while(cbpc == 20);
371 371
372 if(cbpc & 4){372 if(cbpc & 4){
373 s->current_picture.mb_type[xy] = MB_TYPE_INTRA;373 s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
374 }else{374 }else{
375 get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);375 get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
376 if (cbpc & 8) {376 if (cbpc & 8) {
377 if(s->modified_quant){377 if(s->modified_quant){
378 if(get_bits1(&s->gb)) skip_bits(&s->gb, 1);378 if(get_bits1(&s->gb)) skip_bits(&s->gb, 1);
@@ -809,7 +809,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 430 unmodified lines
809 s->mb_skipped = !(s->obmc | s->loop_filter);809 s->mb_skipped = !(s->obmc | s->loop_filter);
810 goto end;810 goto end;
811 }811 }
812 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);812 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2);
813 if (cbpc < 0){813 if (cbpc < 0){
814 av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);814 av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
815 return SLICE_ERROR;815 return SLICE_ERROR;
@@ -824,7 +824,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 8 unmodified lines
824 824
825 if(s->pb_frame && get_bits1(&s->gb))825 if(s->pb_frame && get_bits1(&s->gb))
826 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);826 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);
827 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);827 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
828 828
829 if (cbpy < 0) {829 if (cbpy < 0) {
830 av_log(s->avctx, AV_LOG_ERROR, "cbpy damaged at %d %d\n", s->mb_x, s->mb_y);830 av_log(s->avctx, AV_LOG_ERROR, "cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
@@ -905,7 +905,8 @@ int ff_h263_decode_mb(MpegEncContext *s, · 74 unmodified lines
905 mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;905 mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;
906 906
907 do{907 do{
908 mb_type= get_vlc2(&s->gb, h263_mbtype_b_vlc.table, H263_MBTYPE_B_VLC_BITS, 2);908 mb_type = get_vlc2(&s->gb, h263_mbtype_b_vlc,
909 H263_MBTYPE_B_VLC_BITS, 2);
909 if (mb_type < 0){910 if (mb_type < 0){
910 av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y);911 av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y);
911 return SLICE_ERROR;912 return SLICE_ERROR;
@@ -917,13 +918,13 @@ int ff_h263_decode_mb(MpegEncContext *s, · 5 unmodified lines
917 s->mb_intra = IS_INTRA(mb_type);918 s->mb_intra = IS_INTRA(mb_type);
918 if(HAS_CBP(mb_type)){919 if(HAS_CBP(mb_type)){
919 s->bdsp.clear_blocks(s->block[0]);920 s->bdsp.clear_blocks(s->block[0]);
920 cbpc = get_vlc2(&s->gb, cbpc_b_vlc.table, CBPC_B_VLC_BITS, 1);921 cbpc = get_vlc2(&s->gb, cbpc_b_vlc, CBPC_B_VLC_BITS, 1);
921 if(s->mb_intra){922 if(s->mb_intra){
922 dquant = IS_QUANT(mb_type);923 dquant = IS_QUANT(mb_type);
923 goto intra;924 goto intra;
924 }925 }
925 926
926 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);927 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
927 928
928 if (cbpy < 0){929 if (cbpy < 0){
929 av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y);930 av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
@@ -1009,7 +1010,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 79 unmodified lines
1009 s->current_picture.mb_type[xy] = mb_type;1010 s->current_picture.mb_type[xy] = mb_type;
1010 } else { /* I-Frame */1011 } else { /* I-Frame */
1011 do{1012 do{
1012 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);1013 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2);
1013 if (cbpc < 0){1014 if (cbpc < 0){
1014 av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);1015 av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
1015 return SLICE_ERROR;1016 return SLICE_ERROR;
@@ -1034,7 +1035,7 @@ intra: · 18 unmodified lines
1034 1035
1035 if(s->pb_frame && get_bits1(&s->gb))1036 if(s->pb_frame && get_bits1(&s->gb))
1036 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);1037 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);
1037 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);1038 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
1038 if(cbpy<0){1039 if(cbpy<0){
1039 av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);1040 av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
1040 return SLICE_ERROR;1041 return SLICE_ERROR;
libavcodec/mpeg4videodec.c+9−9
@@ -961,7 +961,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) · 960 unmodified lines
961 if (show_bits(&s->gb, 19) == DC_MARKER)961 if (show_bits(&s->gb, 19) == DC_MARKER)
962 return mb_num - 1;962 return mb_num - 1;
963 963
964 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);964 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2);
965 if (cbpc < 0) {965 if (cbpc < 0) {
966 av_log(s->avctx, AV_LOG_ERROR,966 av_log(s->avctx, AV_LOG_ERROR,
967 "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);967 "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
@@ -1033,7 +1033,7 @@ try_again: · 65 unmodified lines
1033 continue;1033 continue;
1034 }1034 }
1035 1035
1036 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);1036 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2);
1037 if (cbpc < 0) {1037 if (cbpc < 0) {
1038 av_log(s->avctx, AV_LOG_ERROR,1038 av_log(s->avctx, AV_LOG_ERROR,
1039 "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);1039 "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
@@ -1148,7 +1148,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 108 unmodified lines
1148 1148
1149 if (s->pict_type == AV_PICTURE_TYPE_I) {1149 if (s->pict_type == AV_PICTURE_TYPE_I) {
1150 int ac_pred = get_bits1(&s->gb);1150 int ac_pred = get_bits1(&s->gb);
1151 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);1151 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
1152 if (cbpy < 0) {1152 if (cbpy < 0) {
1153 av_log(s->avctx, AV_LOG_ERROR,1153 av_log(s->avctx, AV_LOG_ERROR,
1154 "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);1154 "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
@@ -1162,7 +1162,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 7 unmodified lines
1162 int i;1162 int i;
1163 int dir = 0;1163 int dir = 0;
1164 int ac_pred = get_bits1(&s->gb);1164 int ac_pred = get_bits1(&s->gb);
1165 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);1165 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
1166 1166
1167 if (cbpy < 0) {1167 if (cbpy < 0) {
1168 av_log(s->avctx, AV_LOG_ERROR,1168 av_log(s->avctx, AV_LOG_ERROR,
@@ -1194,7 +1194,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 25 unmodified lines
1194 s->current_picture.qscale_table[xy] = s->qscale;1194 s->current_picture.qscale_table[xy] = s->qscale;
1195 s->cbp_table[xy] = 0;1195 s->cbp_table[xy] = 0;
1196 } else {1196 } else {
1197 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);1197 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
1198 1198
1199 if (cbpy < 0) {1199 if (cbpy < 0) {
1200 av_log(s->avctx, AV_LOG_ERROR,1200 av_log(s->avctx, AV_LOG_ERROR,
@@ -1690,7 +1690,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 489 unmodified lines
1690 }1690 }
1691 goto end;1691 goto end;
1692 }1692 }
1693 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);1693 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2);
1694 if (cbpc < 0) {1694 if (cbpc < 0) {
1695 av_log(s->avctx, AV_LOG_ERROR,1695 av_log(s->avctx, AV_LOG_ERROR,
1696 "mcbpc damaged at %d %d\n", s->mb_x, s->mb_y);1696 "mcbpc damaged at %d %d\n", s->mb_x, s->mb_y);
@@ -1709,7 +1709,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 12 unmodified lines
1709 s->mcsel = get_bits1(&s->gb);1709 s->mcsel = get_bits1(&s->gb);
1710 else1710 else
1711 s->mcsel = 0;1711 s->mcsel = 0;
1712 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;1712 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1) ^ 0x0F;
1713 if (cbpy < 0) {1713 if (cbpy < 0) {
1714 av_log(s->avctx, AV_LOG_ERROR,1714 av_log(s->avctx, AV_LOG_ERROR,
1715 "P cbpy damaged at %d %d\n", s->mb_x, s->mb_y);1715 "P cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
@@ -1952,7 +1952,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 236 unmodified lines
1952 int use_intra_dc_vlc;1952 int use_intra_dc_vlc;
1953 1953
1954 do {1954 do {
1955 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);1955 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2);
1956 if (cbpc < 0) {1956 if (cbpc < 0) {
1957 av_log(s->avctx, AV_LOG_ERROR,1957 av_log(s->avctx, AV_LOG_ERROR,
1958 "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);1958 "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
@@ -1970,7 +1970,7 @@ intra: · 11 unmodified lines
1970 else1970 else
1971 s->current_picture.mb_type[xy] = MB_TYPE_INTRA;1971 s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
1972 1972
1973 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);1973 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
1974 if (cbpy < 0) {1974 if (cbpy < 0) {
1975 av_log(s->avctx, AV_LOG_ERROR,1975 av_log(s->avctx, AV_LOG_ERROR,
1976 "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);1976 "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
libavcodec/msmpeg4dec.c+6−6
@@ -75,7 +75,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) · 74 unmodified lines
75{75{
76 int code, val, sign, shift;76 int code, val, sign, shift;
77 77
78 code = get_vlc2(&s->gb, ff_h263_mv_vlc.table, H263_MV_VLC_BITS, 2);78 code = get_vlc2(&s->gb, ff_h263_mv_vlc, H263_MV_VLC_BITS, 2);
79 ff_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);79 ff_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
80 if (code < 0)80 if (code < 0)
81 return 0xffff;81 return 0xffff;
@@ -127,7 +127,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 45 unmodified lines
127 if(s->msmpeg4_version==2)127 if(s->msmpeg4_version==2)
128 code = get_vlc2(&s->gb, v2_mb_type_vlc.table, V2_MB_TYPE_VLC_BITS, 1);128 code = get_vlc2(&s->gb, v2_mb_type_vlc.table, V2_MB_TYPE_VLC_BITS, 1);
129 else129 else
130 code = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);130 code = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2);
131 if(code<0 || code>7){131 if(code<0 || code>7){
132 av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y);132 av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y);
133 return -1;133 return -1;
@@ -141,7 +141,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 7 unmodified lines
141 if(s->msmpeg4_version==2)141 if(s->msmpeg4_version==2)
142 cbp= get_vlc2(&s->gb, v2_intra_cbpc_vlc.table, V2_INTRA_CBPC_VLC_BITS, 1);142 cbp= get_vlc2(&s->gb, v2_intra_cbpc_vlc.table, V2_INTRA_CBPC_VLC_BITS, 1);
143 else143 else
144 cbp= get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);144 cbp = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2);
145 if(cbp<0 || cbp>3){145 if(cbp<0 || cbp>3){
146 av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);146 av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
147 return -1;147 return -1;
@@ -151,7 +151,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 3 unmodified lines
151 if (!s->mb_intra) {151 if (!s->mb_intra) {
152 int mx, my, cbpy;152 int mx, my, cbpy;
153 153
154 cbpy= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);154 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
155 if(cbpy<0){155 if(cbpy<0){
156 av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);156 av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
157 return -1;157 return -1;
@@ -173,7 +173,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 15 unmodified lines
173 int v;173 int v;
174 if(s->msmpeg4_version==2){174 if(s->msmpeg4_version==2){
175 s->ac_pred = get_bits1(&s->gb);175 s->ac_pred = get_bits1(&s->gb);
176 v = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);176 v = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
177 if (v < 0) {177 if (v < 0) {
178 av_log(s->avctx, AV_LOG_ERROR, "cbpy vlc invalid\n");178 av_log(s->avctx, AV_LOG_ERROR, "cbpy vlc invalid\n");
179 return -1;179 return -1;
@@ -181,7 +181,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 1 unmodified line
181 cbp|= v<<2;181 cbp|= v<<2;
182 } else{182 } else{
183 s->ac_pred = 0;183 s->ac_pred = 0;
184 v = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);184 v = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1);
185 if (v < 0) {185 if (v < 0) {
186 av_log(s->avctx, AV_LOG_ERROR, "cbpy vlc invalid\n");186 av_log(s->avctx, AV_LOG_ERROR, "cbpy vlc invalid\n");
187 return -1;187 return -1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t