void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx)

{

    int mm_flags = av_get_cpu_flags();



    if (mm_flags & AV_CPU_FLAG_MMX) {

#if HAVE_INLINE_ASM

        const int idct_algo = avctx->idct_algo;



        if (avctx->bits_per_raw_sample <= 8) {

            if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) {

                c->idct_put              = ff_simple_idct_put_mmx;

                c->idct_add              = ff_simple_idct_add_mmx;

                c->idct                  = ff_simple_idct_mmx;

                c->idct_permutation_type = FF_SIMPLE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_CAVS) {

                    c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_XVIDMMX) {

                if (mm_flags & AV_CPU_FLAG_SSE2) {

                    c->idct_put              = ff_idct_xvid_sse2_put;

                    c->idct_add              = ff_idct_xvid_sse2_add;

                    c->idct                  = ff_idct_xvid_sse2;

                    c->idct_permutation_type = FF_SSE2_IDCT_PERM;

                } else if (mm_flags & AV_CPU_FLAG_MMXEXT) {

                    c->idct_put              = ff_idct_xvid_mmx2_put;

                    c->idct_add              = ff_idct_xvid_mmx2_add;

                    c->idct                  = ff_idct_xvid_mmx2;

                } else {

                    c->idct_put              = ff_idct_xvid_mmx_put;

                    c->idct_add              = ff_idct_xvid_mmx_add;

                    c->idct                  = ff_idct_xvid_mmx;

                }

            }

        }

#endif /* HAVE_INLINE_ASM */



        dsputil_init_mmx(c, avctx, mm_flags);

    }



    if (mm_flags & AV_CPU_FLAG_MMXEXT)

        dsputil_init_mmx2(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW)

        dsputil_init_3dnow(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT)

        dsputil_init_3dnowext(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE)

        dsputil_init_sse(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE2)

        dsputil_init_sse2(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSSE3)

        dsputil_init_ssse3(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE4 && HAVE_SSE)

        dsputil_init_sse4(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_AVX)

        dsputil_init_avx(c, avctx, mm_flags);



    if (CONFIG_ENCODERS)

        ff_dsputilenc_init_mmx(c, avctx);

}

void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx)

{

    int mm_flags = av_get_cpu_flags();



    if (mm_flags & AV_CPU_FLAG_MMX) {

#if HAVE_INLINE_ASM

        const int idct_algo = avctx->idct_algo;



        if (avctx->bits_per_raw_sample <= 8) {

            if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) {

                c->idct_put              = ff_simple_idct_put_mmx;

                c->idct_add              = ff_simple_idct_add_mmx;

                c->idct                  = ff_simple_idct_mmx;

                c->idct_permutation_type = FF_SIMPLE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_CAVS) {

                    c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_XVIDMMX) {

                if (mm_flags & AV_CPU_FLAG_SSE2) {

                    c->idct_put              = ff_idct_xvid_sse2_put;

                    c->idct_add              = ff_idct_xvid_sse2_add;

                    c->idct                  = ff_idct_xvid_sse2;

                    c->idct_permutation_type = FF_SSE2_IDCT_PERM;

                } else if (mm_flags & AV_CPU_FLAG_MMXEXT) {

                    c->idct_put              = ff_idct_xvid_mmx2_put;

                    c->idct_add              = ff_idct_xvid_mmx2_add;

                    c->idct                  = ff_idct_xvid_mmx2;

                } else {

                    c->idct_put              = ff_idct_xvid_mmx_put;

                    c->idct_add              = ff_idct_xvid_mmx_add;

                    c->idct                  = ff_idct_xvid_mmx;

                }

            }

        }

#endif 



        dsputil_init_mmx(c, avctx, mm_flags);

    }



    if (mm_flags & AV_CPU_FLAG_MMXEXT)

        dsputil_init_mmx2(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW)

        dsputil_init_3dnow(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT)

        dsputil_init_3dnowext(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE)

        dsputil_init_sse(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE2)

        dsputil_init_sse2(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSSE3)

        dsputil_init_ssse3(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_SSE4 && HAVE_SSE)

        dsputil_init_sse4(c, avctx, mm_flags);



    if (mm_flags & AV_CPU_FLAG_AVX)

        dsputil_init_avx(c, avctx, mm_flags);



    if (CONFIG_ENCODERS)

        ff_dsputilenc_init_mmx(c, avctx);

}

void FUNC_0(DSPContext *VAR_0, AVCodecContext *VAR_1)

