mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
x86: avcodec: Consistently structure CPU extension initialization
This commit is contained in:
parent
6369ba3c9c
commit
e998b56362
@ -997,6 +997,7 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
|
||||
c->add_8x8basis= add_8x8basis_mmx;
|
||||
|
||||
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
|
||||
}
|
||||
|
||||
if (INLINE_MMXEXT(cpu_flags)) {
|
||||
c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
|
||||
@ -1029,12 +1030,12 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
|
||||
}
|
||||
c->add_8x8basis = add_8x8basis_3dnow;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
if (EXTERNAL_MMX(cpu_flags)) {
|
||||
c->hadamard8_diff[0] = ff_hadamard8_diff16_mmx;
|
||||
c->hadamard8_diff[1] = ff_hadamard8_diff_mmx;
|
||||
}
|
||||
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
c->hadamard8_diff[0] = ff_hadamard8_diff16_mmxext;
|
||||
@ -1054,7 +1055,6 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
|
||||
c->hadamard8_diff[0] = ff_hadamard8_diff16_ssse3;
|
||||
c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
|
||||
}
|
||||
}
|
||||
|
||||
ff_dsputil_init_pix_mmx(c, avctx);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx
|
||||
|
||||
if (EXTERNAL_MMX(cpu_flags)) {
|
||||
c->float_interleave = float_interleave_mmx;
|
||||
|
||||
}
|
||||
if (EXTERNAL_AMD3DNOW(cpu_flags)) {
|
||||
if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
|
||||
c->float_to_int16 = ff_float_to_int16_3dnow;
|
||||
@ -143,6 +143,5 @@ av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx
|
||||
c->float_to_int16 = ff_float_to_int16_sse2;
|
||||
c->float_to_int16_interleave = float_to_int16_interleave_sse2;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_YASM */
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
|
||||
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmx;
|
||||
if (cpu_flags & AV_CPU_FLAG_CMOV)
|
||||
c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_mmx;
|
||||
|
||||
}
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmxext;
|
||||
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
|
||||
@ -259,7 +259,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
|
||||
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_mmxext;
|
||||
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_mmxext;
|
||||
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
|
||||
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
c->h264_idct8_add = ff_h264_idct8_add_8_sse2;
|
||||
|
||||
@ -291,10 +291,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
|
||||
c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
|
||||
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (bit_depth == 10) {
|
||||
if (EXTERNAL_MMX(cpu_flags)) {
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
#if ARCH_X86_32
|
||||
c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_mmxext;
|
||||
@ -305,6 +302,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
|
||||
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_mmxext;
|
||||
#endif /* ARCH_X86_32 */
|
||||
c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
c->h264_idct_add = ff_h264_idct_add_10_sse2;
|
||||
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
|
||||
@ -369,5 +367,3 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -249,16 +249,20 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
|
||||
#endif /* HAVE_SSE2_INLINE */
|
||||
|
||||
#if HAVE_YASM
|
||||
if (EXTERNAL_SSE(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse;
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse2;
|
||||
}
|
||||
if (EXTERNAL_SSE3(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse3;
|
||||
}
|
||||
if (EXTERNAL_SSSE3(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_ssse3;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_avx;
|
||||
} else if (EXTERNAL_SSSE3(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_ssse3;
|
||||
} else if (EXTERNAL_SSE3(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse3;
|
||||
} else if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse2;
|
||||
} else if (EXTERNAL_SSE(cpu_flags)) {
|
||||
s->imdct36_blocks_float = imdct36_blocks_sse;
|
||||
}
|
||||
#endif /* HAVE_YASM */
|
||||
}
|
||||
|
@ -568,11 +568,10 @@ av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
||||
if(!(s->flags & CODEC_FLAG_BITEXACT))
|
||||
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
|
||||
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
|
||||
if (INLINE_SSE2(cpu_flags)) {
|
||||
s->denoise_dct= denoise_dct_sse2;
|
||||
} else {
|
||||
s->denoise_dct = denoise_dct_mmx;
|
||||
}
|
||||
if (INLINE_SSE2(cpu_flags)) {
|
||||
s->denoise_dct = denoise_dct_sse2;
|
||||
}
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -230,6 +230,13 @@ av_cold void ff_rv40dsp_init_x86(RV34DSPContext *c)
|
||||
c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_mmx;
|
||||
#if ARCH_X86_32
|
||||
QPEL_MC_SET(put_, _mmx)
|
||||
#endif
|
||||
}
|
||||
if (EXTERNAL_AMD3DNOW(cpu_flags)) {
|
||||
c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_3dnow;
|
||||
c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
|
||||
#if ARCH_X86_32
|
||||
QPEL_MC_SET(avg_, _3dnow)
|
||||
#endif
|
||||
}
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
@ -241,12 +248,6 @@ av_cold void ff_rv40dsp_init_x86(RV34DSPContext *c)
|
||||
c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_mmxext;
|
||||
#if ARCH_X86_32
|
||||
QPEL_MC_SET(avg_, _mmxext)
|
||||
#endif
|
||||
} else if (EXTERNAL_AMD3DNOW(cpu_flags)) {
|
||||
c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_3dnow;
|
||||
c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
|
||||
#if ARCH_X86_32
|
||||
QPEL_MC_SET(avg_, _3dnow)
|
||||
#endif
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
|
@ -103,13 +103,14 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
|
||||
if (EXTERNAL_MMX(cpu_flags)) {
|
||||
dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_mmx;
|
||||
}
|
||||
if (EXTERNAL_AMD3DNOW(cpu_flags)) {
|
||||
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
|
||||
}
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
ASSIGN_LF(mmxext);
|
||||
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
|
||||
|
||||
dsp->avg_vc1_mspel_pixels_tab[0] = avg_vc1_mspel_mc00_mmxext;
|
||||
} else if (EXTERNAL_AMD3DNOW(cpu_flags)) {
|
||||
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2;
|
||||
|
Loading…
Reference in New Issue
Block a user