[FFmpeg-devel] [PATCH] x86/fdct: port fdct functions to yasm

Michael Niedermayer michaelni at gmx.at
Wed Jun 4 01:49:38 CEST 2014


On Tue, Jun 03, 2014 at 08:01:42PM -0300, James Almer wrote:
> On 28/05/14 7:58 PM, James Almer wrote:
> > On 25/05/14 8:58 PM, James Almer wrote:
> >> Signed-off-by: James Almer <jamrial at gmail.com>
> >> ---
> >>  libavcodec/x86/Makefile         |   3 +-
> >>  libavcodec/x86/dsputilenc_mmx.c |  42 ++-
> >>  libavcodec/x86/fdct.asm         | 298 ++++++++++++++++++++
> >>  libavcodec/x86/fdct.c           | 594 ----------------------------------------
> >>  4 files changed, 315 insertions(+), 622 deletions(-)
> >>  create mode 100644 libavcodec/x86/fdct.asm
> >>  delete mode 100644 libavcodec/x86/fdct.c
> > 
> > Currently, this line is preventing this patch from working if ffmpeg is configured 
> > with --disable-yasm: 
> > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/x86/mpegvideoenc_template.c;h=76a5c5a154cd9c04e714ac623ef2673d15f60764;hb=HEAD#l112
> > This is an inline asm function that's unconditionally calling one of the simd versions 
> > of ff_fdct, and was introduced 12 years ago in commit 28db7fce.
> > 

> > There doesn't seem to be a FATE test currently using dct_quantize_<opt> to see if 
> > changing that line to "s->dsp.fdct(block);" is a possibility (So it might fall back to 

the various dcts use different implementations and are not bitexact to
each other, so testing would not be possible easily on the resulting
bitstream, only the decoded output from the bitstream could be tested
easily
such tests are of course welcome if someone wants to add them ...


> > the C implementation if needed), and I'm not sure how to manually trigger it either.
> > Then there's of course the comment in that line that makes me wonder if changing it 
> > isn't out of the question to begin with.
> > 
> > The only other solutions would be making the simd versions of dct_quantize depend on 
> > both inline asm and yasm (Which is ugly and we already reverted changes that tried 
> > this before), or port them to yasm, which is a big task I'm not really up to.
> > 
> > Any idea if changing that line as mentioned above is a possibility?

> > Or any way/sample
> > to test the simd versions of dct_quantize?

they should be used when encoding to any 8x8 dct based codec like
mpeg1/2/4, jpeg, h263

-cpuflags and -dct should allow selecting which is used

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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/20140604/48e8be76/attachment.asc>


More information about the ffmpeg-devel mailing list