aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-20 05:53:39 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-24 00:47:11 +0200
commit69f46ff586cfb42952f098a94b9bb34bdd706809 (patch)
treed9219013effa84b45b2b4c5ea3354f0c609c3959 /libavcodec
parent3cdfb146b2b094b910d6c37f36944bfcaa5f7179 (diff)
downloadffmpeg-69f46ff586cfb42952f098a94b9bb34bdd706809.tar.gz
avcodec/mjpegenc_common: Only pass what is used from ScanTable
Namely ScanTable.permutated. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegenc.c2
-rw-r--r--libavcodec/mjpegenc_common.c10
-rw-r--r--libavcodec/mjpegenc_common.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index e56a466b36..eafe7130e2 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -81,7 +81,7 @@ static av_cold void init_uni_ac_vlc(const uint8_t huff_size_ac[256],
static void mjpeg_encode_picture_header(MpegEncContext *s)
{
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, s->picture->f, s->mjpeg_ctx,
- &s->intra_scantable, 0,
+ s->intra_scantable.permutated, 0,
s->intra_matrix, s->chroma_intra_matrix,
s->slice_context_count > 1);
diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index c37c964931..6dfc4469a5 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -58,7 +58,7 @@ static int put_huffman_table(PutBitContext *p, int table_class, int table_id,
static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
MJpegContext *m,
- ScanTable *intra_scantable,
+ const uint8_t intra_matrix_permutation[64],
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int hsample[3], int use_slices, int matrices_differ)
@@ -76,7 +76,7 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
put_bits(p, 4, 0); /* 8 bit precision */
put_bits(p, 4, 0); /* table 0 */
for (int i = 0; i < 64; i++) {
- uint8_t j = intra_scantable->permutated[i];
+ uint8_t j = intra_matrix_permutation[i];
put_bits(p, 8, luma_intra_matrix[j]);
}
@@ -84,7 +84,7 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
put_bits(p, 4, 0); /* 8 bit precision */
put_bits(p, 4, 1); /* table 1 */
for(i=0;i<64;i++) {
- j = intra_scantable->permutated[i];
+ j = intra_matrix_permutation[i];
put_bits(p, 8, chroma_intra_matrix[j]);
}
}
@@ -275,7 +275,7 @@ void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
const AVFrame *frame, struct MJpegContext *m,
- ScanTable *intra_scantable, int pred,
+ const uint8_t intra_matrix_permutation[64], int pred,
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int use_slices)
@@ -298,7 +298,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
chroma_matrix = !lossless && !!memcmp(luma_intra_matrix,
chroma_intra_matrix,
sizeof(luma_intra_matrix[0]) * 64);
- jpeg_table_header(avctx, pb, m, intra_scantable,
+ jpeg_table_header(avctx, pb, m, intra_matrix_permutation,
luma_intra_matrix, chroma_intra_matrix, hsample,
use_slices, chroma_matrix);
diff --git a/libavcodec/mjpegenc_common.h b/libavcodec/mjpegenc_common.h
index 5b13faae23..e9f0ea44a0 100644
--- a/libavcodec/mjpegenc_common.h
+++ b/libavcodec/mjpegenc_common.h
@@ -24,7 +24,6 @@
#include <stdint.h>
#include "avcodec.h"
-#include "idctdsp.h"
#include "put_bits.h"
struct MJpegContext;
@@ -33,7 +32,8 @@ int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame,
size_t *max_pkt_size);
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
const AVFrame *frame, struct MJpegContext *m,
- ScanTable *intra_scantable, int pred,
+ const uint8_t intra_matrix_permutation[64],
+ int pred,
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int use_slices);