aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-20 06:03:27 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-24 00:47:14 +0200
commit7f456917692c5aa9e4f4616e20e065210a7d93cc (patch)
treeb0879b26e4e3e9e88d1c9d480dbfc68429ea6311
parentde133d22dabbb1b00382510d1d3f94bea197ba3f (diff)
downloadffmpeg-7f456917692c5aa9e4f4616e20e065210a7d93cc.tar.gz
avcodec/idctdsp: Move ScanTable to mpegvideo
Only used there. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/idctdsp.c21
-rw-r--r--libavcodec/idctdsp.h11
-rw-r--r--libavcodec/mpegvideo.c21
-rw-r--r--libavcodec/mpegvideo.h11
4 files changed, 32 insertions, 32 deletions
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 50156930ed..7216afb094 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -36,27 +36,6 @@ av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64],
}
}
-av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
- const uint8_t *src_scantable)
-{
- int i, end;
-
- st->scantable = src_scantable;
-
- for (i = 0; i < 64; i++) {
- int j = src_scantable[i];
- st->permutated[i] = permutation[j];
- }
-
- end = -1;
- for (i = 0; i < 64; i++) {
- int j = st->permutated[i];
- if (j > end)
- end = j;
- st->raster_end[i] = end;
- }
-}
-
av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
enum idct_permutation_type perm_type)
{
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index b286bc231c..7224463349 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -25,15 +25,6 @@
#include "avcodec.h"
-/**
- * Scantable.
- */
-typedef struct ScanTable {
- const uint8_t *scantable;
- uint8_t permutated[64];
- uint8_t raster_end[64];
-} ScanTable;
-
enum idct_permutation_type {
FF_IDCT_PERM_NONE,
FF_IDCT_PERM_LIBMPEG2,
@@ -45,8 +36,6 @@ enum idct_permutation_type {
void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64],
const uint8_t permutation[64]);
-void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
- const uint8_t *src_scantable);
void ff_init_scantable_permutation(uint8_t *idct_permutation,
enum idct_permutation_type perm_type);
int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index fbe9884b4c..4326f7f9a5 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -320,6 +320,27 @@ static av_cold int dct_init(MpegEncContext *s)
return 0;
}
+av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
+ const uint8_t *src_scantable)
+{
+ int end;
+
+ st->scantable = src_scantable;
+
+ for (int i = 0; i < 64; i++) {
+ int j = src_scantable[i];
+ st->permutated[i] = permutation[j];
+ }
+
+ end = -1;
+ for (int i = 0; i < 64; i++) {
+ int j = st->permutated[i];
+ if (j > end)
+ end = j;
+ st->raster_end[i] = end;
+ }
+}
+
av_cold void ff_mpv_idct_init(MpegEncContext *s)
{
if (s->codec_id == AV_CODEC_ID_MPEG4)
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 237adf2388..60d2ec751e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -56,6 +56,15 @@
#define MAX_B_FRAMES 16
/**
+ * Scantable.
+ */
+typedef struct ScanTable {
+ const uint8_t *scantable;
+ uint8_t permutated[64];
+ uint8_t raster_end[64];
+} ScanTable;
+
+/**
* MpegEncContext.
*/
typedef struct MpegEncContext {
@@ -576,6 +585,8 @@ int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src);
void ff_set_qscale(MpegEncContext * s, int qscale);
void ff_mpv_idct_init(MpegEncContext *s);
+void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
+ const uint8_t *src_scantable);
void ff_init_block_index(MpegEncContext *s);
void ff_mpv_motion(MpegEncContext *s,