Merge commit '924e2ecd2b7d51cca60c79351ef16b04dd4245c3'
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 14 Nov 2016 14:20:09 +0000 (15:20 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 14 Nov 2016 14:20:09 +0000 (15:20 +0100)
* commit '924e2ecd2b7d51cca60c79351ef16b04dd4245c3':
  qsvdec: when a frames ctx is supplied, use its frame dimensions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/qsvdec.c

@@@ -146,25 -151,10 +151,25 @@@ static int qsv_decode_init(AVCodecConte
      param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
      param.mfx.FrameInfo.Shift          = desc->comp[0].depth > 8;
      param.mfx.FrameInfo.FourCC         = q->fourcc;
-     param.mfx.FrameInfo.Width          = avctx->coded_width;
-     param.mfx.FrameInfo.Height         = avctx->coded_height;
+     param.mfx.FrameInfo.Width          = frame_width;
+     param.mfx.FrameInfo.Height         = frame_height;
      param.mfx.FrameInfo.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
  
 +    switch (avctx->field_order) {
 +    case AV_FIELD_PROGRESSIVE:
 +        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
 +        break;
 +    case AV_FIELD_TT:
 +        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
 +        break;
 +    case AV_FIELD_BB:
 +        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_BFF;
 +        break;
 +    default:
 +        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_UNKNOWN;
 +        break;
 +    }
 +
      param.IOPattern   = q->iopattern;
      param.AsyncDepth  = q->async_depth;
      param.ExtParam    = q->ext_buffers;