1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

vc1dec: fix handling of max_coded dimensions

Fixes Ticket1502

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-31 03:00:35 +02:00
parent 30c8573dc7
commit 3b5ba60aa7
2 changed files with 10 additions and 7 deletions

View File

@ -418,7 +418,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
{ {
int w, h;
v->res_rtm_flag = 1; v->res_rtm_flag = 1;
v->level = get_bits(gb, 3); v->level = get_bits(gb, 3);
if (v->level >= 5) { if (v->level >= 5) {
@ -437,9 +436,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
v->bitrtq_postproc = get_bits(gb, 5); //common v->bitrtq_postproc = get_bits(gb, 5); //common
v->postprocflag = get_bits1(gb); //common v->postprocflag = get_bits1(gb); //common
w = (get_bits(gb, 12) + 1) << 1; v->max_coded_width = (get_bits(gb, 12) + 1) << 1;
h = (get_bits(gb, 12) + 1) << 1; v->max_coded_height = (get_bits(gb, 12) + 1) << 1;
avcodec_set_dimensions(v->s.avctx, w, h);
v->broadcast = get_bits1(gb); v->broadcast = get_bits1(gb);
v->interlace = get_bits1(gb); v->interlace = get_bits1(gb);
v->tfcntrflag = get_bits1(gb); v->tfcntrflag = get_bits1(gb);
@ -528,6 +526,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
{ {
int i; int i;
int w,h;
av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32)); av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32));
v->broken_link = get_bits1(gb); v->broken_link = get_bits1(gb);
@ -551,10 +550,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
} }
if(get_bits1(gb)){ if(get_bits1(gb)){
int w = (get_bits(gb, 12)+1)<<1; w = (get_bits(gb, 12)+1)<<1;
int h = (get_bits(gb, 12)+1)<<1; h = (get_bits(gb, 12)+1)<<1;
avcodec_set_dimensions(avctx, w, h); } else {
w = v->max_coded_width;
h = v->max_coded_height;
} }
avcodec_set_dimensions(avctx, w, h);
if (v->extended_mv) if (v->extended_mv)
v->extended_dmv = get_bits1(gb); v->extended_dmv = get_bits1(gb);
if ((v->range_mapy_flag = get_bits1(gb))) { if ((v->range_mapy_flag = get_bits1(gb))) {

View File

@ -225,6 +225,7 @@ typedef struct VC1Context{
int profile; ///< 2bits, Profile int profile; ///< 2bits, Profile
int frmrtq_postproc; ///< 3bits, int frmrtq_postproc; ///< 3bits,
int bitrtq_postproc; ///< 5bits, quantized framerate-based postprocessing strength int bitrtq_postproc; ///< 5bits, quantized framerate-based postprocessing strength
int max_coded_width, max_coded_height;
int fastuvmc; ///< Rounding of qpel vector to hpel ? (not in Simple) int fastuvmc; ///< Rounding of qpel vector to hpel ? (not in Simple)
int extended_mv; ///< Ext MV in P/B (not in Simple) int extended_mv; ///< Ext MV in P/B (not in Simple)
int dquant; ///< How qscale varies with MBs, 2bits (not in Simple) int dquant; ///< How qscale varies with MBs, 2bits (not in Simple)