aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-21 02:31:57 +0100
committerMans Rullgard <mans@mansr.com>2011-07-21 18:10:58 +0100
commit874f1a901d9f2d1d6825be309ed046abc7672b03 (patch)
tree7638258077e3888e35e86ed7f8242ae2e9cc77a4 /libavcodec/x86
parent5cc2600964c72dad995efb18c918a63e0965f8db (diff)
downloadffmpeg-874f1a901d9f2d1d6825be309ed046abc7672b03.tar.gz
dsputil: template get_pixels() for different bit depths
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/dsputilenc_mmx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
index ea03e9232f..7362234c86 100644
--- a/libavcodec/x86/dsputilenc_mmx.c
+++ b/libavcodec/x86/dsputilenc_mmx.c
@@ -1098,6 +1098,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
{
int mm_flags = av_get_cpu_flags();
+ int bit_depth = avctx->bits_per_raw_sample;
if (mm_flags & AV_CPU_FLAG_MMX) {
const int dct_algo = avctx->dct_algo;
@@ -1112,7 +1113,8 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
}
}
- c->get_pixels = get_pixels_mmx;
+ if (bit_depth <= 8)
+ c->get_pixels = get_pixels_mmx;
c->diff_pixels = diff_pixels_mmx;
c->pix_sum = pix_sum16_mmx;
@@ -1159,7 +1161,8 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
}
if(mm_flags & AV_CPU_FLAG_SSE2){
- c->get_pixels = get_pixels_sse2;
+ if (bit_depth <= 8)
+ c->get_pixels = get_pixels_sse2;
c->sum_abs_dctelem= sum_abs_dctelem_sse2;
#if HAVE_YASM && HAVE_ALIGNED_STACK
c->hadamard8_diff[0]= ff_hadamard8_diff16_sse2;