av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c) { #if HAVE_ALTIVEC && HAVE_BIGENDIAN if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec; c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec; c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec; c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec; c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec; c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec; c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec; c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec; c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec; c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec; c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec; c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec; c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec; c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec; c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec; c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec; c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec; c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec; c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec; c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec; #endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */ }
av_cold void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth) { #if HAVE_ALTIVEC const int high_bit_depth = bit_depth > 8; if (!PPC_ALTIVEC(av_get_cpu_flags())) return; if (!high_bit_depth) { #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \ c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \ c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \ c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \ c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \ c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \ c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \ c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \ c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \ c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \ c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \ c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \ c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \ c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \ c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \ c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec dspfunc(put_h264_qpel, 0, 16); dspfunc(avg_h264_qpel, 0, 16); #undef dspfunc } #endif /* HAVE_ALTIVEC */ }
av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->add_bytes = add_bytes_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_audiodsp_init_ppc(AudioDSPContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->scalarproduct_int16 = scalarproduct_int16_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->idct_put = vp3_idct_put_altivec; c->idct_add = vp3_idct_add_altivec; #endif }
av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, AVCodecContext *avctx) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->pix_norm1 = pix_norm1_altivec; c->pix_sum = pix_sum_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec; dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec; dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec; dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_mdct_init_ppc(FFTContext *s) { #if HAVE_GNU_AS && HAVE_ALTIVEC && HAVE_BIGENDIAN if (!PPC_ALTIVEC(av_get_cpu_flags())) return; if (s->mdct_bits >= 5) { s->imdct_calc = imdct_calc_altivec; s->imdct_half = imdct_half_altivec; } #endif /* HAVE_GNU_AS && HAVE_ALTIVEC && HAVE_BIGENDIAN */ }
av_cold void ff_mpv_common_init_ppc(MpegEncContext *s) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; if ((s->avctx->dct_algo == FF_DCT_AUTO) || (s->avctx->dct_algo == FF_DCT_ALTIVEC)) { s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec; s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec; } #endif /* HAVE_ALTIVEC */ }
av_cold void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; if (!high_bit_depth) { if (avctx->dct_algo == FF_DCT_AUTO || avctx->dct_algo == FF_DCT_ALTIVEC) { c->fdct = ff_fdct_altivec; } } #endif /* HAVE_ALTIVEC */ }
av_cold void ff_fft_init_ppc(FFTContext *s) { #if HAVE_GNU_AS && HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; #if HAVE_VSX s->fft_calc = ff_fft_calc_interleave_vsx; #else s->fft_calc = ff_fft_calc_interleave_altivec; #endif if (s->mdct_bits >= 5) { s->imdct_calc = imdct_calc_altivec; s->imdct_half = imdct_half_altivec; } #endif /* HAVE_GNU_AS && HAVE_ALTIVEC && HAVE_BIGENDIAN */ }
av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { #if HAVE_ALTIVEC if (PPC_ALTIVEC(av_get_cpu_flags())) { if (!high_bit_depth && avctx->lowres == 0) { if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & CODEC_FLAG_BITEXACT)) || (avctx->idct_algo == FF_IDCT_ALTIVEC)) { c->idct = idct_altivec; c->idct_add = idct_add_altivec; c->idct_put = idct_put_altivec; c->perm_type = FF_IDCT_PERM_TRANSPOSE; } } } #endif /* HAVE_ALTIVEC */ }
av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) return; if (!high_bit_depth) { if ((avctx->idct_algo == FF_IDCT_AUTO) || (avctx->idct_algo == FF_IDCT_ALTIVEC)) { c->idct_add = idct_add_altivec; c->idct_put = idct_put_altivec; c->perm_type = FF_IDCT_PERM_TRANSPOSE; } } #endif /* HAVE_ALTIVEC */ }
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; } } } }
av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags) { #if HAVE_ALTIVEC && HAVE_BIGENDIAN if (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec; c->avg_pixels_tab[1][0] = avg_pixels8_altivec; c->avg_pixels_tab[1][3] = avg_pixels8_xy2_altivec; c->put_pixels_tab[0][0] = ff_put_pixels16_altivec; c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec; c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec; c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_altivec; c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec; c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c) { // common optimizations whether AltiVec is available or not 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 (!PPC_ALTIVEC(av_get_cpu_flags())) return; c->clear_block = clear_block_altivec; #endif /* HAVE_ALTIVEC */ }
av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx) { if (PPC_ALTIVEC(av_get_cpu_flags())) { ff_dsputil_init_altivec(c, avctx); } }