[FFmpeg-devel] [PATCH] swscale: fix yuv2yuvX_8 assembly on x86

Michael Niedermayer michaelni at gmx.at
Sun Nov 9 22:50:21 CET 2014


On Sun, Nov 09, 2014 at 09:55:03PM +0100, Michael Niedermayer wrote:
> On Sun, Nov 09, 2014 at 09:50:01PM +0100, Michael Niedermayer wrote:
> > On Sun, Nov 09, 2014 at 05:38:34PM -0300, James Almer wrote:
> > > On 09/11/14 5:28 PM, Michael Niedermayer wrote:
> > > > On Sun, Nov 09, 2014 at 08:39:35PM +0100, Kieran Kunhya wrote:
> > > >> ---
> > > >>  libswscale/x86/swscale.c |    2 +-
> > > >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >>
> > > >> diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
> > > >> index 8ce87b3..c9f3b1a 100644
> > > >> --- a/libswscale/x86/swscale.c
> > > >> +++ b/libswscale/x86/swscale.c
> > > >> @@ -430,7 +430,7 @@ switch(c->dstBpc){ \
> > > >>      case 16:                          do_16_case;                          break; \
> > > >>      case 10: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \
> > > >>      case 9:  if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_  ## opt; break; \
> > > >> -    default: if (condition_8bit)    /*vscalefn = ff_yuv2planeX_8_  ## opt;*/ break; \
> > > >> +    case 8: if (condition_8bit)      vscalefn = ff_yuv2planeX_8_  ## opt; break; \
> > > > 
> > > > doesnt work:
> > > > for example this generates a funny colored output and seems to not
> > > > look the same when run multiple times
> > > > ffmpeg -f lavfi -i testsrc -t 1 test.avi
> > > 
> > > Fate passes with this patch applied. Shouldn't a test that can detect this be added then?
> > 
> > hmm, i wonder why none of the existing tests caught this
> > either way, one should be added
> 
> following passes:
> ./ffmpeg -f lavfi -i testsrc,scale=flags=bicubic+bitexact,format=yuv420p -t 1 testX.avi
> 
> and that fails:
> ./ffmpeg -f lavfi -i testsrc,scale=flags=bicubic,format=yuv420p -t 1 test.avi
> 
> so it seems to work with the bitexat flag, which explains why fate
> passed but also makes adding a test more tricky

anyway, the reason why this fails is because the yasm code seems
to implement the C API not the API for SIMD yuv2planeX
See: yuv2yuvX(), use_mmx_vfilter

but i just took a quick look and its a while ago that i worked on the
code but i think the C API is not a good idea as it requires several
avoidable operations

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141109/899f1a7e/attachment.asc>


More information about the ffmpeg-devel mailing list