diff options
author | Lynne <dev@lynne.ee> | 2022-09-03 03:36:40 +0200 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-09-06 04:21:46 +0200 |
commit | 4537d9554d9a0027ba028c8eb16221d9235ebe43 (patch) | |
tree | 1924f67b3164f800d23cb907946050463506f2df /libavutil/tx_priv.h | |
parent | 2425d5cd7e37387305f85bef63f7441c8b1cc147 (diff) | |
download | ffmpeg-4537d9554d9a0027ba028c8eb16221d9235ebe43.tar.gz |
x86/tx_float: implement inverse MDCT AVX2 assembly
This commit implements an iMDCT in pure assembly.
This is capable of processing any mod-8 transforms, rather than just
power of two, but since power of two is all we have assembly for
currently, that's what's supported.
It would really benefit if we could somehow use the C code to decide
which function to jump into, but exposing function labels from assebly
into C is anything but easy.
The post-transform loop could probably be improved.
This was somewhat annoying to write, as we must support arbitrary
strides during runtime. There's a fast branch for stride == 4 bytes
and a slower one which uses vgatherdps.
Zen 3 benchmarks for stride == 4 for old (av_imdct_half) vs new (av_tx):
128pt:
2811 decicycles in av_tx (imdct),16775916 runs, 1300 skips
3082 decicycles in av_imdct_half,16776751 runs, 465 skips
256pt:
4920 decicycles in av_tx (imdct),16775820 runs, 1396 skips
5378 decicycles in av_imdct_half,16776411 runs, 805 skips
512pt:
9668 decicycles in av_tx (imdct),16775774 runs, 1442 skips
10626 decicycles in av_imdct_half,16775647 runs, 1569 skips
1024pt:
19812 decicycles in av_tx (imdct),16777144 runs, 72 skips
23036 decicycles in av_imdct_half,16777167 runs, 49 skips
Diffstat (limited to 'libavutil/tx_priv.h')
-rw-r--r-- | libavutil/tx_priv.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h index 691942f808..28ac31a597 100644 --- a/libavutil/tx_priv.h +++ b/libavutil/tx_priv.h @@ -288,9 +288,13 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s); * functions in AVX mode. * * If length is smaller than basis/2 this function will not do anything. + * + * If inv_lookup is set to 1, it will flip the lookup from out[map[i]] = src[i] + * to out[i] = src[map[i]]. If set to -1, will generate 2 maps, the first one + * flipped, the second one regular. */ -int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int invert_lookup, - int basis, int dual_stride); +int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int len, int inv, + int inv_lookup, int basis, int dual_stride); /* Typed init function to initialize shared tables. Will initialize all tables * for all factors of a length. */ |