1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-09-16 08:36:51 +02:00

avcodec/mjpegdec: Move initializing HpelDSPContext to mxpegdec.c

Only the mxpeg decoder uses it (and the reference/bitmask feature
of ff_mjpeg_decode_sos()). So only initialize it for mxpeg which
allows to remove the mjpeg->hpeldsp dependency.

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 02:38:23 +02:00
parent b11c8b76df
commit 124c856d38
3 changed files with 5 additions and 3 deletions

4
configure vendored
View File

@@ -3076,9 +3076,9 @@ mdec_decoder_select="blockdsp bswapdsp idctdsp"
media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
metasound_decoder_select="lsp sinewin"
mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
mjpeg_decoder_select="blockdsp hpeldsp idctdsp jpegtables"
mjpeg_decoder_select="blockdsp idctdsp jpegtables"
mjpeg_encoder_select="jpegtables mpegvideoenc"
mjpegb_decoder_select="mjpeg_decoder"
mjpegb_decoder_select="hpeldsp mjpeg_decoder"
mlp_decoder_select="mlp_parser"
mlp_encoder_select="lpc audio_frame_queue"
mobiclip_decoder_select="bswapdsp golomb"

View File

@@ -133,7 +133,6 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
ff_blockdsp_init(&s->bdsp);
ff_hpeldsp_init(&s->hdsp, avctx->flags);
init_idct(avctx);
s->buffer_size = 0;
s->buffer = NULL;

View File

@@ -28,6 +28,7 @@
#include "libavutil/mem.h"
#include "codec_internal.h"
#include "decode.h"
#include "hpeldsp.h"
#include "mjpeg.h"
#include "mjpegdec.h"
@@ -65,6 +66,8 @@ static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
{
MXpegDecodeContext *s = avctx->priv_data;
ff_hpeldsp_init(&s->jpg.hdsp, avctx->flags);
s->picture[0] = av_frame_alloc();
s->picture[1] = av_frame_alloc();
if (!s->picture[0] || !s->picture[1])