shithub: opus

Download patch

ref: c2b34412113a56eefc602782dd59482c083c3173
parent: 0fb0fd715cc85a7c4d710a94d740a1ece11ad275
author: Jean-Marc Valin <[email protected]>
date: Mon Oct 28 17:48:50 EDT 2013

Fixes DISABLE_FLOAT_API build

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -856,7 +856,11 @@
 
 opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size,
       int variable_duration, int C, opus_int32 Fs, int bitrate_bps,
-      int delay_compensation, downmix_func downmix, opus_val32 *subframe_mem)
+      int delay_compensation, downmix_func downmix
+#ifndef DISABLE_FLOAT_API
+      , opus_val32 *subframe_mem
+#endif
+      )
 {
 #ifndef DISABLE_FLOAT_API
    if (variable_duration == OPUS_FRAMESIZE_VARIABLE && frame_size >= Fs/200)
@@ -1370,11 +1374,13 @@
        VARDECL(OpusRepacketizer, rp);
        opus_int32 bytes_per_frame;
 
+#ifndef DISABLE_FLOAT_API
        if (analysis_read_pos_bak!= -1)
        {
           st->analysis.read_pos = analysis_read_pos_bak;
           st->analysis.read_subframe = analysis_read_subframe_bak;
        }
+#endif
 
        nb_frames = frame_size > st->Fs/25 ? 3 : 2;
        bytes_per_frame = IMIN(1276,(out_data_bytes-3)/nb_frames);
@@ -1986,7 +1992,11 @@
       delay_compensation = st->delay_compensation;
    frame_size = compute_frame_size(pcm, analysis_frame_size,
          st->variable_duration, st->channels, st->Fs, st->bitrate_bps,
-         delay_compensation, downmix_float, st->analysis.subframe_mem);
+         delay_compensation, downmix_float
+#ifndef DISABLE_FLOAT_API
+         , st->analysis.subframe_mem
+#endif
+         );
    return opus_encode_native(st, pcm, frame_size, data, out_data_bytes, 16, pcm, analysis_frame_size, 0, -2, st->channels, downmix_int);
 }
 
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -715,7 +715,11 @@
       delay_compensation -= Fs/400;
       frame_size = compute_frame_size(pcm, analysis_frame_size,
             st->variable_duration, channels, Fs, st->bitrate_bps,
-            delay_compensation, downmix, st->subframe_mem);
+            delay_compensation, downmix
+#ifndef DISABLE_FLOAT_API
+            , st->subframe_mem
+#endif
+            );
    }
 
    if (400*frame_size < Fs)
--- a/src/opus_private.h
+++ b/src/opus_private.h
@@ -96,7 +96,11 @@
 
 opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size,
       int variable_duration, int C, opus_int32 Fs, int bitrate_bps,
-      int delay_compensation, downmix_func downmix, opus_val32 *subframe_mem);
+      int delay_compensation, downmix_func downmix
+#ifndef DISABLE_FLOAT_API
+      , opus_val32 *subframe_mem
+#endif
+      );
 
 opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
       unsigned char *data, opus_int32 out_data_bytes, int lsb_depth,