[FFmpeg-devel] [MPlayer-users] [BUG] swscaler conversion of yv12 to nv12 broken (fwd)

Michael Niedermayer michaelni
Sat Aug 1 20:20:36 CEST 2009


[...]
> Ok, problem fixed. Or more precisely, it's cause found and a crude 
> solution produced, now it's up to you to produce a correct one. So, the 
> cause is, that sws_getContext() is now picking up a wrong converter for 
> the yv12 -> nv12 case. It first gets the right one - 
> PlanarToNV12Wrapper(), but then it goes on and overwrites its first choice 
> with planarCopy(). The reason, I think, is too broad criteria for the 
> latter one. I narrowed them down with
> 
> Index: libswscale/swscale.c
> ===================================================================
> --- libswscale/swscale.c	(revision 29435)
> +++ libswscale/swscale.c	(working copy)
> @@ -2791,7 +2791,9 @@
>              || (isGray(dstFormat) && isGray(srcFormat))
>              || (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat)
>                  && c->chrDstHSubSample == c->chrSrcHSubSample
> -                && c->chrDstVSubSample == c->chrSrcVSubSample))
> +                && c->chrDstVSubSample == c->chrSrcVSubSample
> +		&& dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21
> +		&& srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21))
>          {
>              if (isPacked(c->srcFormat))
>                  c->swScale= packedCopy;

without the tabs, ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20090801/2dd53868/attachment.pgp>



More information about the ffmpeg-devel mailing list