From e80bd068c5196399161db970ec5cf989bd479859 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 4 May 2024 15:40:55 +0200 Subject: [PATCH] avcodec/mpegvideo_enc: Always set c funcs in ff_dct_encode_init() Use the common approach whereby the _c versions are set first and then (potentially) overwritten by the arch-specific ones instead of calling the arch-specific code first, followed by setting the function pointers that have not already been set. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index c84662bdef..76243c160b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -293,16 +293,15 @@ static void mpv_encode_defaults(MpegEncContext *s) av_cold int ff_dct_encode_init(MpegEncContext *s) { + s->dct_quantize = dct_quantize_c; + s->denoise_dct = denoise_dct_c; + #if ARCH_MIPS ff_mpvenc_dct_init_mips(s); #elif ARCH_X86 ff_dct_encode_init_x86(s); #endif - if (!s->dct_quantize) - s->dct_quantize = dct_quantize_c; - if (!s->denoise_dct) - s->denoise_dct = denoise_dct_c; s->fast_dct_quantize = s->dct_quantize; if (s->avctx->trellis) s->dct_quantize = dct_quantize_trellis_c;