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

Michael Niedermayer michael at niedermayer.cc
Wed Jun 21 03:45:14 EEST 2017


On Tue, Jun 20, 2017 at 08:18:20PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Jun 20, 2017 at 5:22 PM, Michael Niedermayer <michael at niedermayer.cc
> > wrote:
> 
> > On Tue, Jun 20, 2017 at 08:47:33AM -0400, Ronald S. Bultje wrote:
> > > This allows using non-simple (e.g. simplemmx) IDCT implementations.
> > > The result is not bitexact (which is why the fate test continues to
> > > use -idct simple), but the PSNR between C/MMX goes from ~35 to ~90.
> > > ---
> > >  libavcodec/mdec.c | 14 ++++++++++----
> > >  1 file changed, 10 insertions(+), 4 deletions(-)
> > >
> > [...]
> >
> > > @@ -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;
> >
> > iam not sure this should be in this patch
> 
> 
> Can you be more precise?

> Would you like this in a separate patch?

yes


> Or do you
> think it's wrong?

no, i dont think the change is wrong, but thats just thinking

The code was added in:

commit e3e3c82555e2382125195c1ba9f34b5a43299abc
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Sun Jan 2 11:16:21 2011 +0000

    Make PSX MDEC decoder output YUVJ420 and always use IDCT_SIMPLE. This
    makes the output much closer to original Playstation hardware.



> 
> I believe this code was there because the PSNR between FF_IDCT_SIMPLE and
> SIMPLEMMX was 35, which is pretty terrible. This was probably because of
> the bug in the dequant permutation that's fixed in this patch. After this
> patch, the PSNR between the two is 90, which is pretty decent and good
> enough for me to enable it by default (although not in fate).
> 
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170621/d7dd441b/attachment.sig>


More information about the ffmpeg-devel mailing list