summaryrefslogtreecommitdiff
path: root/libavcodec/idctdsp.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-20 04:26:00 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-24 00:46:59 +0200
commitee0e03fe772a244e5c3633b8024ae3b3485fbb54 (patch)
tree383e994da4d805a7577e27744130b62f7425ddde /libavcodec/idctdsp.c
parent0d53d92e3a94a89582f4ee7aa37c3cb54b573b3a (diff)
avcodec/idctdsp: Add function to apply permutation to array
It is the part of ff_init_scantable() that is used by all users of said function. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/idctdsp.c')
-rw-r--r--libavcodec/idctdsp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 4ee9c3aa74..50156930ed 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -27,6 +27,15 @@
#include "simple_idct.h"
#include "xvididct.h"
+av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64],
+ const uint8_t permutation[64])
+{
+ for (int i = 0; i < 64; i++) {
+ int j = src[i];
+ dst[i] = permutation[j];
+ }
+}
+
av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
const uint8_t *src_scantable)
{