diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-20 22:06:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-20 22:06:01 +0100 |
commit | ba85bfabf3a1b762b3e07f53d404f4c7c4e1703a (patch) | |
tree | 3361491c371b328f0fb81231ab80e431d0ef986d /libavcodec/x86/dsputil_init.c | |
parent | a87188ebdb8307fb4733e04d482a3ae617bd9da4 (diff) | |
parent | 5169e688956be3378adb3b16a93962fe0048f1c9 (diff) | |
download | ffmpeg-ba85bfabf3a1b762b3e07f53d404f4c7c4e1703a.tar.gz |
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/x86/dsputil_init.c')
-rw-r--r-- | libavcodec/x86/dsputil_init.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c index 4e518ad56d..8639383dd2 100644 --- a/libavcodec/x86/dsputil_init.c +++ b/libavcodec/x86/dsputil_init.c @@ -521,11 +521,9 @@ do { \ } while (0) static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_MMX_INLINE - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - c->put_pixels_clamped = ff_put_pixels_clamped_mmx; c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx; c->add_pixels_clamped = ff_add_pixels_clamped_mmx; @@ -549,11 +547,9 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, } static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_MMXEXT_INLINE - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) { c->idct_put = ff_idct_xvid_mmxext_put; c->idct_add = ff_idct_xvid_mmxext_add; @@ -580,11 +576,9 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx, } static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_SSE_INLINE - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - c->vector_clipf = ff_vector_clipf_sse; /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */ @@ -605,11 +599,9 @@ static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, } static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_SSE2_INLINE - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) { c->idct_put = ff_idct_xvid_sse2_put; c->idct_add = ff_idct_xvid_sse2_add; @@ -631,7 +623,7 @@ static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx, } static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_SSSE3_EXTERNAL c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_ssse3; @@ -645,14 +637,15 @@ static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, } static av_cold void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx, - int cpu_flags) + int cpu_flags, unsigned high_bit_depth) { #if HAVE_SSE4_EXTERNAL c->vector_clip_int32 = ff_vector_clip_int32_sse4; #endif /* HAVE_SSE4_EXTERNAL */ } -av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx) +av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) { int cpu_flags = av_get_cpu_flags(); @@ -665,7 +658,7 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx) #if HAVE_INLINE_ASM const int idct_algo = avctx->idct_algo; - if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) { + if (avctx->lowres == 0 && !high_bit_depth) { 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; @@ -679,24 +672,24 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx) } #endif /* HAVE_INLINE_ASM */ - dsputil_init_mmx(c, avctx, cpu_flags); + dsputil_init_mmx(c, avctx, cpu_flags, high_bit_depth); } if (X86_MMXEXT(cpu_flags)) - dsputil_init_mmxext(c, avctx, cpu_flags); + dsputil_init_mmxext(c, avctx, cpu_flags, high_bit_depth); if (X86_SSE(cpu_flags)) - dsputil_init_sse(c, avctx, cpu_flags); + dsputil_init_sse(c, avctx, cpu_flags, high_bit_depth); if (X86_SSE2(cpu_flags)) - dsputil_init_sse2(c, avctx, cpu_flags); + dsputil_init_sse2(c, avctx, cpu_flags, high_bit_depth); if (EXTERNAL_SSSE3(cpu_flags)) - dsputil_init_ssse3(c, avctx, cpu_flags); + dsputil_init_ssse3(c, avctx, cpu_flags, high_bit_depth); if (EXTERNAL_SSE4(cpu_flags)) - dsputil_init_sse4(c, avctx, cpu_flags); + dsputil_init_sse4(c, avctx, cpu_flags, high_bit_depth); if (CONFIG_ENCODERS) - ff_dsputilenc_init_mmx(c, avctx); + ff_dsputilenc_init_mmx(c, avctx, high_bit_depth); } |