summaryrefslogtreecommitdiff
path: root/libavutil/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/tx.c')
-rw-r--r--libavutil/tx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavutil/tx.c b/libavutil/tx.c
index ac67b354be..1161df3285 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -91,7 +91,7 @@ int ff_tx_gen_compound_mapping(AVTXContext *s)
return 0;
}
-int ff_tx_gen_ptwo_revtab(AVTXContext *s)
+int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)
{
const int m = s->m, inv = s->inv;
@@ -101,7 +101,10 @@ int ff_tx_gen_ptwo_revtab(AVTXContext *s)
/* Default */
for (int i = 0; i < m; i++) {
int k = -split_radix_permutation(i, m, inv) & (m - 1);
- s->revtab[k] = i;
+ if (invert_lookup)
+ s->revtab[i] = k;
+ else
+ s->revtab[k] = i;
}
return 0;