avcodec/mjpegdec: Avoid using HpelDSPContext

It is quite big and we only need one function from it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-09-12 03:47:13 +02:00
parent 124c856d38
commit b5cfabf0f5
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1427,7 +1427,7 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
int linesize, int lowres)
{
switch (lowres) {
case 0: s->hdsp.put_pixels_tab[1][0](dst, src, linesize, 8);
case 0: s->copy_block(dst, src, linesize, 8);
break;
case 1: copy_block4(dst, src, linesize, linesize, 4);
break;
+1 -1
View File
@@ -119,8 +119,8 @@ typedef struct MJpegDecodeContext {
int force_pal8;
uint8_t permutated_scantable[64];
BlockDSPContext bdsp;
HpelDSPContext hdsp;
IDCTDSPContext idsp;
op_pixels_func copy_block; ///< only set and used by mxpeg
int restart_interval;
int restart_count;
+3 -1
View File
@@ -65,8 +65,10 @@ static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
{
MXpegDecodeContext *s = avctx->priv_data;
HpelDSPContext hdsp;
ff_hpeldsp_init(&s->jpg.hdsp, avctx->flags);
ff_hpeldsp_init(&hdsp, avctx->flags);
s->jpg.copy_block = hdsp.put_pixels_tab[1][0];
s->picture[0] = av_frame_alloc();
s->picture[1] = av_frame_alloc();