aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-30 02:43:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-30 02:43:20 +0200
commit8045af65d47430046b8f883cba9eb0f1b3def7d9 (patch)
treeca69cdfa163fe07948991ab37ad1d7a816fa105f /libavcodec/ppc
parent30ba924bc8cec04f53089adbf4ef51b52c4b4b72 (diff)
downloadffmpeg-8045af65d47430046b8f883cba9eb0f1b3def7d9.tar.gz
ppc: fix usage of dsp_mask
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/dsputil_ppc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c
index 6e85241ee9..568f072b54 100644
--- a/libavcodec/ppc/dsputil_ppc.c
+++ b/libavcodec/ppc/dsputil_ppc.c
@@ -146,6 +146,14 @@ static void prefetch_ppc(void *mem, int stride, int h)
void 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();
+
+ if (avctx->dsp_mask) {
+ if (avctx->dsp_mask & AV_CPU_FLAG_FORCE)
+ mm_flags |= (avctx->dsp_mask & 0xffff);
+ else
+ mm_flags &= ~(avctx->dsp_mask & 0xffff);
+ }
// Common optimizations whether AltiVec is available or not
c->prefetch = prefetch_ppc;
@@ -165,7 +173,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
#if HAVE_ALTIVEC
if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
- if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) {
+ if (mm_flags & AV_CPU_FLAG_ALTIVEC) {
dsputil_init_altivec(c, avctx);
float_init_altivec(c, avctx);
int_init_altivec(c, avctx);