[FFmpeg-devel] [PATCH] mdec: use correctly permutated quant matrix for dequantization.

James Darnley jdarnley at obe.tv
Tue Jun 20 19:40:02 EEST 2017


On 2017-06-20 18:16, Ronald S. Bultje wrote:
> On Tue, Jun 20, 2017 at 12:04 PM, James Darnley <jdarnley at obe.tv> wrote:
>>> @@ -231,6 +230,13 @@ static av_cold int decode_init(AVCodecContext
>> *avctx)
>>>      avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
>>>      avctx->color_range = AVCOL_RANGE_JPEG;
>>>
>>> +    /* init q matrix */
>>> +    for (i = 0; i < 64; i++) {
>>> +        int j = a->idsp.idct_permutation[i];
>>> +
>>> +        a->quant_matrix[j] = ff_mpeg1_default_intra_matrix[i];
>>> +    }
>>> +
>>>      return 0;
>>>  }
>>>
>>>
>>
>> That patch seems to work.  FATE doesn't complain when I apply on top of
>> my others after dropping the one Michael complained about.  That is what
>> it was supposed to do, right?
> 
> 
> Yes, it's intended to be an alternative to that patch, based on Michael's
> review/comments.

Good.  Are you going to push it?  Do you want me to?  Are you waiting
for something else?

>>> @@ -212,9 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
>>>  static av_cold int decode_init(AVCodecContext *avctx)
>>>  {
>>>      MDECContext * const a = avctx->priv_data;
>>> -
>>> -    if (avctx->idct_algo == FF_IDCT_AUTO)
>>> -        avctx->idct_algo = FF_IDCT_SIMPLE;
>>> +    int i;
>>>
>>>      a->mb_width  = (avctx->coded_width  + 15) / 16;
>>>      a->mb_height = (avctx->coded_height + 15) / 16;

I have just one suggestion to make this time.  I think you should
mention that you remove the idct override in the commit message.



More information about the ffmpeg-devel mailing list