diff options
author | xiangmingzhu <xiangzhu@cisco.com> | 2014-04-30 11:48:07 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2014-10-04 05:16:00 +0400 |
commit | c95c9a048f3283afb2e412b10085d4f7c19e1412 (patch) | |
tree | ed8873af6559d7a98922e0fed85be47c826ef521 /src | |
parent | 80460334b77d70e665a390503cd8992cdad06c10 (diff) |
Cisco optimization for x86 & fixed point
1. Only for fixed point on x86 platform (32bit and 64bit, uses SIMD
intrinsics up to SSE4.2)
2. Use "configure --enable-fixed-point --enable-intrinsics" to enable
optimization, default is disabled.
3. Official test cases are verified and passed.
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/opus_decoder.c | 4 | ||||
-rw-r--r-- | src/opus_encoder.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 79c8af1e..c41985e9 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -75,6 +75,7 @@ struct OpusDecoder { #endif opus_uint32 rangeFinal; + int arch; }; @@ -131,6 +132,7 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels) st->prev_mode = 0; st->frame_size = Fs/400; + st->arch = opus_select_arch(); return OPUS_OK; } @@ -375,7 +377,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, /* Call SILK decoder */ int first_frame = decoded_samples == 0; silk_ret = silk_Decode( silk_dec, &st->DecControl, - lost_flag, first_frame, &dec, pcm_ptr, &silk_frame_size ); + lost_flag, first_frame, &dec, pcm_ptr, &silk_frame_size, st->arch ); if( silk_ret ) { if (lost_flag) { /* PLC failure should not be fatal */ diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 96492c50..d836843e 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -1450,7 +1450,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (float_api) { opus_val32 sum; - sum = celt_inner_prod(&pcm_buf[total_buffer*st->channels], &pcm_buf[total_buffer*st->channels], frame_size*st->channels); + sum = celt_inner_prod(&pcm_buf[total_buffer*st->channels], &pcm_buf[total_buffer*st->channels], frame_size*st->channels, st->arch); /* This should filter out both NaNs and ridiculous signals that could cause NaNs further down. */ if (!(sum < 1e9f) || celt_isnan(sum)) |