shithub: opus

Download patch

ref: 58686e6fe144b14037d3dfc9c76462e85c6be2ec
parent: b4f308a2f9b4be46e0993fb765f428d3f1d8ffa3
author: Jean-Marc Valin <[email protected]>
date: Wed Aug 31 11:08:12 EDT 2011

Opus now only uses the _with_ec() calls to CELT

--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -40,12 +40,6 @@
 #include "opus_private.h"
 #include "os_support.h"
 
-#ifdef FIXED_POINT
-#define celt_decode_native celt_decode
-#else
-#define celt_decode_native celt_decode_float
-#endif
-
 struct OpusDecoder {
    int          celt_dec_offset;
    int          silk_dec_offset;
@@ -378,7 +372,7 @@
     if (redundancy && celt_to_silk)
     {
         celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0));
-        celt_decode_native(celt_dec, data+len, redundancy_bytes, redundant_audio, F5);
+        celt_decode_with_ec(celt_dec, data+len, redundancy_bytes, redundant_audio, F5, NULL);
         celt_decoder_ctl(celt_dec, CELT_GET_RANGE(&redundant_rng));
         celt_decoder_ctl(celt_dec, CELT_RESET_STATE);
     }
@@ -422,7 +416,7 @@
         celt_decoder_ctl(celt_dec, CELT_RESET_STATE);
         celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0));
 
-        celt_decode_native(celt_dec, data+len, redundancy_bytes, redundant_audio, F5);
+        celt_decode_with_ec(celt_dec, data+len, redundancy_bytes, redundant_audio, F5, NULL);
         celt_decoder_ctl(celt_dec, CELT_GET_RANGE(&redundant_rng));
         smooth_fade(pcm+st->channels*(frame_size-F2_5), redundant_audio+st->channels*F2_5,
         		pcm+st->channels*(frame_size-F2_5), F2_5, st->channels, window, st->Fs);
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -41,12 +41,6 @@
 #include "opus_private.h"
 #include "os_support.h"
 
-#ifdef FIXED_POINT
-#define celt_encode_native celt_encode
-#else
-#define celt_encode_native celt_encode_float
-#endif
-
 #define MAX_ENCODER_BUFFER 480
 
 struct OpusEncoder {
@@ -608,7 +602,7 @@
             celt_encoder_ctl(celt_enc, CELT_SET_START_BAND(0));
             celt_encoder_ctl(celt_enc, CELT_SET_PREDICTION(0));
             /* TODO: This wastes CPU a bit compared to just prefilling the buffer */
-            celt_encode_native(celt_enc, &st->delay_buffer[(st->encoder_buffer-st->delay_compensation-st->Fs/400)*st->channels], st->Fs/400, dummy, 10);
+            celt_encode_with_ec(celt_enc, &st->delay_buffer[(st->encoder_buffer-st->delay_compensation-st->Fs/400)*st->channels], st->Fs/400, dummy, 10, NULL);
         } else {
             celt_encoder_ctl(celt_enc, CELT_SET_PREDICTION(2));
         }
@@ -710,7 +704,7 @@
     {
         celt_encoder_ctl(celt_enc, CELT_SET_START_BAND(0));
         celt_encoder_ctl(celt_enc, CELT_SET_VBR(0));
-        celt_encode_native(celt_enc, pcm_buf, st->Fs/200, data+nb_compr_bytes, redundancy_bytes);
+        celt_encode_with_ec(celt_enc, pcm_buf, st->Fs/200, data+nb_compr_bytes, redundancy_bytes, NULL);
         celt_encoder_ctl(celt_enc, CELT_GET_RANGE(&redundant_rng));
         celt_encoder_ctl(celt_enc, CELT_RESET_STATE);
     }
@@ -734,9 +728,9 @@
         celt_encoder_ctl(celt_enc, CELT_SET_PREDICTION(0));
 
         /* TODO: We could speed up prefilling here */
-        celt_encode_native(celt_enc, pcm_buf+st->channels*(frame_size-N2-N4), N4, data+nb_compr_bytes, redundancy_bytes);
+        celt_encode_with_ec(celt_enc, pcm_buf+st->channels*(frame_size-N2-N4), N4, data+nb_compr_bytes, redundancy_bytes, NULL);
 
-        celt_encode_native(celt_enc, pcm_buf+st->channels*(frame_size-N2), N2, data+nb_compr_bytes, redundancy_bytes);
+        celt_encode_with_ec(celt_enc, pcm_buf+st->channels*(frame_size-N2), N2, data+nb_compr_bytes, redundancy_bytes, NULL);
         celt_encoder_ctl(celt_enc, CELT_GET_RANGE(&redundant_rng));
     }