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.
Unified · Split
| @@ -293,16 +293,15 @@ static void mpv_encode_defaults(MpegEncContext *s) · 292 unmodified lines | |||
| 293 | 293 | ||
| 294 | av_cold int ff_dct_encode_init(MpegEncContext *s) | 294 | av_cold int ff_dct_encode_init(MpegEncContext *s) |
| 295 | { | 295 | { |
| 296 | s->dct_quantize = dct_quantize_c; | ||
| 297 | s->denoise_dct = denoise_dct_c; | ||
| 298 | |||
| 296 | #if ARCH_MIPS | 299 | #if ARCH_MIPS |
| 297 | ff_mpvenc_dct_init_mips(s); | 300 | ff_mpvenc_dct_init_mips(s); |
| 298 | #elif ARCH_X86 | 301 | #elif ARCH_X86 |
| 299 | ff_dct_encode_init_x86(s); | 302 | ff_dct_encode_init_x86(s); |
| 300 | #endif | 303 | #endif |
| 301 | 304 | ||
| 302 | if (!s->dct_quantize) | ||
| 303 | s->dct_quantize = dct_quantize_c; | ||
| 304 | if (!s->denoise_dct) | ||
| 305 | s->denoise_dct = denoise_dct_c; | ||
| 306 | s->fast_dct_quantize = s->dct_quantize; | 305 | s->fast_dct_quantize = s->dct_quantize; |
| 307 | if (s->avctx->trellis) | 306 | if (s->avctx->trellis) |
| 308 | s->dct_quantize = dct_quantize_trellis_c; | 307 | s->dct_quantize = dct_quantize_trellis_c; |