Commit c978997a authored by Kostya Shishkov's avatar Kostya Shishkov

Enable PB-frames decoding for H.263

Originally committed as revision 17746 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 685502cf
...@@ -5104,10 +5104,7 @@ int h263_decode_picture_header(MpegEncContext *s) ...@@ -5104,10 +5104,7 @@ int h263_decode_picture_header(MpegEncContext *s)
s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
s->unrestricted_mv = s->h263_long_vectors || s->obmc; s->unrestricted_mv = s->h263_long_vectors || s->obmc;
if (get_bits1(&s->gb) != 0) { s->pb_frame = get_bits1(&s->gb);
av_log(s->avctx, AV_LOG_ERROR, "H263 PB frame not supported\n");
return -1; /* not PB frame */
}
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */ skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
...@@ -5162,6 +5159,7 @@ int h263_decode_picture_header(MpegEncContext *s) ...@@ -5162,6 +5159,7 @@ int h263_decode_picture_header(MpegEncContext *s)
switch(s->pict_type){ switch(s->pict_type){
case 0: s->pict_type= FF_I_TYPE;break; case 0: s->pict_type= FF_I_TYPE;break;
case 1: s->pict_type= FF_P_TYPE;break; case 1: s->pict_type= FF_P_TYPE;break;
case 2: s->pict_type= FF_P_TYPE;s->pb_frame = 3;break;
case 3: s->pict_type= FF_B_TYPE;break; case 3: s->pict_type= FF_B_TYPE;break;
case 7: s->pict_type= FF_I_TYPE;break; //ZYGO case 7: s->pict_type= FF_I_TYPE;break; //ZYGO
default: default:
...@@ -5251,6 +5249,13 @@ int h263_decode_picture_header(MpegEncContext *s) ...@@ -5251,6 +5249,13 @@ int h263_decode_picture_header(MpegEncContext *s)
s->mb_height = (s->height + 15) / 16; s->mb_height = (s->height + 15) / 16;
s->mb_num = s->mb_width * s->mb_height; s->mb_num = s->mb_width * s->mb_height;
if (s->pb_frame) {
skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */
if (s->custom_pcf)
skip_bits(&s->gb, 2); //extended Temporal reference
skip_bits(&s->gb, 2); /* Quantization information for B-pictures */
}
/* PEI */ /* PEI */
while (get_bits1(&s->gb) != 0) { while (get_bits1(&s->gb) != 0) {
skip_bits(&s->gb, 8); skip_bits(&s->gb, 8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment