summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
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 /libavcodec/mpegvideo.c
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>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c21
1 files changed, 21 insertions, 0 deletions
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)