Пример #1
0
void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
{
    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
    int mm_flags = av_get_cpu_flags();

    if (avctx->dsp_mask) {
        if (avctx->dsp_mask & AV_CPU_FLAG_FORCE)
            mm_flags |= (avctx->dsp_mask & 0xffff);
        else
            mm_flags &= ~(avctx->dsp_mask & 0xffff);
    }

    // Common optimizations whether AltiVec is available or not
    if (!high_bit_depth) {
    switch (check_dcbzl_effect()) {
        case 32:
            c->clear_blocks = clear_blocks_dcbz32_ppc;
            break;
        case 128:
            c->clear_blocks = clear_blocks_dcbz128_ppc;
            break;
        default:
            break;
    }
    }

#if HAVE_ALTIVEC
    if(CONFIG_H264_DECODER) ff_dsputil_h264_init_ppc(c, avctx);

    if (mm_flags & AV_CPU_FLAG_ALTIVEC) {
        ff_dsputil_init_altivec(c, avctx);
        ff_int_init_altivec(c, avctx);
        c->gmc1 = ff_gmc1_altivec;

#if CONFIG_ENCODERS
        if (avctx->bits_per_raw_sample <= 8 &&
            (avctx->dct_algo == FF_DCT_AUTO ||
             avctx->dct_algo == FF_DCT_ALTIVEC)) {
            c->fdct = ff_fdct_altivec;
        }
#endif //CONFIG_ENCODERS

        if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
            if ((avctx->idct_algo == FF_IDCT_AUTO) ||
                (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
                c->idct_put = ff_idct_put_altivec;
                c->idct_add = ff_idct_add_altivec;
                c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
            }
        }

    }
#endif /* HAVE_ALTIVEC */
}
Пример #2
0
av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
{
    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
    int mm_flags = av_get_cpu_flags();

    // Common optimizations whether AltiVec is available or not
    if (!high_bit_depth) {
    switch (check_dcbzl_effect()) {
        case 32:
            c->clear_blocks = clear_blocks_dcbz32_ppc;
            break;
        case 128:
            c->clear_blocks = clear_blocks_dcbz128_ppc;
            break;
        default:
            break;
    }
    }

    if (PPC_ALTIVEC(mm_flags)) {
        ff_dsputil_init_altivec(c, avctx);
        ff_int_init_altivec(c, avctx);
        c->gmc1 = ff_gmc1_altivec;

#if CONFIG_ENCODERS
        if (avctx->bits_per_raw_sample <= 8 &&
            (avctx->dct_algo == FF_DCT_AUTO ||
             avctx->dct_algo == FF_DCT_ALTIVEC)) {
            c->fdct = ff_fdct_altivec;
        }
#endif //CONFIG_ENCODERS

        if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
            if ((avctx->idct_algo == FF_IDCT_AUTO) ||
                (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
                c->idct_put = ff_idct_put_altivec;
                c->idct_add = ff_idct_add_altivec;
                c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
            }
        }

    }
}
Пример #3
0
av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
{
    if (PPC_ALTIVEC(av_get_cpu_flags())) {
        ff_dsputil_init_altivec(c, avctx);
    }
}