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

Michael Niedermayer michaelni
Thu Mar 27 03:05:19 CET 2008


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


[...]

> --- 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


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

useless cast

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080327/5e1e970e/attachment.pgp>



More information about the ffmpeg-devel mailing list