summaryrefslogtreecommitdiff
path: root/libavutil/tx_priv.h
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-04-10 03:52:31 +0200
committerLynne <dev@lynne.ee>2021-04-24 17:17:30 +0200
commitff71671d88ef23e1a539e1a99eadd766c27f3ed3 (patch)
treef254fd6fb8bae40366900d3b3b0a0c97851387b6 /libavutil/tx_priv.h
parent18af1ea8d14dd0a6aee4ff4542a4f89b63d89dd4 (diff)
lavu/tx: add parity revtab generator version
This will be used for SIMD support.
Diffstat (limited to 'libavutil/tx_priv.h')
-rw-r--r--libavutil/tx_priv.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index 1d4245e71b..b889f6d3b4 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -149,6 +149,37 @@ int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup);
*/
int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s);
+/*
+ * This generates a parity-based revtab of length len and direction inv.
+ *
+ * Parity means even and odd complex numbers will be split, e.g. the even
+ * coefficients will come first, after which the odd coefficients will be
+ * placed. For example, a 4-point transform's coefficients after reordering:
+ * z[0].re, z[0].im, z[2].re, z[2].im, z[1].re, z[1].im, z[3].re, z[3].im
+ *
+ * The basis argument is the length of the largest non-composite transform
+ * supported, and also implies that the basis/2 transform is supported as well,
+ * as the split-radix algorithm requires it to be.
+ *
+ * The dual_stride argument indicates that both the basis, as well as the
+ * basis/2 transforms support doing two transforms at once, and the coefficients
+ * will be interleaved between each pair in a split-radix like so (stride == 2):
+ * tx1[0], tx1[2], tx2[0], tx2[2], tx1[1], tx1[3], tx2[1], tx2[3]
+ * A non-zero number switches this on, with the value indicating the stride
+ * (how many values of 1 transform to put first before switching to the other).
+ * Must be a power of two or 0. Must be less than the basis.
+ * Value will be clipped to the transform size, so for a basis of 16 and a
+ * dual_stride of 8, dual 8-point transforms will be laid out as if dual_stride
+ * was set to 4.
+ * Usually you'll set this to half the complex numbers that fit in a single
+ * register or 0. This allows to reuse SSE functions as dual-transform
+ * functions in AVX mode.
+ *
+ * If length is smaller than basis/2 this function will not do anything.
+ */
+void ff_tx_gen_split_radix_parity_revtab(int *revtab, int len, int inv,
+ int basis, int dual_stride);
+
/* Templated init functions */
int ff_tx_init_mdct_fft_float(AVTXContext *s, av_tx_fn *tx,
enum AVTXType type, int inv, int len,