{

    int VAR_2 = av_get_cpu_flags();



    if (VAR_2 & AV_CPU_FLAG_MMX) {

#if HAVE_INLINE_ASM

        const int idct_algo = VAR_1->idct_algo;



        if (VAR_1->bits_per_raw_sample <= 8) {

            if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) {

                VAR_0->idct_put              = ff_simple_idct_put_mmx;

                VAR_0->idct_add              = ff_simple_idct_add_mmx;

                VAR_0->idct                  = ff_simple_idct_mmx;

                VAR_0->idct_permutation_type = FF_SIMPLE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_CAVS) {

                    VAR_0->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;

            } else if (idct_algo == FF_IDCT_XVIDMMX) {

                if (VAR_2 & AV_CPU_FLAG_SSE2) {

                    VAR_0->idct_put              = ff_idct_xvid_sse2_put;

                    VAR_0->idct_add              = ff_idct_xvid_sse2_add;

                    VAR_0->idct                  = ff_idct_xvid_sse2;

                    VAR_0->idct_permutation_type = FF_SSE2_IDCT_PERM;

                } else if (VAR_2 & AV_CPU_FLAG_MMXEXT) {

                    VAR_0->idct_put              = ff_idct_xvid_mmx2_put;

                    VAR_0->idct_add              = ff_idct_xvid_mmx2_add;

                    VAR_0->idct                  = ff_idct_xvid_mmx2;

                } else {

                    VAR_0->idct_put              = ff_idct_xvid_mmx_put;

                    VAR_0->idct_add              = ff_idct_xvid_mmx_add;

                    VAR_0->idct                  = ff_idct_xvid_mmx;

                }

            }

        }

#endif 



        dsputil_init_mmx(VAR_0, VAR_1, VAR_2);

    }



    if (VAR_2 & AV_CPU_FLAG_MMXEXT)

        dsputil_init_mmx2(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW)

        dsputil_init_3dnow(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT)

        dsputil_init_3dnowext(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_SSE && HAVE_SSE)

        dsputil_init_sse(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_SSE2)

        dsputil_init_sse2(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_SSSE3)

        dsputil_init_ssse3(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_SSE4 && HAVE_SSE)

        dsputil_init_sse4(VAR_0, VAR_1, VAR_2);



    if (VAR_2 & AV_CPU_FLAG_AVX)

        dsputil_init_avx(VAR_0, VAR_1, VAR_2);



    if (CONFIG_ENCODERS)

        ff_dsputilenc_init_mmx(VAR_0, VAR_1);

}

void FUNC_0(DSPContext *VAR_0, AVCodecContext *VAR_1)
{ int VAR_2 = av_get_cpu_flags(); if (VAR_2 & AV_CPU_FLAG_MMX) { #if HAVE_INLINE_ASM
const int idct_algo = VAR_1->idct_algo; if (VAR_1->bits_per_raw_sample <= 8) { if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) { VAR_0->idct_put              = ff_simple_idct_put_mmx; VAR_0->idct_add              = ff_simple_idct_add_mmx; VAR_0->idct                  = ff_simple_idct_mmx; VAR_0->idct_permutation_type = FF_SIMPLE_IDCT_PERM; } else if (idct_algo == FF_IDCT_CAVS) { VAR_0->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; } else if (idct_algo == FF_IDCT_XVIDMMX) { if (VAR_2 & AV_CPU_FLAG_SSE2) { VAR_0->idct_put              = ff_idct_xvid_sse2_put; VAR_0->idct_add              = ff_idct_xvid_sse2_add; VAR_0->idct                  = ff_idct_xvid_sse2; VAR_0->idct_permutation_type = FF_SSE2_IDCT_PERM; } else if (VAR_2 & AV_CPU_FLAG_MMXEXT) { VAR_0->idct_put              = ff_idct_xvid_mmx2_put; VAR_0->idct_add              = ff_idct_xvid_mmx2_add; VAR_0->idct                  = ff_idct_xvid_mmx2; } else { VAR_0->idct_put              = ff_idct_xvid_mmx_put; VAR_0->idct_add              = ff_idct_xvid_mmx_add; VAR_0->idct                  = ff_idct_xvid_mmx; } } } #endif
dsputil_init_mmx(VAR_0, VAR_1, VAR_2); } if (VAR_2 & AV_CPU_FLAG_MMXEXT)
dsputil_init_mmx2(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW)
dsputil_init_3dnow(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT)
dsputil_init_3dnowext(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_SSE && HAVE_SSE)
dsputil_init_sse(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_SSE2)
dsputil_init_sse2(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_SSSE3)
dsputil_init_ssse3(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_SSE4 && HAVE_SSE)
dsputil_init_sse4(VAR_0, VAR_1, VAR_2); if (VAR_2 & AV_CPU_FLAG_AVX)
dsputil_init_avx(VAR_0, VAR_1, VAR_2); if (CONFIG_ENCODERS)
ff_dsputilenc_init_mmx(VAR_0, VAR_1); }