• Sebastian Pop's avatar
    swscale/aarch64: use multiply accumulate and shift-right narrow · c3a17fff
    Sebastian Pop authored
    This patch rewrites the innermost loop of ff_yuv2planeX_8_neon to avoid zips and
    horizontal adds by using fused multiply adds. The patch also uses ld1r to load
    one element and replicate it across all lanes of the vector. The patch also
    improves the clipping code by removing the shift right instructions and
    performing the shift with the shift-right narrow instructions.
    
    I see 8% difference on an m6g instance with neoverse-n1 CPUs:
    $ ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -
    before: t:0.014015 avg:0.014096 max:0.015018 min:0.013971
    after:  t:0.012985 avg:0.013013 max:0.013996 min:0.012818
    
    Tested with `make check` on aarch64-linux.
    Signed-off-by: 's avatarSebastian Pop <spop@amazon.com>
    Reviewed-by: 's avatarClément Bœsch <u@pkh.me>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    c3a17fff
Name
Last commit
Last update
..
aarch64 Loading commit data...
arm Loading commit data...
ppc Loading commit data...
tests Loading commit data...
x86 Loading commit data...
Makefile Loading commit data...
alphablend.c Loading commit data...
bayer_template.c Loading commit data...
gamma.c Loading commit data...
hscale.c Loading commit data...
hscale_fast_bilinear.c Loading commit data...
input.c Loading commit data...
libswscale.v Loading commit data...
log2_tab.c Loading commit data...
options.c Loading commit data...
output.c Loading commit data...
rgb2rgb.c Loading commit data...
rgb2rgb.h Loading commit data...
rgb2rgb_template.c Loading commit data...
slice.c Loading commit data...
swscale.c Loading commit data...
swscale.h Loading commit data...
swscale_internal.h Loading commit data...
swscale_unscaled.c Loading commit data...
swscaleres.rc Loading commit data...
utils.c Loading commit data...
version.h Loading commit data...
vscale.c Loading commit data...
yuv2rgb.c Loading commit data...