示例#1
0
av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                   unsigned high_bit_depth)
{
    int cpu_flags = av_get_cpu_flags();

    if (high_bit_depth ||
        !(avctx->idct_algo == FF_IDCT_AUTO ||
          avctx->idct_algo == FF_IDCT_XVID))
        return;

    if (INLINE_MMX(cpu_flags)) {
        c->idct_put  = ff_xvid_idct_mmx_put;
        c->idct_add  = ff_xvid_idct_mmx_add;
        c->idct      = ff_xvid_idct_mmx;
        c->perm_type = FF_IDCT_PERM_NONE;
    }

    if (INLINE_MMXEXT(cpu_flags)) {
        c->idct_put  = ff_xvid_idct_mmxext_put;
        c->idct_add  = ff_xvid_idct_mmxext_add;
        c->idct      = ff_xvid_idct_mmxext;
        c->perm_type = FF_IDCT_PERM_NONE;
    }

    if (INLINE_SSE2(cpu_flags)) {
        c->idct_put  = ff_xvid_idct_sse2_put;
        c->idct_add  = ff_xvid_idct_sse2_add;
        c->idct      = ff_xvid_idct_sse2;
        c->perm_type = FF_IDCT_PERM_SSE2;
    }
}
示例#2
0
文件: rgb2rgb.c 项目: Jheengut/libav
av_cold void rgb2rgb_init_x86(void)
{
#if HAVE_INLINE_ASM
    int cpu_flags = av_get_cpu_flags();

    if (INLINE_MMX(cpu_flags))
        rgb2rgb_init_mmx();
    if (INLINE_AMD3DNOW(cpu_flags))
        rgb2rgb_init_3dnow();
    if (INLINE_MMXEXT(cpu_flags))
        rgb2rgb_init_mmxext();
    if (INLINE_SSE2(cpu_flags))
        rgb2rgb_init_sse2();
#endif /* HAVE_INLINE_ASM */
}
示例#3
0
av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
                                 unsigned high_bit_depth)
{
    int cpu_flags = av_get_cpu_flags();
    const int dct_algo = avctx->dct_algo;

    if (!high_bit_depth) {
        if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
            if (INLINE_MMX(cpu_flags))
                c->fdct = ff_fdct_mmx;

            if (INLINE_MMXEXT(cpu_flags))
                c->fdct = ff_fdct_mmxext;

            if (INLINE_SSE2(cpu_flags))
                c->fdct = ff_fdct_sse2;
        }
    }
}
示例#4
0
av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
{
    const int dct_algo = s->avctx->dct_algo;

    if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
#if HAVE_MMX_INLINE
        int mm_flags = av_get_cpu_flags();
        if (INLINE_MMX(mm_flags))
            s->dct_quantize = dct_quantize_MMX;
#endif
#if HAVE_MMXEXT_INLINE
        if (INLINE_MMXEXT(mm_flags))
            s->dct_quantize = dct_quantize_MMXEXT;
#endif
#if HAVE_SSE2_INLINE
        if (INLINE_SSE2(mm_flags))
            s->dct_quantize = dct_quantize_SSE2;
#endif
#if HAVE_SSSE3_INLINE
        if (INLINE_SSSE3(mm_flags))
            s->dct_quantize = dct_quantize_SSSE3;
#endif
    }
}