av_cold void swri_resample_dsp_x86_init(ResampleContext *c) { int av_unused mm_flags = av_get_cpu_flags(); switch(c->format){ case AV_SAMPLE_FMT_S16P: if (ARCH_X86_32 && EXTERNAL_MMXEXT(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_mmxext : ff_resample_common_int16_mmxext; } if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_sse2 : ff_resample_common_int16_sse2; } if (EXTERNAL_XOP(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_xop : ff_resample_common_int16_xop; } break; case AV_SAMPLE_FMT_FLTP: if (EXTERNAL_SSE(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_sse : ff_resample_common_float_sse; } if (EXTERNAL_AVX_FAST(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_avx : ff_resample_common_float_avx; } if (EXTERNAL_FMA3(mm_flags) && !(mm_flags & AV_CPU_FLAG_AVXSLOW)) { c->dsp.resample = c->linear ? ff_resample_linear_float_fma3 : ff_resample_common_float_fma3; } if (EXTERNAL_FMA4(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_fma4 : ff_resample_common_float_fma4; } break; case AV_SAMPLE_FMT_DBLP: if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_double_sse2 : ff_resample_common_double_sse2; } break; } }
av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) { int cpu_flags = av_get_cpu_flags(); #if (HAVE_AMD3DNOWEXT_EXTERNAL == 1) if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) { fdsp->vector_fmul_window = ff_vector_fmul_window_3dnowext; } #endif #if (HAVE_SSE_EXTERNAL == 1) if (EXTERNAL_SSE(cpu_flags)) { fdsp->vector_fmul = ff_vector_fmul_sse; fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse; fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_sse; fdsp->vector_fmul_window = ff_vector_fmul_window_sse; fdsp->vector_fmul_add = ff_vector_fmul_add_sse; fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_sse; fdsp->scalarproduct_float = ff_scalarproduct_float_sse; fdsp->butterflies_float = ff_butterflies_float_sse; } #endif #if (HAVE_SSE2_EXTERNAL == 1) if (EXTERNAL_SSE2(cpu_flags)) { fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_sse2; } #endif #if (HAVE_AVX_EXTERNAL == 1) if (EXTERNAL_AVX(cpu_flags)) { fdsp->vector_fmul = ff_vector_fmul_avx; fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx; fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_avx; fdsp->vector_fmul_add = ff_vector_fmul_add_avx; fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx; } #endif #if (HAVE_FMA3_EXTERNAL == 1) if (EXTERNAL_FMA3(cpu_flags)) { fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_fma3; fdsp->vector_fmul_add = ff_vector_fmul_add_fma3; } #endif }
av_cold void ff_synth_filter_init_x86(SynthFilterContext *s) { #if HAVE_YASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_32 if (EXTERNAL_SSE(cpu_flags)) { s->synth_filter_float = synth_filter_sse; } #endif if (EXTERNAL_SSE2(cpu_flags)) { s->synth_filter_float = synth_filter_sse2; } if (EXTERNAL_AVX(cpu_flags)) { s->synth_filter_float = synth_filter_avx; } if (EXTERNAL_FMA3(cpu_flags)) { s->synth_filter_float = synth_filter_fma3; } #endif /* HAVE_YASM */ }
av_cold void ff_dcadsp_init_x86(DCADSPContext *s) { int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { #if ARCH_X86_32 s->decode_hf = ff_decode_hf_sse; #endif s->lfe_fir[0] = ff_dca_lfe_fir0_sse; s->lfe_fir[1] = ff_dca_lfe_fir1_sse; } if (EXTERNAL_SSE2(cpu_flags)) { s->decode_hf = ff_decode_hf_sse2; } if (EXTERNAL_SSE4(cpu_flags)) { s->decode_hf = ff_decode_hf_sse4; } if (EXTERNAL_FMA3(cpu_flags)) { s->lfe_fir[0] = ff_dca_lfe_fir0_fma3; } }
void swri_resample_dsp_x86_init(ResampleContext *c) { int av_unused mm_flags = av_get_cpu_flags(); switch(c->format){ case AV_SAMPLE_FMT_S16P: #if (ARCH_X86_32 == 1) && (HAVE_MMXEXT_EXTERNAL == 1) if (ARCH_X86_32 && EXTERNAL_MMXEXT(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_mmxext : ff_resample_common_int16_mmxext; } #endif #if (HAVE_SSE2_EXTERNAL == 1) if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_sse2 : ff_resample_common_int16_sse2; } #endif #if (HAVE_XOP_EXTERNAL == 1) if (EXTERNAL_XOP(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_int16_xop : ff_resample_common_int16_xop; } #endif break; case AV_SAMPLE_FMT_FLTP: #if (HAVE_SSE_EXTERNAL == 1) if (EXTERNAL_SSE(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_sse : ff_resample_common_float_sse; } #endif #if (HAVE_AVX_EXTERNAL == 1) if (EXTERNAL_AVX(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_avx : ff_resample_common_float_avx; } #endif #if (HAVE_FMA3_EXTERNAL == 1) if (EXTERNAL_FMA3(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_fma3 : ff_resample_common_float_fma3; } #endif #if (HAVE_FMA4_EXTERNAL == 1) if (EXTERNAL_FMA4(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_float_fma4 : ff_resample_common_float_fma4; } #endif break; case AV_SAMPLE_FMT_DBLP: #if (HAVE_SSE2_EXTERNAL == 1) if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample = c->linear ? ff_resample_linear_double_sse2 : ff_resample_common_double_sse2; } #endif break; } }