1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/libavcodec/mips
Andreas Rheinhardt b9c1ab8907 avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe
Commit 1af615683e put initializing
the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32)
behind an ff_thread_once() to make ff_fft_init() thread-safe; yet
there is a second place where said table may be initialized which
is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT
even for ordinary floating point FFTs, so that ff_fft_init() is not
thread-safe (on MIPS) for both 32bit fixed-point as well as
floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and
therefore initializing e.g. the AAC decoders is not thread-safe (on
MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set.

This commit fixes this by moving the AVOnce to fft_init_table.c and
using it to guard all initializations of ff_fft_offsets_lut.

(It is not that bad in practice, because every entry of
ff_fft_offsets_lut is never read during initialization and is only once
ever written to (namely to its final value); but even these are
conflicting actions which are (by definition) data races and lead to
undefined behaviour.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
..
aaccoder_mips.c
aacdec_mips.c avcodec/mips: Fix register constraint error reported by clang. 2020-07-30 00:23:45 +02:00
aacdec_mips.h
aacpsdsp_mips.c avcodec/mips: Fix segfault in imdct36_mips_float. 2020-07-30 00:23:45 +02:00
aacpsy_mips.h avcodec/mips: Fix segfault in imdct36_mips_float. 2020-07-30 00:23:45 +02:00
aacsbr_mips.c avcodec/mips: Fix register constraint error reported by clang. 2020-07-30 00:23:45 +02:00
aacsbr_mips.h
ac3dsp_mips.c
acelp_filters_mips.c
acelp_vectors_mips.c
amrwbdec_mips.c
amrwbdec_mips.h
blockdsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
blockdsp_mips.h
blockdsp_mmi.c
blockdsp_msa.c
cabac.h avcodec/mips/cabac: Fix a bug in get_cabac_inline_mips. 2020-07-30 00:23:45 +02:00
celp_filters_mips.c
celp_math_mips.c
compute_antialias_fixed.h
compute_antialias_float.h
constants.c
constants.h
fft_mips.c avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe 2020-11-24 11:35:03 +01:00
fmtconvert_mips.c
h263dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
h263dsp_mips.h
h263dsp_msa.c
h264chroma_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
h264chroma_mips.h
h264chroma_mmi.c
h264chroma_msa.c
h264dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
h264dsp_mips.h libavcodec: MIPS: MMI: Fix type mismatches 2020-07-23 17:21:58 +02:00
h264dsp_mmi.c libavcodec: MIPS: MMI: Move sp out of the clobber list 2020-07-23 17:21:58 +02:00
h264dsp_msa.c avcodec/mips: fix type mismatch in h264dsp_msa.c 2020-07-19 10:59:43 +02:00
h264idct_msa.c
h264pred_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
h264pred_mips.h
h264pred_mmi.c avcodec/mips: [loongson] Fixed mmi optimization 2020-09-10 23:31:10 +02:00
h264pred_msa.c
h264qpel_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
h264qpel_mmi.c
h264qpel_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
hevc_idct_msa.c
hevc_lpf_sao_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
hevc_macros_msa.h
hevc_mc_bi_msa.c
hevc_mc_biw_msa.c
hevc_mc_uni_msa.c
hevc_mc_uniw_msa.c
hevcdsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
hevcdsp_mips.h
hevcdsp_mmi.c
hevcdsp_msa.c
hevcpred_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
hevcpred_mips.h
hevcpred_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
hpeldsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
hpeldsp_mips.h
hpeldsp_mmi.c
hpeldsp_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
idctdsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
idctdsp_mips.h
idctdsp_mmi.c
idctdsp_msa.c
iirfilter_mips.c
lsp_mips.h
Makefile ffbuild: Refine MIPS handling 2020-07-23 16:30:02 +02:00
mathops.h
me_cmp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
me_cmp_mips.h
me_cmp_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
mpegaudiodsp_mips_fixed.c
mpegaudiodsp_mips_float.c avcodec/mips: Fix segfault in imdct36_mips_float. 2020-07-30 00:23:45 +02:00
mpegvideo_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
mpegvideo_mips.h
mpegvideo_mmi.c
mpegvideo_msa.c
mpegvideoencdsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
mpegvideoencdsp_msa.c
pixblockdsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
pixblockdsp_mips.h
pixblockdsp_mmi.c
pixblockdsp_msa.c
qpeldsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
qpeldsp_mips.h
qpeldsp_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
sbrdsp_mips.c avcodec/mips: Fix register constraint error reported by clang. 2020-07-30 00:23:45 +02:00
simple_idct_mmi.c
simple_idct_msa.c
vc1dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
vc1dsp_mips.h avcodec/mips: msa optimizations for vc1dsp 2019-10-30 18:09:00 +01:00
vc1dsp_mmi.c avcodec/mips: Fixed four warnings in vc1dsp 2019-10-14 00:48:44 +02:00
vc1dsp_msa.c avcodec/mips: msa optimizations for vc1dsp 2019-10-30 18:09:00 +01:00
videodsp_init.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
vp3dsp_idct_mmi.c
vp3dsp_idct_msa.c
vp3dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
vp3dsp_mips.h
vp8_idct_msa.c
vp8_lpf_msa.c
vp8_mc_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
vp8dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
vp8dsp_mips.h
vp8dsp_mmi.c
vp9_idct_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
vp9_intra_msa.c
vp9_lpf_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
vp9_mc_mmi.c
vp9_mc_msa.c avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros. 2019-09-16 00:04:18 +02:00
vp9dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
vp9dsp_mips.h
wmv2dsp_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
wmv2dsp_mips.h libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
wmv2dsp_mmi.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
xvid_idct_mmi.c libavcodec: MIPS: MMI: Fix type mismatches 2020-07-23 17:21:58 +02:00
xvididct_init_mips.c libavcodec: Enable runtime detection for MIPS MMI & MSA 2020-07-23 17:21:58 +02:00
xvididct_mips.h libavcodec: MIPS: MMI: Fix type mismatches 2020-07-23 17:21:58 +02:00