Mercurial > libavcodec.hg
comparison h263.c @ 1633:27806cccec2a libavcodec
h263 OBMC & 4MV support
cleanup
author | michael |
---|---|
date | Fri, 28 Nov 2003 21:31:20 +0000 |
parents | 932d306bf1dc |
children | 7799582dc9b8 |
comparison
equal
deleted
inserted
replaced
1632:4c0469b79010 | 1633:27806cccec2a |
---|---|
220 /* By now UMV IS DISABLED ON H.263v1, since the restrictions | 220 /* By now UMV IS DISABLED ON H.263v1, since the restrictions |
221 of H.263v1 UMV implies to check the predicted MV after | 221 of H.263v1 UMV implies to check the predicted MV after |
222 calculation of the current MB to see if we're on the limits */ | 222 calculation of the current MB to see if we're on the limits */ |
223 put_bits(&s->pb, 1, 0); /* unrestricted motion vector: off */ | 223 put_bits(&s->pb, 1, 0); /* unrestricted motion vector: off */ |
224 put_bits(&s->pb, 1, 0); /* SAC: off */ | 224 put_bits(&s->pb, 1, 0); /* SAC: off */ |
225 put_bits(&s->pb, 1, 0); /* advanced prediction mode: off */ | 225 put_bits(&s->pb, 1, s->obmc); /* advanced prediction mode */ |
226 put_bits(&s->pb, 1, 0); /* not PB frame */ | 226 put_bits(&s->pb, 1, 0); /* not PB frame */ |
227 put_bits(&s->pb, 5, s->qscale); | 227 put_bits(&s->pb, 5, s->qscale); |
228 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ | 228 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ |
229 } else { | 229 } else { |
230 /* H.263v2 */ | 230 /* H.263v2 */ |
238 | 238 |
239 put_bits(&s->pb,1,0); /* Custom PCF: off */ | 239 put_bits(&s->pb,1,0); /* Custom PCF: off */ |
240 s->umvplus = s->unrestricted_mv; | 240 s->umvplus = s->unrestricted_mv; |
241 put_bits(&s->pb, 1, s->umvplus); /* Unrestricted Motion Vector */ | 241 put_bits(&s->pb, 1, s->umvplus); /* Unrestricted Motion Vector */ |
242 put_bits(&s->pb,1,0); /* SAC: off */ | 242 put_bits(&s->pb,1,0); /* SAC: off */ |
243 put_bits(&s->pb,1,0); /* Advanced Prediction Mode: off */ | 243 put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */ |
244 put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */ | 244 put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */ |
245 put_bits(&s->pb,1,0); /* Deblocking Filter: off */ | 245 put_bits(&s->pb,1,0); /* Deblocking Filter: off */ |
246 put_bits(&s->pb,1,0); /* Slice Structured: off */ | 246 put_bits(&s->pb,1,0); /* Slice Structured: off */ |
247 put_bits(&s->pb,1,0); /* Reference Picture Selection: off */ | 247 put_bits(&s->pb,1,0); /* Reference Picture Selection: off */ |
248 put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */ | 248 put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */ |
600 } | 600 } |
601 | 601 |
602 if(s->encoding){ //FIXME encoding MUST be cleaned up | 602 if(s->encoding){ //FIXME encoding MUST be cleaned up |
603 if (s->mv_type == MV_TYPE_8X8) | 603 if (s->mv_type == MV_TYPE_8X8) |
604 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_8x8; | 604 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_8x8; |
605 else if(s->mb_intra) | |
606 s->current_picture.mb_type[mb_xy]= MB_TYPE_INTRA; | |
605 else | 607 else |
606 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_16x16; | 608 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_16x16; |
607 } | 609 } |
608 } | 610 } |
609 | 611 |
894 return; | 896 return; |
895 } | 897 } |
896 } | 898 } |
897 | 899 |
898 put_bits(&s->pb, 1, 0); /* mb coded */ | 900 put_bits(&s->pb, 1, 0); /* mb coded */ |
901 cbpc = cbp & 3; | |
902 cbpy = cbp >> 2; | |
903 cbpy ^= 0xf; | |
899 if(s->mv_type==MV_TYPE_16X16){ | 904 if(s->mv_type==MV_TYPE_16X16){ |
900 cbpc = cbp & 3; | |
901 if(s->dquant) cbpc+= 8; | 905 if(s->dquant) cbpc+= 8; |
902 put_bits(&s->pb, | 906 put_bits(&s->pb, |
903 inter_MCBPC_bits[cbpc], | 907 inter_MCBPC_bits[cbpc], |
904 inter_MCBPC_code[cbpc]); | 908 inter_MCBPC_code[cbpc]); |
905 | 909 |
906 cbpy = cbp >> 2; | |
907 cbpy ^= 0xf; | |
908 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); | 910 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
909 if(s->dquant) | 911 if(s->dquant) |
910 put_bits(pb2, 2, dquant_code[s->dquant+2]); | 912 put_bits(pb2, 2, dquant_code[s->dquant+2]); |
911 | 913 |
912 if(!s->progressive_sequence){ | 914 if(!s->progressive_sequence){ |
923 h263_pred_motion(s, 0, &pred_x, &pred_y); | 925 h263_pred_motion(s, 0, &pred_x, &pred_y); |
924 | 926 |
925 h263_encode_motion(s, motion_x - pred_x, s->f_code); | 927 h263_encode_motion(s, motion_x - pred_x, s->f_code); |
926 h263_encode_motion(s, motion_y - pred_y, s->f_code); | 928 h263_encode_motion(s, motion_y - pred_y, s->f_code); |
927 }else{ | 929 }else{ |
928 cbpc = (cbp & 3)+16; | |
929 put_bits(&s->pb, | 930 put_bits(&s->pb, |
930 inter_MCBPC_bits[cbpc], | 931 inter_MCBPC_bits[cbpc+16], |
931 inter_MCBPC_code[cbpc]); | 932 inter_MCBPC_code[cbpc+16]); |
932 cbpy = cbp >> 2; | |
933 cbpy ^= 0xf; | |
934 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); | 933 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
935 | 934 |
936 if(!s->progressive_sequence){ | 935 if(!s->progressive_sequence){ |
937 if(cbp) | 936 if(cbp) |
938 put_bits(pb2, 1, s->interlaced_dct); | 937 put_bits(pb2, 1, s->interlaced_dct); |
1068 s->last_bits++; | 1067 s->last_bits++; |
1069 } | 1068 } |
1070 return; | 1069 return; |
1071 } | 1070 } |
1072 put_bits(&s->pb, 1, 0); /* mb coded */ | 1071 put_bits(&s->pb, 1, 0); /* mb coded */ |
1072 | |
1073 cbpc = cbp & 3; | 1073 cbpc = cbp & 3; |
1074 if(s->dquant) cbpc+= 8; | 1074 if(s->dquant) cbpc+= 8; |
1075 put_bits(&s->pb, | |
1076 inter_MCBPC_bits[cbpc], | |
1077 inter_MCBPC_code[cbpc]); | |
1078 cbpy = cbp >> 2; | 1075 cbpy = cbp >> 2; |
1079 cbpy ^= 0xf; | 1076 cbpy ^= 0xf; |
1080 put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); | 1077 if(s->mv_type==MV_TYPE_16X16){ |
1081 if(s->dquant) | 1078 put_bits(&s->pb, |
1082 put_bits(&s->pb, 2, dquant_code[s->dquant+2]); | 1079 inter_MCBPC_bits[cbpc], |
1083 | 1080 inter_MCBPC_code[cbpc]); |
1084 if(interleaved_stats){ | 1081 |
1085 s->misc_bits+= get_bits_diff(s); | 1082 put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); |
1086 } | 1083 if(s->dquant) |
1087 | 1084 put_bits(&s->pb, 2, dquant_code[s->dquant+2]); |
1088 /* motion vectors: 16x16 mode only now */ | 1085 |
1089 h263_pred_motion(s, 0, &pred_x, &pred_y); | 1086 if(interleaved_stats){ |
1090 | 1087 s->misc_bits+= get_bits_diff(s); |
1091 if (!s->umvplus) { | 1088 } |
1092 h263_encode_motion(s, motion_x - pred_x, s->f_code); | 1089 |
1093 h263_encode_motion(s, motion_y - pred_y, s->f_code); | 1090 /* motion vectors: 16x16 mode */ |
1094 } | 1091 h263_pred_motion(s, 0, &pred_x, &pred_y); |
1095 else { | 1092 |
1096 h263p_encode_umotion(s, motion_x - pred_x); | 1093 if (!s->umvplus) { |
1097 h263p_encode_umotion(s, motion_y - pred_y); | 1094 h263_encode_motion(s, motion_x - pred_x, s->f_code); |
1098 if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1)) | 1095 h263_encode_motion(s, motion_y - pred_y, s->f_code); |
1099 /* To prevent Start Code emulation */ | 1096 } |
1100 put_bits(&s->pb,1,1); | 1097 else { |
1098 h263p_encode_umotion(s, motion_x - pred_x); | |
1099 h263p_encode_umotion(s, motion_y - pred_y); | |
1100 if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1)) | |
1101 /* To prevent Start Code emulation */ | |
1102 put_bits(&s->pb,1,1); | |
1103 } | |
1104 }else{ | |
1105 put_bits(&s->pb, | |
1106 inter_MCBPC_bits[cbpc+16], | |
1107 inter_MCBPC_code[cbpc+16]); | |
1108 put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); | |
1109 if(s->dquant) | |
1110 put_bits(&s->pb, 2, dquant_code[s->dquant+2]); | |
1111 | |
1112 if(interleaved_stats){ | |
1113 s->misc_bits+= get_bits_diff(s); | |
1114 } | |
1115 | |
1116 for(i=0; i<4; i++){ | |
1117 /* motion vectors: 8x8 mode*/ | |
1118 h263_pred_motion(s, i, &pred_x, &pred_y); | |
1119 | |
1120 motion_x= s->motion_val[ s->block_index[i] ][0]; | |
1121 motion_y= s->motion_val[ s->block_index[i] ][1]; | |
1122 if (!s->umvplus) { | |
1123 h263_encode_motion(s, motion_x - pred_x, s->f_code); | |
1124 h263_encode_motion(s, motion_y - pred_y, s->f_code); | |
1125 } | |
1126 else { | |
1127 h263p_encode_umotion(s, motion_x - pred_x); | |
1128 h263p_encode_umotion(s, motion_y - pred_y); | |
1129 if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1)) | |
1130 /* To prevent Start Code emulation */ | |
1131 put_bits(&s->pb,1,1); | |
1132 } | |
1133 } | |
1101 } | 1134 } |
1102 | 1135 |
1103 if(interleaved_stats){ | 1136 if(interleaved_stats){ |
1104 s->mv_bits+= get_bits_diff(s); | 1137 s->mv_bits+= get_bits_diff(s); |
1105 } | 1138 } |
3299 } | 3332 } |
3300 return SLICE_OK; | 3333 return SLICE_OK; |
3301 } | 3334 } |
3302 } | 3335 } |
3303 | 3336 |
3337 /** | |
3338 * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :) | |
3339 */ | |
3340 static void preview_obmc(MpegEncContext *s){ | |
3341 GetBitContext gb= s->gb; | |
3342 | |
3343 int cbpc, i, pred_x, pred_y, mx, my; | |
3344 int16_t *mot_val; | |
3345 const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride; | |
3346 const int stride= s->block_wrap[0]*2; | |
3347 | |
3348 for(i=0; i<4; i++) | |
3349 s->block_index[i]+= 2; | |
3350 for(i=4; i<6; i++) | |
3351 s->block_index[i]+= 1; | |
3352 s->mb_x++; | |
3353 | |
3354 assert(s->pict_type == P_TYPE); | |
3355 | |
3356 do{ | |
3357 if (get_bits1(&s->gb)) { | |
3358 /* skip mb */ | |
3359 mot_val = s->motion_val[ s->block_index[0] ]; | |
3360 mot_val[0 ]= mot_val[2 ]= | |
3361 mot_val[0+stride]= mot_val[2+stride]= 0; | |
3362 mot_val[1 ]= mot_val[3 ]= | |
3363 mot_val[1+stride]= mot_val[3+stride]= 0; | |
3364 | |
3365 s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
3366 goto end; | |
3367 } | |
3368 cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); | |
3369 }while(cbpc == 20); | |
3370 | |
3371 if(cbpc & 4){ | |
3372 s->current_picture.mb_type[xy]= MB_TYPE_INTRA; | |
3373 }else{ | |
3374 get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); | |
3375 if (cbpc & 8) { | |
3376 skip_bits(&s->gb, 2); | |
3377 } | |
3378 | |
3379 if ((cbpc & 16) == 0) { | |
3380 s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; | |
3381 /* 16x16 motion prediction */ | |
3382 mot_val= h263_pred_motion(s, 0, &pred_x, &pred_y); | |
3383 if (s->umvplus) | |
3384 mx = h263p_decode_umotion(s, pred_x); | |
3385 else | |
3386 mx = h263_decode_motion(s, pred_x, s->f_code); | |
3387 | |
3388 if (s->umvplus) | |
3389 my = h263p_decode_umotion(s, pred_y); | |
3390 else | |
3391 my = h263_decode_motion(s, pred_y, s->f_code); | |
3392 | |
3393 mot_val[0 ]= mot_val[2 ]= | |
3394 mot_val[0+stride]= mot_val[2+stride]= mx; | |
3395 mot_val[1 ]= mot_val[3 ]= | |
3396 mot_val[1+stride]= mot_val[3+stride]= my; | |
3397 } else { | |
3398 s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0; | |
3399 for(i=0;i<4;i++) { | |
3400 mot_val = h263_pred_motion(s, i, &pred_x, &pred_y); | |
3401 if (s->umvplus) | |
3402 mx = h263p_decode_umotion(s, pred_x); | |
3403 else | |
3404 mx = h263_decode_motion(s, pred_x, s->f_code); | |
3405 | |
3406 if (s->umvplus) | |
3407 my = h263p_decode_umotion(s, pred_y); | |
3408 else | |
3409 my = h263_decode_motion(s, pred_y, s->f_code); | |
3410 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) | |
3411 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ | |
3412 mot_val[0] = mx; | |
3413 mot_val[1] = my; | |
3414 } | |
3415 } | |
3416 } | |
3417 end: | |
3418 | |
3419 for(i=0; i<4; i++) | |
3420 s->block_index[i]-= 2; | |
3421 for(i=4; i<6; i++) | |
3422 s->block_index[i]-= 1; | |
3423 s->mb_x--; | |
3424 | |
3425 s->gb= gb; | |
3426 } | |
3427 | |
3304 int ff_h263_decode_mb(MpegEncContext *s, | 3428 int ff_h263_decode_mb(MpegEncContext *s, |
3305 DCTELEM block[6][64]) | 3429 DCTELEM block[6][64]) |
3306 { | 3430 { |
3307 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; | 3431 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; |
3308 int16_t *mot_val; | 3432 int16_t *mot_val; |
3328 }else{ | 3452 }else{ |
3329 s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | 3453 s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; |
3330 s->mcsel=0; | 3454 s->mcsel=0; |
3331 s->mv[0][0][0] = 0; | 3455 s->mv[0][0][0] = 0; |
3332 s->mv[0][0][1] = 0; | 3456 s->mv[0][0][1] = 0; |
3333 s->mb_skiped = 1; | 3457 s->mb_skiped = !s->obmc; |
3334 } | 3458 } |
3335 goto end; | 3459 goto end; |
3336 } | 3460 } |
3337 cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); | 3461 cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); |
3338 //fprintf(stderr, "\tCBPC: %d", cbpc); | 3462 //fprintf(stderr, "\tCBPC: %d", cbpc); |
3643 return -1; | 3767 return -1; |
3644 cbp+=cbp; | 3768 cbp+=cbp; |
3645 } | 3769 } |
3646 } | 3770 } |
3647 end: | 3771 end: |
3772 if(s->obmc){ | |
3773 if(s->pict_type == P_TYPE && s->mb_x+1<s->mb_width) | |
3774 preview_obmc(s); | |
3775 } | |
3648 | 3776 |
3649 /* per-MB end of slice check */ | 3777 /* per-MB end of slice check */ |
3650 if(s->codec_id==CODEC_ID_MPEG4){ | 3778 if(s->codec_id==CODEC_ID_MPEG4){ |
3651 if(mpeg4_is_resync(s)){ | 3779 if(mpeg4_is_resync(s)){ |
3652 const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; | 3780 const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; |
4229 if (!width) | 4357 if (!width) |
4230 return -1; | 4358 return -1; |
4231 | 4359 |
4232 s->pict_type = I_TYPE + get_bits1(&s->gb); | 4360 s->pict_type = I_TYPE + get_bits1(&s->gb); |
4233 | 4361 |
4234 s->unrestricted_mv = get_bits1(&s->gb); | 4362 s->h263_long_vectors = get_bits1(&s->gb); |
4235 s->h263_long_vectors = s->unrestricted_mv; | |
4236 | 4363 |
4237 if (get_bits1(&s->gb) != 0) { | 4364 if (get_bits1(&s->gb) != 0) { |
4238 av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n"); | 4365 av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n"); |
4239 return -1; /* SAC: off */ | 4366 return -1; /* SAC: off */ |
4240 } | 4367 } |
4241 if (get_bits1(&s->gb) != 0) { | 4368 s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ |
4242 s->mv_type = MV_TYPE_8X8; /* Advanced prediction mode */ | 4369 s->unrestricted_mv = s->h263_long_vectors || s->obmc; |
4243 } | |
4244 | 4370 |
4245 if (get_bits1(&s->gb) != 0) { | 4371 if (get_bits1(&s->gb) != 0) { |
4246 av_log(s->avctx, AV_LOG_ERROR, "H263 PB frame not supported\n"); | 4372 av_log(s->avctx, AV_LOG_ERROR, "H263 PB frame not supported\n"); |
4247 return -1; /* not PB frame */ | 4373 return -1; /* not PB frame */ |
4248 } | 4374 } |
4263 /* OPPTYPE */ | 4389 /* OPPTYPE */ |
4264 format = get_bits(&s->gb, 3); | 4390 format = get_bits(&s->gb, 3); |
4265 dprintf("ufep=1, format: %d\n", format); | 4391 dprintf("ufep=1, format: %d\n", format); |
4266 skip_bits(&s->gb,1); /* Custom PCF */ | 4392 skip_bits(&s->gb,1); /* Custom PCF */ |
4267 s->umvplus = get_bits(&s->gb, 1); /* Unrestricted Motion Vector */ | 4393 s->umvplus = get_bits(&s->gb, 1); /* Unrestricted Motion Vector */ |
4268 s->unrestricted_mv = s->umvplus; | |
4269 skip_bits1(&s->gb); /* Syntax-based Arithmetic Coding (SAC) */ | 4394 skip_bits1(&s->gb); /* Syntax-based Arithmetic Coding (SAC) */ |
4270 if (get_bits1(&s->gb) != 0) { | 4395 s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ |
4271 s->mv_type = MV_TYPE_8X8; /* Advanced prediction mode */ | 4396 s->unrestricted_mv = s->umvplus || s->obmc; |
4272 } | 4397 s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */ |
4273 if (get_bits1(&s->gb) != 0) { /* Advanced Intra Coding (AIC) */ | |
4274 s->h263_aic = 1; | |
4275 } | |
4276 | 4398 |
4277 if (get_bits1(&s->gb) != 0) { | 4399 if (get_bits1(&s->gb) != 0) { |
4278 av_log(s->avctx, AV_LOG_ERROR, "Deblocking Filter not supported\n"); | 4400 av_log(s->avctx, AV_LOG_ERROR, "Deblocking Filter not supported\n"); |
4279 } | 4401 } |
4280 if (get_bits1(&s->gb) != 0) { | 4402 if (get_bits1(&s->gb) != 0) { |
4301 return -1; | 4423 return -1; |
4302 } | 4424 } |
4303 | 4425 |
4304 /* MPPTYPE */ | 4426 /* MPPTYPE */ |
4305 s->pict_type = get_bits(&s->gb, 3) + I_TYPE; | 4427 s->pict_type = get_bits(&s->gb, 3) + I_TYPE; |
4306 dprintf("pict_type: %d\n", s->pict_type); | |
4307 if (s->pict_type == 8 && s->avctx->codec_tag == ff_get_fourcc("ZYGO")) | 4428 if (s->pict_type == 8 && s->avctx->codec_tag == ff_get_fourcc("ZYGO")) |
4308 s->pict_type = I_TYPE; | 4429 s->pict_type = I_TYPE; |
4309 if (s->pict_type != I_TYPE && | 4430 if (s->pict_type != I_TYPE && |
4310 s->pict_type != P_TYPE) | 4431 s->pict_type != P_TYPE) |
4311 return -1; | 4432 return -1; |
4312 skip_bits(&s->gb, 2); | 4433 skip_bits(&s->gb, 2); |
4313 s->no_rounding = get_bits1(&s->gb); | 4434 s->no_rounding = get_bits1(&s->gb); |
4314 dprintf("RTYPE: %d\n", s->no_rounding); | |
4315 skip_bits(&s->gb, 4); | 4435 skip_bits(&s->gb, 4); |
4316 | 4436 |
4317 /* Get the picture dimensions */ | 4437 /* Get the picture dimensions */ |
4318 if (ufep) { | 4438 if (ufep) { |
4319 if (format == 6) { | 4439 if (format == 6) { |
4369 s->y_dc_scale_table= | 4489 s->y_dc_scale_table= |
4370 s->c_dc_scale_table= ff_mpeg1_dc_scale_table; | 4490 s->c_dc_scale_table= ff_mpeg1_dc_scale_table; |
4371 } | 4491 } |
4372 | 4492 |
4373 if(s->avctx->debug&FF_DEBUG_PICT_INFO){ | 4493 if(s->avctx->debug&FF_DEBUG_PICT_INFO){ |
4374 av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d %s %s %s %s\n", | 4494 av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s\n", |
4375 s->qscale, av_get_pict_type_char(s->pict_type), | 4495 s->qscale, av_get_pict_type_char(s->pict_type), |
4376 s->gb.size_in_bits, 1-s->no_rounding, | 4496 s->gb.size_in_bits, 1-s->no_rounding, |
4377 s->mv_type == MV_TYPE_8X8 ? "ADV" : "", | 4497 s->obmc ? " AP" : "", |
4378 s->umvplus ? "UMV" : "", | 4498 s->umvplus ? " UMV" : "", |
4379 s->h263_long_vectors ? "LONG" : "", | 4499 s->h263_long_vectors ? " LONG" : "", |
4380 s->h263_plus ? "+" : "" | 4500 s->h263_plus ? " +" : "", |
4501 s->h263_aic ? " AIC" : "" | |
4381 ); | 4502 ); |
4382 } | 4503 } |
4383 #if 1 | 4504 #if 1 |
4384 if (s->pict_type == I_TYPE && s->avctx->codec_tag == ff_get_fourcc("ZYGO")){ | 4505 if (s->pict_type == I_TYPE && s->avctx->codec_tag == ff_get_fourcc("ZYGO")){ |
4385 int i,j; | 4506 int i,j; |
5244 if (get_bits1(&s->gb) != 0) { | 5365 if (get_bits1(&s->gb) != 0) { |
5245 av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n"); | 5366 av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n"); |
5246 return -1; /* SAC: off */ | 5367 return -1; /* SAC: off */ |
5247 } | 5368 } |
5248 if (get_bits1(&s->gb) != 0) { | 5369 if (get_bits1(&s->gb) != 0) { |
5370 s->obmc= 1; | |
5249 av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n"); | 5371 av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n"); |
5250 return -1; /* advanced prediction mode: off */ | 5372 // return -1; /* advanced prediction mode: off */ |
5251 } | 5373 } |
5252 if (get_bits1(&s->gb) != 0) { | 5374 if (get_bits1(&s->gb) != 0) { |
5253 av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n"); | 5375 av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n"); |
5254 return -1; /* PB frame mode */ | 5376 return -1; /* PB frame mode */ |
5255 } | 5377 } |