[FFmpeg-devel] [PATCH] Fix mlib DCT routine in dsputil

Albert Lee trisk+xine
Fri Mar 28 03:33:20 CET 2008


On Thu, 2008-03-27 at 03:05 +0100, Michael Niedermayer wrote:
> On Wed, Mar 26, 2008 at 04:32:44PM -0400, Albert Lee wrote:
> > Hi,
> > 
> > 
> > The ff_fdct_mlib() in dsputil has been broken for a long time; it
> > assumes the mediaLib DCT scales its output by 8 (as libjpeg's does).
> > This results in a well-known "green tint" problem. The attached patch
> > adds the scaling.
> > 
> > I'm also attaching the email from the mediaLib engineer who proposed the
> > fix.
> 
> Could you try to play the following file and tell us if it decodes without
> artifacts on mlib?
> 
> http://samples.mplayerhq.hu/Divx4-bugs/Lorenna_McKennit-Mummers_Dance-Mononoke_Hime-gabucino.avi
> 

Oh great, an AMV. Yeah, it looks fine. There was an awful lot of green in it to begin with, though.

> 
> [...]
> 
> > --- ffmpeg-export-2007-07-31.orig/libavcodec/mlib/dsputil_mlib.c	Tue Jul 31 02:16:05 2007
> > +++ ffmpeg-export-2007-07-31/libavcodec/mlib/dsputil_mlib.c	Tue Mar 18 23:55:41 2008
> > @@ -416,7 +416,10 @@
> >  
> >  static void ff_fdct_mlib(DCTELEM *data)
> >  {
> > +    const mlib_s16 c[1] = {8};
> 
> static const

Yeah... missed that.

> 
> 
> > +
> >      mlib_VideoDCT8x8_S16_S16 (data, data);
> > +    mlib_VectorMulS_S16_Sat(data, (mlib_s16 *)&c, 64); /* scaling data by 8 */
> 
> useless cast
> 

Oops, that was a vestige of the previous version of the patch. Just
noticed it also doesn't have a space after the function name.

(Not replying to guy with the "useless comment" comment).

Anyway, patch has been updated to make the scalar arg static, and clean
up the stylistic issues.

-Albert


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-05-mlib.diff
Type: text/x-patch
Size: 463 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080327/f6e892e9/attachment.bin>



More information about the ffmpeg-devel mailing list