[FFmpeg-devel] [PATCH v2] aacenc: add SIMD optimizations for abs_pow34 and quantization

Rostislav Pehlivanov atomnuker at gmail.com
Sun Oct 9 15:15:44 EEST 2016


On 9 October 2016 at 03:18, Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Sat, Oct 08, 2016 at 06:42:28PM +0100, Rostislav Pehlivanov wrote:
> > Performance improvements:
> >
> > quant_bands:
> > with:     681 decicycles in quant_bands, 8388453 runs,    155 skips
> > without: 1190 decicycles in quant_bands, 8388386 runs,    222 skips
> > Around 42% for the function
> >
> > Twoloop coder:
> >
> > abs_pow34:
> > with/without: 7.82s/8.17s
> > Around 4% for the entire encoder
> >
> > Both:
> > with/without: 7.15s/8.17s
> > Around 12% for the entire encoder
> >
> > Fast coder:
> >
> > abs_pow34:
> > with/without: 3.40s/3.77s
> > Around 10% for the entire encoder
> >
> > Both:
> > with/without: 3.02s/3.77s
> > Around 20% faster for the entire encoder
> >
> > Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> > ---
> >  libavcodec/aaccoder.c            |  22 ++++----
> >  libavcodec/aaccoder_trellis.h    |   2 +-
> >  libavcodec/aaccoder_twoloop.h    |   2 +-
> >  libavcodec/aacenc.c              |   4 ++
> >  libavcodec/aacenc.h              |   6 +++
> >  libavcodec/aacenc_is.c           |   6 +--
> >  libavcodec/aacenc_ltp.c          |   4 +-
> >  libavcodec/aacenc_pred.c         |   6 +--
> >  libavcodec/aacenc_quantization.h |   4 +-
> >  libavcodec/aacenc_utils.h        |   4 +-
> >  libavcodec/x86/Makefile          |   2 +
> >  libavcodec/x86/aacencdsp.asm     | 108 ++++++++++++++++++++++++++++++
> +++++++++
> >  libavcodec/x86/aacencdsp_init.c  |  42 +++++++++++++++
> >  13 files changed, 187 insertions(+), 25 deletions(-)
> >  create mode 100644 libavcodec/x86/aacencdsp.asm
> >  create mode 100644 libavcodec/x86/aacencdsp_init.c
>
> libavcodec/x86/aacencdsp.asm:67: error: expression syntax error
> libavcodec/x86/aacencdsp.asm:79: warning: (RUN_AVX_INSTR:22) use of
> ``movd'' sse2 instruction in sse function: ff_aac_quantize_bands_sse
> libavcodec/x86/aacencdsp.asm:99: warning: (RUN_AVX_INSTR:22) use of
> ``pand'' sse2 instruction in sse function: ff_aac_quantize_bands_sse
> libavcodec/x86/aacencdsp.asm:103: warning: (RUN_AVX_INSTR:20) use of
> ``cvttps2dq'' sse2 instruction in sse function: ff_aac_quantize_bands_sse
>
> yasm 1.2.0
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Breaking DRM is a little like attempting to break through a door even
> though the window is wide open and the only thing in the house is a bunch
> of things you dont want and which you would get tomorrow for free anyway
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Yes, discussed on IRC, fixed that yesterday. Attached the patch if you want
to test.
I'll push it tonight unless confirmed to not work on Windows (haven't
tested but it should work according to what nevcairiel said).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-aacenc-add-SIMD-optimizations-for-abs_pow34-and-quan.patch
Type: text/x-patch
Size: 19558 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161009/6f8148e5/attachment.bin>


More information about the ffmpeg-devel mailing list