|
|
@@ -1278,8 +1278,12 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) |
|
|
|
return -2; |
|
|
|
|
|
|
|
avcodec_set_dimensions(avctx, s->width, s->height); |
|
|
|
if (s->bit_rate && s->bit_rate != 0x3FFFF*400) |
|
|
|
avctx->bit_rate = s->bit_rate; |
|
|
|
if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { |
|
|
|
avctx->rc_max_rate = s->bit_rate; |
|
|
|
} else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && |
|
|
|
(s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) { |
|
|
|
avctx->bit_rate = s->bit_rate; |
|
|
|
} |
|
|
|
s1->save_aspect_info = s->aspect_ratio_info; |
|
|
|
s1->save_width = s->width; |
|
|
|
s1->save_height = s->height; |
|
|
@@ -1378,6 +1382,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, |
|
|
|
return -1; |
|
|
|
|
|
|
|
vbv_delay = get_bits(&s->gb, 16); |
|
|
|
s->vbv_delay = vbv_delay; |
|
|
|
if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) { |
|
|
|
s->full_pel[0] = get_bits1(&s->gb); |
|
|
|
f_code = get_bits(&s->gb, 3); |
|
|
|