Пример #1
0
av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
{
#if HAVE_YASM
    int cpu_flags = av_get_cpu_flags();

    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;
            c->float_to_int16_interleave = float_to_int16_interleave_3dnow;
        }
    }
    if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
            c->float_to_int16_interleave = float_to_int16_interleave_3dnowext;
        }
    }
    if (EXTERNAL_SSE(cpu_flags)) {
        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
        c->float_to_int16             = ff_float_to_int16_sse;
        c->float_to_int16_interleave  = float_to_int16_interleave_sse;
        c->float_interleave           = float_interleave_sse;
    }
    if (EXTERNAL_SSE2(cpu_flags)) {
        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
        c->float_to_int16             = ff_float_to_int16_sse2;
        c->float_to_int16_interleave  = float_to_int16_interleave_sse2;
    }
#endif /* HAVE_YASM */
}
Пример #2
0
av_cold void ff_fft_init_x86(FFTContext *s)
{
  int cpu_flags = av_get_cpu_flags();

#if ARCH_X86_32
  if (EXTERNAL_AMD3DNOW(cpu_flags)) {
    /* 3DNow! for K6-2/3 */
    s->imdct_calc = ff_imdct_calc_3dnow;
    s->imdct_half = ff_imdct_half_3dnow;
    s->fft_calc   = ff_fft_calc_3dnow;
  }
  if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
    /* 3DNowEx for K7 */
    s->imdct_calc = ff_imdct_calc_3dnowext;
    s->imdct_half = ff_imdct_half_3dnowext;
    s->fft_calc   = ff_fft_calc_3dnowext;
  }
#endif
  if (EXTERNAL_SSE(cpu_flags)) {
    /* SSE for P3/P4/K8 */
    s->imdct_calc  = ff_imdct_calc_sse;
    s->imdct_half  = ff_imdct_half_sse;
    s->fft_permute = ff_fft_permute_sse;
    s->fft_calc    = ff_fft_calc_sse;
    s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
  }
  if (EXTERNAL_AVX(cpu_flags) && s->nbits >= 5) {
    /* AVX for SB */
    s->imdct_half      = ff_imdct_half_avx;
    s->fft_calc        = ff_fft_calc_avx;
    s->fft_permutation = FF_FFT_PERM_AVX;
  }
}
Пример #3
0
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
}