diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-29 15:28:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-29 15:32:18 +0200 |
commit | 9f98a8e9bc9b669f348834908dce927a2a5d9b90 (patch) | |
tree | 0c26f924491efb411c37c32911423929fef2b488 /libswresample/audioconvert.c | |
parent | 106789dfa0cb19142cf8d8dfd38bd006b393a3c2 (diff) | |
download | ffmpeg-9f98a8e9bc9b669f348834908dce927a2a5d9b90.tar.gz |
swr: use memcpy when input and output match
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/audioconvert.c')
-rw-r--r-- | libswresample/audioconvert.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c index 529c911e96..1cdd80f810 100644 --- a/libswresample/audioconvert.c +++ b/libswresample/audioconvert.c @@ -107,6 +107,10 @@ static conv_func_type * const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB*AV_SAM FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), }; +static void cpy(uint8_t **dst, const uint8_t **src, int len){ + memcpy(*dst, *src, len); +} + AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, @@ -126,6 +130,9 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, if (in_fmt == AV_SAMPLE_FMT_U8) memset(ctx->silence, 0x80, sizeof(ctx->silence)); + if(out_fmt == in_fmt && !ch_map) + ctx->simd_f = cpy; + if(HAVE_YASM && HAVE_MMX) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels); return ctx; |