diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-30 23:27:39 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-30 23:27:39 +0400 |
commit | 51d25783488c056b2323041eba2f54a9b6e932b7 (patch) | |
tree | 24256bb3bbaf93bddb6f3bc89e538921a3b02d68 /libswresample | |
parent | 7001eee1f4bda539c449d191116af8a0ec88ee50 (diff) |
swr: fix MMX resample code, add emms
Fixes Ticket1495
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r-- | libswresample/resample.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c index 8c8ef92023..4aa53ee776 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -412,6 +412,7 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed){ int i, ret= -1; int mm_flags = av_get_cpu_flags(); + int need_emms= 0; for(i=0; i<dst->ch_count; i++){ #if ARCH_X86 @@ -419,15 +420,18 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_SSSE3)) ret= swri_resample_int16_ssse3(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); else #endif - if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_MMX2 )) ret= swri_resample_int16_mmx2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); - else + if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_MMX2 )){ + ret= swri_resample_int16_mmx2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); + need_emms= 1; + } else #endif if(c->format == AV_SAMPLE_FMT_S16P) ret= swri_resample_int16(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); else if(c->format == AV_SAMPLE_FMT_S32P) ret= swri_resample_int32(c, (int32_t*)dst->ch[i], (const int32_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); else if(c->format == AV_SAMPLE_FMT_FLTP) ret= swri_resample_float(c, (float *)dst->ch[i], (const float *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); else if(c->format == AV_SAMPLE_FMT_DBLP) ret= swri_resample_double(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count); } - + if(need_emms) + emms_c(); return ret; } |