Commit 7b499048 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Small cleanups of the soft clipping code.

- Made OP_SOFT_CLIP defined only when using floating point (libopus
   handles clipping when using the fixed-point API).
- Struct rearrangement for theoretically better packing on some
- Reset the state tracking channel count when re-initializing a
   decoder (and not the dither mute, because that gets reset for
parent bf06c4f2
......@@ -32,17 +32,22 @@
# include <opusfile.h>
typedef struct OggOpusLink OggOpusLink;
# if defined(OP_FIXED_POINT)
typedef opus_int16 op_sample;
# else
typedef float op_sample;
# endif
/*We're using this define to test for libopus 1.1 or later until libopus
provides a better mechanism.*/
/*Enable soft clipping prevention in 16-bit decodes.*/
# define OP_SOFT_CLIP (1)
# define OP_SOFT_CLIP (1)
# endif
# endif
# if OP_GNUC_PREREQ(4,2)
......@@ -217,8 +222,8 @@ struct OggOpusFile{
# endif
float dither_a[OP_NCHANNELS_MAX*4];
float dither_b[OP_NCHANNELS_MAX*4];
int dither_mute;
opus_uint32 dither_seed;
int dither_mute;
/*The number of channels represented by the internal state.
This gets set to 0 whenever anything that would prevent state propagation
occurs (switching between the float/short APIs, or between the
......@@ -1333,7 +1333,7 @@ static int op_make_decode_ready(OggOpusFile *_of){
#if !defined(OP_FIXED_POINT)
/*Use the serial number for the PRNG seed to get repeatable output for
straight play-throughs.*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment