1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/mips/aaccoder_mips: Remove MIPS-specific aaccoder

ff_aac_coder_init_mips() modifies a static const structure of
function pointers. This will crash if the binary uses relro
and is a data race in any case.

Furthermore it points to a maintainability issue: The
AACCoefficientsEncoder structures have been constified
in commit fd9212f2ed,
a Libav commit merged in 318778de9e.
Libav did not have the MIPS-specific AAC code and so this was
fine for them; yet FFmpeg had them, but this was not recognized.

Commit 75a099fc73 points to another
maintainability issue: Contrary to ordinary DSP code, this code
here is way more complex and needs to be constantly kept in sync
with the ordinary code which it mimicks and replaces. Said commit
is the only commit actually changing aaccoder.c in the last few
years and the same change has not been performed for the MIPS
clone; before that, it even happened several times that the mips
code was broken due to changes of the generic code (see commits
97437bd17a and
de262d018d or
860dbe0275 or
933309a6ca or
b65ffa316e). This might even lead
to scenarios where someone changing non-dsp aacenc code would
have to modify mips inline asm in order to keep them in sync.
This is obviously a significant burden (if the AAC encoder were
actively developed).

Finally, the code does not even compile here due to errors like
"Error: float register should be even, was 1".

Reviewed-by: Lynne <dev@lynne.ee>
Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-03-15 01:29:55 +01:00
parent e6c7a88b34
commit f1b08b8a65
4 changed files with 0 additions and 2509 deletions

View File

@ -1383,10 +1383,6 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
ff_aacenc_dsp_init(&s->aacdsp); ff_aacenc_dsp_init(&s->aacdsp);
#if HAVE_MIPSDSP
ff_aac_coder_init_mips(s);
#endif
ff_af_queue_init(avctx, &s->afq); ff_af_queue_init(avctx, &s->afq);
return 0; return 0;

View File

@ -241,7 +241,6 @@ typedef struct AACEncContext {
} buffer; } buffer;
} AACEncContext; } AACEncContext;
void ff_aac_coder_init_mips(AACEncContext *c);
void ff_quantize_band_cost_cache_init(struct AACEncContext *s); void ff_quantize_band_cost_cache_init(struct AACEncContext *s);

View File

@ -19,7 +19,6 @@ OBJS-$(CONFIG_AAC_DECODER) += mips/aacdec_mips.o \
mips/aacsbr_mips.o \ mips/aacsbr_mips.o \
mips/sbrdsp_mips.o \ mips/sbrdsp_mips.o \
mips/aacpsdsp_mips.o mips/aacpsdsp_mips.o
MIPSDSP-OBJS-$(CONFIG_AAC_ENCODER) += mips/aaccoder_mips.o
MIPSFPU-OBJS-$(CONFIG_AAC_ENCODER) += mips/iirfilter_mips.o MIPSFPU-OBJS-$(CONFIG_AAC_ENCODER) += mips/iirfilter_mips.o
OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o \ OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o \
mips/hevcpred_init_mips.o mips/hevcpred_init_mips.o

File diff suppressed because it is too large Load Diff