summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/dsputil_ppc.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-12-30 12:09:03 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-20 05:03:23 -0700
commit5169e688956be3378adb3b16a93962fe0048f1c9 (patch)
tree5c76aaaa9cbc38575f3eb02269dd6704725882de /libavcodec/ppc/dsputil_ppc.c
parentcf7a2167570e6ccb9dfbd62e9d8ba8f4f065b17e (diff)
dsputil: Propagate bit depth information to all (sub)init functions
This avoids recalculating the value over and over again.
Diffstat (limited to 'libavcodec/ppc/dsputil_ppc.c')
-rw-r--r--libavcodec/ppc/dsputil_ppc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c
index 5dd3f2adc7..698f54562f 100644
--- a/libavcodec/ppc/dsputil_ppc.c
+++ b/libavcodec/ppc/dsputil_ppc.c
@@ -125,10 +125,9 @@ static long check_dcbzl_effect(void)
return count;
}
-av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
// common optimizations whether AltiVec is available or not
if (!high_bit_depth) {
switch (check_dcbzl_effect()) {
@@ -144,19 +143,17 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
}
if (PPC_ALTIVEC(av_get_cpu_flags())) {
- ff_dsputil_init_altivec(c, avctx);
+ ff_dsputil_init_altivec(c, avctx, high_bit_depth);
ff_int_init_altivec(c, avctx);
c->gmc1 = ff_gmc1_altivec;
+ if (!high_bit_depth) {
#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;
- }
+ if (avctx->dct_algo == FF_DCT_AUTO ||
+ avctx->dct_algo == FF_DCT_ALTIVEC) {
+ c->fdct = ff_fdct_altivec;
+ }
#endif //CONFIG_ENCODERS
-
- if (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;