diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-21 01:06:01 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-21 01:06:01 +0400 |
commit | ba85bfabf3a1b762b3e07f53d404f4c7c4e1703a (patch) | |
tree | 3361491c371b328f0fb81231ab80e431d0ef986d /libavcodec/ppc | |
parent | a87188ebdb8307fb4733e04d482a3ae617bd9da4 (diff) | |
parent | 5169e688956be3378adb3b16a93962fe0048f1c9 (diff) |
Merge commit '5169e688956be3378adb3b16a93962fe0048f1c9'
* commit '5169e688956be3378adb3b16a93962fe0048f1c9':
dsputil: Propagate bit depth information to all (sub)init functions
Conflicts:
libavcodec/arm/dsputil_init_arm.c
libavcodec/arm/dsputil_init_armv5te.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/arm/dsputil_init_neon.c
libavcodec/dsputil.c
libavcodec/dsputil.h
libavcodec/ppc/dsputil_ppc.c
libavcodec/x86/dsputil_init.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.c | 5 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 3 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 21 |
3 files changed, 14 insertions, 15 deletions
diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index 36e530c3f4..eb8e5703c6 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -926,10 +926,9 @@ static int hadamard8_diff16_altivec(/* MpegEncContext */ void *s, uint8_t *dst, return score; } -av_cold void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx) +av_cold void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) { - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - c->pix_abs[0][1] = sad16_x2_altivec; c->pix_abs[0][2] = sad16_y2_altivec; c->pix_abs[0][3] = sad16_xy2_altivec; diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h index 8d8a7a2804..dc4da0b388 100644 --- a/libavcodec/ppc/dsputil_altivec.h +++ b/libavcodec/ppc/dsputil_altivec.h @@ -38,7 +38,8 @@ void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); -void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx); +void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx); #endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */ diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index e9a5423786..cbb1cfbcc8 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -125,11 +125,10 @@ 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; int mm_flags = av_get_cpu_flags(); - // common optimizations whether AltiVec is available or not if (!high_bit_depth) { switch (check_dcbzl_effect()) { @@ -145,25 +144,25 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx) } if (PPC_ALTIVEC(mm_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->lowres == 0 && avctx->bits_per_raw_sample <= 8) { + if (avctx->lowres == 0) { 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; } + } } } } |