shithub: opus

Download patch

ref: 71d39ad8413a4e0cbe986c394bec28b8e9bdd01f
parent: 6518a836ab731b39d51143fb8d7466ae67beda6d
author: Gregory Maxwell <[email protected]>
date: Fri Jul 29 20:00:29 EDT 2011

Correct many whitespace errors under libcelt/ and remove
non-ascii characters from the source.

--- a/libcelt/Makefile.am
+++ b/libcelt/Makefile.am
@@ -32,7 +32,7 @@
 noinst_PROGRAMS = testcelt dump_modes
 testcelt_SOURCES = testcelt.c
 testcelt_LDADD = libcelt@[email protected]
-INCLUDES = 
+INCLUDES =
 #libcelt@LIBCELT_SUFFIX@_la_LIBADD =
 
 dump_modes_SOURCES = dump_modes.c
--- a/libcelt/_kiss_fft_guts.h
+++ b/libcelt/_kiss_fft_guts.h
@@ -50,7 +50,7 @@
 #else /* DOUBLE_PRECISION */
 
 # define FRACBITS 15
-# define SAMPPROD opus_int32 
+# define SAMPPROD opus_int32
 #define SAMP_MAX 32767
 #define TRIG_UPSCALE 1
 #define EXT32(a) EXTEND32(a)
@@ -186,7 +186,7 @@
 		(x)->r = KISS_FFT_COS(phase);\
 		(x)->i = KISS_FFT_SIN(phase);\
 	}while(0)
-   
+
 #define  kf_cexp2(x,phase) \
    do{ \
       (x)->r = TRIG_UPSCALE*celt_cos_norm((phase));\
--- a/libcelt/arch.h
+++ b/libcelt/arch.h
@@ -10,14 +10,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -247,7 +247,7 @@
 #if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
 
 /* 2 on TI C5x DSP */
-#define BYTES_PER_CHAR 2 
+#define BYTES_PER_CHAR 2
 #define BITS_PER_CHAR 16
 #define LOG2_BITS_PER_CHAR 4
 
@@ -259,12 +259,12 @@
 
 #endif /* !CONFIG_TI_C54X */
 
-#ifndef GLOBAL_STACK_SIZE 
+#ifndef GLOBAL_STACK_SIZE
 #ifdef FIXED_POINT
 #define GLOBAL_STACK_SIZE 100000
 #else
 #define GLOBAL_STACK_SIZE 100000
 #endif
-#endif 
+#endif
 
 #endif /* ARCH_H */
--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -1,19 +1,19 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2009 Xiph.Org Foundation
-   Copyright (c) 2008-2009 Gregory Maxwell 
+   Copyright (c) 2008-2009 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,12 +89,12 @@
          int j;
          opus_val32 maxval=0;
          opus_val32 sum = 0;
-         
+
          j=M*eBands[i]; do {
             maxval = MAX32(maxval, X[j+c*N]);
             maxval = MAX32(maxval, -X[j+c*N]);
          } while (++j<M*eBands[i+1]);
-         
+
          if (maxval > 0)
          {
             int shift = celt_ilog2(maxval)-10;
@@ -406,7 +406,7 @@
    const opus_int16 * restrict eBands = m->eBands;
    int decision;
    int hf_sum=0;
-   
+
    N0 = M*m->shortMdctSize;
 
    if (M*(eBands[end]-eBands[end-1]) <= 8)
--- a/libcelt/bands.h
+++ b/libcelt/bands.h
@@ -1,19 +1,19 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2009 Xiph.Org Foundation
-   Copyright (c) 2008-2009 Gregory Maxwell 
+   Copyright (c) 2008-2009 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -36,8 +36,8 @@
 #include "entdec.h"
 #include "rate.h"
 
-/** Compute the amplitude (sqrt energy) in each of the bands 
- * @param m Mode data 
+/** Compute the amplitude (sqrt energy) in each of the bands
+ * @param m Mode data
  * @param X Spectrum
  * @param bands Square root of the energy for each band (returned)
  */
@@ -45,9 +45,9 @@
 
 /*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bank);*/
 
-/** Normalise each band of X such that the energy in each band is 
+/** Normalise each band of X such that the energy in each band is
     equal to 1
- * @param m Mode data 
+ * @param m Mode data
  * @param X Spectrum (returned normalised)
  * @param bands Square root of the energy for each band
  */
@@ -54,7 +54,7 @@
 void normalise_bands(const CELTMode *m, const celt_sig * restrict freq, celt_norm * restrict X, const celt_ener *bands, int end, int _C, int M);
 
 /** Denormalise each band of X to restore full amplitude
- * @param m Mode data 
+ * @param m Mode data
  * @param X Spectrum (returned de-normalised)
  * @param bands Square root of the energy for each band
  */
@@ -76,7 +76,7 @@
 void haar1(celt_norm *X, int N0, int stride);
 
 /** Quantisation/encoding of the residual spectrum
- * @param m Mode data 
+ * @param m Mode data
  * @param X Residual (normalised)
  * @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
  * @param enc Entropy encoder
--- a/libcelt/c64_fft.c
+++ b/libcelt/c64_fft.c
@@ -3,14 +3,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -81,7 +81,7 @@
 int gen_twiddle16(short *w, int n, double scale)
 {
   int i, j, k;
-  
+
   for (j = 1, k = 0; j < n >> 2; j = j << 2)
     {
       for (i = 0; i < n >> 2; i += j << 1)
@@ -90,21 +90,21 @@
 	  w[k + 10] = d2s(scale * sin(6.0 * PI * (i + j) / n));
 	  w[k +  9] = d2s(scale * cos(6.0 * PI * (i    ) / n));
 	  w[k +  8] = d2s(scale * sin(6.0 * PI * (i    ) / n));
-	  
+
 	  w[k +  7] = d2s(scale * cos(4.0 * PI * (i + j) / n));
 	  w[k +  6] = d2s(scale * sin(4.0 * PI * (i + j) / n));
 	  w[k +  5] = d2s(scale * cos(4.0 * PI * (i    ) / n));
 	  w[k +  4] = d2s(scale * sin(4.0 * PI * (i    ) / n));
-	  
+
 	  w[k +  3] = d2s(scale * cos(2.0 * PI * (i + j) / n));
 	  w[k +  2] = d2s(scale * sin(2.0 * PI * (i + j) / n));
 	  w[k +  1] = d2s(scale * cos(2.0 * PI * (i    ) / n));
 	  w[k +  0] = d2s(scale * sin(2.0 * PI * (i    ) / n));
-	  
+
 	  k += 12;
         }
     }
-  
+
   return k;
 }
 
@@ -129,7 +129,7 @@
 int gen_twiddle32(int *w, int n, double scale)
 {
   int i, j, k, s=0, t;
-  
+
   for (j = 1, k = 0; j < n >> 2; j = j << 2, s++)
     {
       for (i = t=0; i < n >> 2; i += j, t++)
@@ -136,17 +136,17 @@
         {
 	  w[k +  5] = d2i(scale * cos(6.0 * PI * i / n));
 	  w[k +  4] = d2i(scale * sin(6.0 * PI * i / n));
-	  
+
 	  w[k +  3] = d2i(scale * cos(4.0 * PI * i / n));
 	  w[k +  2] = d2i(scale * sin(4.0 * PI * i / n));
-	  
+
 	  w[k +  1] = d2i(scale * cos(2.0 * PI * i / n));
 	  w[k +  0] = d2i(scale * sin(2.0 * PI * i / n));
-	  
+
 	  k += 6;
         }
     }
-  
+
   return k;
 }
 
@@ -193,7 +193,7 @@
 }
 
 
-c64_fft_t *c64_fft32_alloc(int length, int x, int y) 
+c64_fft_t *c64_fft32_alloc(int length, int x, int y)
 {
   c64_fft_t *state;
   int i, c;
@@ -228,7 +228,7 @@
 }
 
 
-void c64_fft16_free(c64_fft_t *state) 
+void c64_fft16_free(c64_fft_t *state)
 {
   c64_fft32_free(state);
 }
@@ -260,7 +260,7 @@
     X[2*i+0] = cout[2*i+0];
     X[2*i+1] = cout[2*i+1];
   }
-  
+
   RESTORE_STACK;
 }
 
@@ -292,7 +292,7 @@
   SAVE_STACK;
 
   ALLOC(cin, state->nfft*2, opus_int16);
-  if ((opus_int32)Y & 7) 
+  if ((opus_int32)Y & 7)
     ALLOC(cout, state->nfft*2, opus_int16);
   else
     cout = Y;
@@ -311,7 +311,7 @@
       Y[2*i+0] = cout[2*i+0];
       Y[2*i+1] = cout[2*i+1];
     }
-  
+
   RESTORE_STACK;
 }
 
@@ -328,7 +328,7 @@
   for (i = 0; i < state->nfft; i++) {
     // No need to scale for this one but still need to save the input
     // because the fft is going to change it!
-    cin[2*i+0] = X[2*i+0]; 
+    cin[2*i+0] = X[2*i+0];
     cin[2*i+1] = X[2*i+1];
   }
 
--- a/libcelt/c64_fft.h
+++ b/libcelt/c64_fft.h
@@ -3,14 +3,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -1,19 +1,19 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2010 Xiph.Org Foundation
-   Copyright (c) 2008 Gregory Maxwell 
+   Copyright (c) 2008 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -119,7 +119,7 @@
    return ret;
 }
 
-/** Encoder state 
+/** Encoder state
  @brief Encoder state
  */
 struct CELTEncoder {
@@ -127,7 +127,7 @@
    int overlap;
    int channels;
    int stream_channels;
-   
+
    int force_intra;
    int clip;
    int disable_pf;
@@ -249,7 +249,7 @@
    }
 
    CELT_MEMSET((char*)st, 0, celt_encoder_get_size_custom(mode, channels));
-   
+
    st->mode = mode;
    st->overlap = mode->overlap;
    st->stream_channels = st->channels = channels;
@@ -390,7 +390,7 @@
    return is_transient;
 }
 
-/** Apply window and compute the MDCT for all sub-frames and 
+/** Apply window and compute the MDCT for all sub-frames and
     all channels in a frame */
 static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig * restrict in, celt_sig * restrict out, int _C, int LM)
 {
@@ -427,7 +427,7 @@
    }
 }
 
-/** Compute the IMDCT and apply window for all sub-frames and 
+/** Compute the IMDCT and apply window for all sub-frames and
     all channels in a frame */
 static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X,
       celt_sig * restrict out_mem[],
@@ -445,7 +445,7 @@
          int N2 = N;
          int B = 1;
          SAVE_STACK;
-         
+
          ALLOC(x, N+overlap, opus_val32);
          ALLOC(tmp, N, opus_val32);
 
@@ -1509,7 +1509,7 @@
 #ifdef MEASURE_NORM_MSE
    float X0[3000];
    float bandE0[60];
-   c=0; do 
+   c=0; do
       for (i=0;i<N;i++)
          X0[i+c*N] = X[i+c*N];
    while (++c<C);
@@ -1654,7 +1654,7 @@
    /* If there's any room left (can only happen for very high rates),
       it's already filled with zeros */
    ec_enc_done(enc);
-   
+
    if (st->signalling)
       nbCompressedBytes++;
 
@@ -1737,7 +1737,7 @@
 int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
 {
    va_list ap;
-   
+
    va_start(ap, request);
    switch (request)
    {
@@ -1864,7 +1864,7 @@
 /**********************************************************************/
 #define DECODE_BUFFER_SIZE 2048
 
-/** Decoder state 
+/** Decoder state
  @brief Decoder state
  */
 struct CELTDecoder {
@@ -1892,7 +1892,7 @@
    int postfilter_tapset_old;
 
    celt_sig preemph_memD[2];
-   
+
    celt_sig _decode_mem[1]; /* Size = channels*(DECODE_BUFFER_SIZE+mode->overlap) */
    /* opus_val16 lpc[],  Size = channels*LPC_ORDER */
    /* opus_val16 oldEBands[], Size = 2*mode->nbEBands */
@@ -2008,7 +2008,7 @@
    opus_val16 *oldBandE, *oldLogE2, *backgroundLogE;
    int plc=1;
    SAVE_STACK;
-   
+
    c=0; do {
       decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+st->overlap);
       out_mem[c] = decode_mem[c]+DECODE_BUFFER_SIZE-MAX_PERIOD;
@@ -2024,7 +2024,7 @@
       out_syn[1] = out_mem[1]+MAX_PERIOD-N;
 
    len = N+st->mode->overlap;
-   
+
    if (st->loss_count >= 5)
    {
       VARDECL(celt_sig, freq);
@@ -2236,7 +2236,7 @@
    }
 
    deemphasis(out_syn, pcm, N, C, st->downsample, st->mode->preemph, st->preemph_memD);
-   
+
    st->loss_count++;
 
    RESTORE_STACK;
@@ -2354,7 +2354,7 @@
       for (i=0;i<M*st->mode->eBands[st->start];i++)
          X[c*N+i] = 0;
    while (++c<C);
-   c=0; do   
+   c=0; do
       for (i=M*st->mode->eBands[effEnd];i<N;i++)
          X[c*N+i] = 0;
    while (++c<C);
@@ -2491,7 +2491,7 @@
    codedBands = compute_allocation(st->mode, st->start, st->end, offsets, cap,
          alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses,
          fine_quant, fine_priority, C, LM, dec, 0, 0);
-   
+
    unquant_fine_energy(st->mode, st->start, st->end, oldBandE, fine_quant, dec, C);
 
    /* Decode fixed codebook */
@@ -2635,13 +2635,13 @@
 
    C = CHANNELS(st->channels);
    N = frame_size;
-   
+
    ALLOC(out, C*N, opus_int16);
    ret=celt_decode_with_ec(st, data, len, out, frame_size, dec);
    if (ret>0)
       for (j=0;j<C*ret;j++)
          pcm[j]=out[j]*(1.f/32768.f);
-     
+
    RESTORE_STACK;
    return ret;
 }
@@ -2666,7 +2666,7 @@
    if (ret>0)
       for (j=0;j<C*ret;j++)
          pcm[j] = FLOAT2INT16 (out[j]);
-   
+
    RESTORE_STACK;
    return ret;
 }
@@ -2782,7 +2782,6 @@
    };
    if (error > 0 || error < -7)
       return "unknown error";
-   else 
+   else
       return error_strings[-error];
 }
-
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -1,6 +1,6 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2009 Xiph.Org Foundation
-   Copyright (c) 2008 Gregory Maxwell 
+   Copyright (c) 2008 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /**
   @file celt.h
@@ -11,14 +11,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -124,7 +124,7 @@
 
 
 
-/** Contains the state of an encoder. One encoder state is needed 
+/** Contains the state of an encoder. One encoder state is needed
     for each stream. It is initialised once at the beginning of the
     stream. Do *not* re-initialise the state for every frame.
    @brief Encoder state
@@ -138,7 +138,7 @@
 
 /** The mode contains all the information necessary to create an
     encoder. Both the encoder and decoder need to be initialised
-    with exactly the same mode, otherwise the quality will be very 
+    with exactly the same mode, otherwise the quality will be very
     bad */
 typedef struct CELTMode CELTMode;
 
@@ -148,11 +148,11 @@
 
 /* Mode calls */
 
-/** Creates a new mode struct. This will be passed to an encoder or 
-    decoder. The mode MUST NOT BE DESTROYED until the encoders and 
+/** Creates a new mode struct. This will be passed to an encoder or
+    decoder. The mode MUST NOT BE DESTROYED until the encoders and
     decoders that use it are destroyed as well.
  @param Fs Sampling rate (32000 to 96000 Hz)
- @param frame_size Number of samples (per channel) to encode in each 
+ @param frame_size Number of samples (per channel) to encode in each
                    packet (even values; 64 - 512)
  @param error Returned error code (if NULL, no error will be returned)
  @return A newly created mode
@@ -159,7 +159,7 @@
 */
 CELT_EXPORT CELTMode *celt_mode_create(opus_int32 Fs, int frame_size, int *error);
 
-/** Destroys a mode struct. Only call this after all encoders and 
+/** Destroys a mode struct. Only call this after all encoders and
     decoders using this mode are destroyed as well.
  @param mode Mode to be destroyed
 */
@@ -171,7 +171,7 @@
 
 CELT_EXPORT int celt_encoder_get_size_custom(const CELTMode *mode, int channels);
 
-/** Creates a new encoder state. Each stream needs its own encoder 
+/** Creates a new encoder state. Each stream needs its own encoder
     state (can't be shared across simultaneous streams).
  @param channels Number of channels
  @param error Returns an error code
@@ -182,7 +182,7 @@
 /** Creates a new encoder state. Each stream needs its own encoder
     state (can't be shared across simultaneous streams).
  @param mode Contains all the information about the characteristics of
- *  the stream (must be the same characteristics as used for the 
+ *  the stream (must be the same characteristics as used for the
  *  decoder)
  @param channels Number of channels
  @param error Returns an error code
@@ -201,8 +201,8 @@
 
 /** Encodes a frame of audio.
  @param st Encoder state
- @param pcm PCM audio in float format, with a normal range of ±1.0.
- *          Samples with a range beyond ±1.0 are supported but will
+ @param pcm PCM audio in float format, with a normal range of +/-1.0.
+ *          Samples with a range beyond +/-1.0 are supported but will
  *          be clipped by decoders using the integer API and should
  *          only be used if it is known that the far end supports
  *          extended dynmaic range. There must be exactly
@@ -235,7 +235,7 @@
  */
 CELT_EXPORT int celt_encode(CELTEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes);
 
-/** Query and set encoder parameters 
+/** Query and set encoder parameters
  @param st Encoder state
  @param request Parameter to change or query
  @param value Pointer to a 32-bit int value
@@ -284,7 +284,7 @@
  @param len Number of bytes to read from "data". This MUST be exactly the number
             of bytes returned by the encoder. Using a larger value WILL NOT WORK.
  @param pcm One frame (frame_size samples per channel) of decoded PCM will be
-            returned here in float format. 
+            returned here in float format.
  @return Error code.
    */
 CELT_EXPORT int celt_decode_float(CELTDecoder *st, const unsigned char *data, int len, float *pcm, int frame_size);
@@ -295,7 +295,7 @@
  @param len Number of bytes to read from "data". This MUST be exactly the number
             of bytes returned by the encoder. Using a larger value WILL NOT WORK.
  @param pcm One frame (frame_size samples per channel) of decoded PCM will be
-            returned here in 16-bit PCM format (native endian). 
+            returned here in 16-bit PCM format (native endian).
  @return Error code.
  */
 CELT_EXPORT int celt_decode(CELTDecoder *st, const unsigned char *data, int len, opus_int16 *pcm, int frame_size);
--- a/libcelt/cwrs.c
+++ b/libcelt/cwrs.c
@@ -503,7 +503,7 @@
       }
       else if(p>_i)kr=_k-1;
       else break;
-    }  
+    }
   }
   _i-=p;
   yj-=_k;
--- a/libcelt/cwrs.h
+++ b/libcelt/cwrs.h
@@ -6,14 +6,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/dump_modes.c
+++ b/libcelt/dump_modes.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -80,7 +80,7 @@
          fprintf(file, "#endif\n");
          fprintf(file, "\n");
       }
-      
+
       fprintf(file, "#ifndef DEF_WINDOW%d\n", mode->overlap);
       fprintf(file, "#define DEF_WINDOW%d\n", mode->overlap);
       fprintf (file, "static const opus_val16 window%d[%d] = {\n", mode->overlap, mode->overlap);
@@ -89,7 +89,7 @@
       fprintf (file, "};\n");
       fprintf(file, "#endif\n");
       fprintf(file, "\n");
-      
+
       if (!standard)
       {
          fprintf(file, "#ifndef DEF_ALLOC_VECTORS%d_%d\n", mode->Fs, mdctSize);
--- a/libcelt/fixed_c5x.h
+++ b/libcelt/fixed_c5x.h
@@ -7,14 +7,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -60,7 +60,7 @@
 #undef MULT16_16_Q15
 #define MULT16_16_Q15(a,b) (_smpy(a,b))
 
-#undef MULT16_16SU 
+#undef MULT16_16SU
 #define MULT16_16SU(a,b) _lmpysu(a,b)
 
 #undef MULT_16_16
--- a/libcelt/fixed_c6x.h
+++ b/libcelt/fixed_c6x.h
@@ -7,14 +7,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -31,7 +31,7 @@
 #ifndef FIXED_C6X_H
 #define FIXED_C6X_H
 
-#undef MULT16_16SU 
+#undef MULT16_16SU
 #define MULT16_16SU(a,b) _mpysu(a,b)
 
 #undef MULT_16_16
--- a/libcelt/fixed_debug.h
+++ b/libcelt/fixed_debug.h
@@ -8,14 +8,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -113,7 +113,7 @@
 }
 
 #define SHR16(a, shift) _SHR16(a, shift, __FILE__, __LINE__)
-static inline short _SHR16(int a, int shift, char *file, int line) 
+static inline short _SHR16(int a, int shift, char *file, int line)
 {
    int res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
@@ -127,7 +127,7 @@
    return res;
 }
 #define SHL16(a, shift) _SHL16(a, shift, __FILE__, __LINE__)
-static inline short _SHL16(int a, int shift, char *file, int line) 
+static inline short _SHL16(int a, int shift, char *file, int line)
 {
    int res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
@@ -141,7 +141,7 @@
    return res;
 }
 
-static inline int SHR32(long long a, int shift) 
+static inline int SHR32(long long a, int shift)
 {
    long long  res;
    if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
@@ -156,7 +156,7 @@
    celt_mips+=2;
    return res;
 }
-static inline int SHL32(long long a, int shift) 
+static inline int SHL32(long long a, int shift)
 {
    long long  res;
    if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
@@ -187,7 +187,7 @@
 //#define SHL(a,shift) ((a) << (shift))
 
 #define ADD16(a, b) _ADD16(a, b, __FILE__, __LINE__)
-static inline short _ADD16(int a, int b, char *file, int line) 
+static inline short _ADD16(int a, int b, char *file, int line)
 {
    int res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -204,7 +204,7 @@
 }
 
 #define SUB16(a, b) _SUB16(a, b, __FILE__, __LINE__)
-static inline short _SUB16(int a, int b, char *file, int line) 
+static inline short _SUB16(int a, int b, char *file, int line)
 {
    int res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -219,7 +219,7 @@
 }
 
 #define ADD32(a, b) _ADD32(a, b, __FILE__, __LINE__)
-static inline int _ADD32(long long a, long long b, char *file, int line) 
+static inline int _ADD32(long long a, long long b, char *file, int line)
 {
    long long res;
    if (!VERIFY_INT(a) || !VERIFY_INT(b))
@@ -236,7 +236,7 @@
 }
 
 #define SUB32(a, b) _SUB32(a, b, __FILE__, __LINE__)
-static inline int _SUB32(long long a, long long b, char *file, int line) 
+static inline int _SUB32(long long a, long long b, char *file, int line)
 {
    long long res;
    if (!VERIFY_INT(a) || !VERIFY_INT(b))
@@ -252,7 +252,7 @@
 
 #undef UADD32
 #define UADD32(a, b) _UADD32(a, b, __FILE__, __LINE__)
-static inline unsigned int _UADD32(unsigned long long a, unsigned long long b, char *file, int line) 
+static inline unsigned int _UADD32(unsigned long long a, unsigned long long b, char *file, int line)
 {
    long long res;
    if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
@@ -270,7 +270,7 @@
 
 #undef USUB32
 #define USUB32(a, b) _USUB32(a, b, __FILE__, __LINE__)
-static inline unsigned int _USUB32(unsigned long long a, unsigned long long b, char *file, int line) 
+static inline unsigned int _USUB32(unsigned long long a, unsigned long long b, char *file, int line)
 {
    long long res;
    if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
@@ -289,7 +289,7 @@
 
 
 /* result fits in 16 bits */
-static inline short MULT16_16_16(int a, int b) 
+static inline short MULT16_16_16(int a, int b)
 {
    int res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -304,7 +304,7 @@
 }
 
 #define MULT16_16(a, b) _MULT16_16(a, b, __FILE__, __LINE__)
-static inline int _MULT16_16(int a, int b, char *file, int line) 
+static inline int _MULT16_16(int a, int b, char *file, int line)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -333,7 +333,7 @@
       fprintf (stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
    }
    if (ABS32(b)>=((opus_val32)(1)<<(15+Q)))
-      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);      
+      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
    res = (((long long)a)*(long long)b) >> Q;
    if (!VERIFY_INT(res))
       fprintf (stderr, "MULT16_32_Q%d: output is not int: %d*%d=%d in %s: line %d\n", Q, (int)a, (int)b,(int)res, file, line);
@@ -352,7 +352,7 @@
       fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b);
    }
    if (ABS32(b)>=((opus_val32)(1)<<(15+Q)))
-      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);      
+      fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);
    res = ((((long long)a)*(long long)b) + (((opus_val32)(1)<<Q)>>1))>> Q;
    if (!VERIFY_INT(res))
       fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d\n", Q, (int)a, (int)b,(int)res);
@@ -383,7 +383,7 @@
    return a;
 }
 
-static inline int MULT16_16_Q11_32(int a, int b) 
+static inline int MULT16_16_Q11_32(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -397,7 +397,7 @@
    celt_mips+=3;
    return res;
 }
-static inline short MULT16_16_Q13(int a, int b) 
+static inline short MULT16_16_Q13(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -411,7 +411,7 @@
    celt_mips+=3;
    return res;
 }
-static inline short MULT16_16_Q14(int a, int b) 
+static inline short MULT16_16_Q14(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -427,7 +427,7 @@
 }
 
 #define MULT16_16_Q15(a, b) _MULT16_16_Q15(a, b, __FILE__, __LINE__)
-static inline short _MULT16_16_Q15(int a, int b, char *file, int line) 
+static inline short _MULT16_16_Q15(int a, int b, char *file, int line)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -444,7 +444,7 @@
    return res;
 }
 
-static inline short MULT16_16_P13(int a, int b) 
+static inline short MULT16_16_P13(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -461,7 +461,7 @@
    celt_mips+=4;
    return res;
 }
-static inline short MULT16_16_P14(int a, int b) 
+static inline short MULT16_16_P14(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -478,7 +478,7 @@
    celt_mips+=4;
    return res;
 }
-static inline short MULT16_16_P15(int a, int b) 
+static inline short MULT16_16_P15(int a, int b)
 {
    long long res;
    if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -498,7 +498,7 @@
 
 #define DIV32_16(a, b) _DIV32_16(a, b, __FILE__, __LINE__)
 
-static inline int _DIV32_16(long long a, long long b, char *file, int line) 
+static inline int _DIV32_16(long long a, long long b, char *file, int line)
 {
    long long res;
    if (b==0)
@@ -524,7 +524,7 @@
 }
 
 #define DIV32(a, b) _DIV32(a, b, __FILE__, __LINE__)
-static inline int _DIV32(long long a, long long b, char *file, int line) 
+static inline int _DIV32(long long a, long long b, char *file, int line)
 {
    long long res;
    if (b==0)
--- a/libcelt/fixed_generic.h
+++ b/libcelt/fixed_generic.h
@@ -9,14 +9,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/float_cast.h
+++ b/libcelt/float_cast.h
@@ -29,20 +29,20 @@
 #ifndef FLOAT_CAST_H
 #define FLOAT_CAST_H
 
-/*============================================================================ 
+/*============================================================================
 **	On Intel Pentium processors (especially PIII and probably P4), converting
-**	from float to int is very slow. To meet the C specs, the code produced by 
-**	most C compilers targeting Pentium needs to change the FPU rounding mode 
-**	before the float to int conversion is performed. 
+**	from float to int is very slow. To meet the C specs, the code produced by
+**	most C compilers targeting Pentium needs to change the FPU rounding mode
+**	before the float to int conversion is performed.
 **
-**	Changing the FPU rounding mode causes the FPU pipeline to be flushed. It 
+**	Changing the FPU rounding mode causes the FPU pipeline to be flushed. It
 **	is this flushing of the pipeline which is so slow.
 **
 **	Fortunately the ISO C99 specifications define the functions lrint, lrintf,
-**	llrint and llrintf which fix this problem as a side effect. 
+**	llrint and llrintf which fix this problem as a side effect.
 **
-**	On Unix-like systems, the configure process should have detected the 
-**	presence of these functions. If they weren't found we have to replace them 
+**	On Unix-like systems, the configure process should have detected the
+**	presence of these functions. If they weren't found we have to replace them
 **	here with a standard C cast.
 */
 
@@ -62,7 +62,7 @@
 
 /*	These defines enable functionality introduced with the 1999 ISO C
 **	standard. They must be defined before the inclusion of math.h to
-**	engage them. If optimisation is enabled, these functions will be 
+**	engage them. If optimisation is enabled, these functions will be
 **	inlined. With optimisation switched off, you have to link in the
 **	maths library using -lm.
 */
@@ -98,11 +98,11 @@
 
 	#include	<math.h>
 
-	/*	Win32 doesn't seem to have these functions. 
+	/*	Win32 doesn't seem to have these functions.
 	**	Therefore implement inline versions of these functions here.
 	*/
 	
-	__inline long int 
+	__inline long int
 	float2int (float flt)
 	{	int intgr;
 
--- a/libcelt/kiss_fft.c
+++ b/libcelt/kiss_fft.c
@@ -119,7 +119,7 @@
          C_MUL4(scratch[0],Fout[m] , *tw1 );
          C_MUL4(scratch[1],Fout[m2] , *tw2 );
          C_MUL4(scratch[2],Fout[m3] , *tw3 );
-             
+
          Fout->r = PSHR(Fout->r, 2);
          Fout->i = PSHR(Fout->i, 2);
          C_SUB( scratch[5] , *Fout, scratch[1] );
@@ -133,7 +133,7 @@
          tw2 += fstride*2;
          tw3 += fstride*3;
          C_ADDTO( *Fout , scratch[3] );
-             
+
          Fout[m].r = scratch[5].r + scratch[4].i;
          Fout[m].i = scratch[5].i - scratch[4].r;
          Fout[m3].r = scratch[5].r - scratch[4].i;
@@ -168,7 +168,7 @@
          C_MULC(scratch[0],Fout[m] , *tw1 );
          C_MULC(scratch[1],Fout[m2] , *tw2 );
          C_MULC(scratch[2],Fout[m3] , *tw3 );
-             
+
          C_SUB( scratch[5] , *Fout, scratch[1] );
          C_ADDTO(*Fout, scratch[1]);
          C_ADD( scratch[3] , scratch[0] , scratch[2] );
@@ -178,7 +178,7 @@
          tw2 += fstride*2;
          tw3 += fstride*3;
          C_ADDTO( *Fout , scratch[3] );
-             
+
          Fout[m].r = scratch[5].r - scratch[4].i;
          Fout[m].i = scratch[5].i + scratch[4].r;
          Fout[m3].r = scratch[5].r + scratch[4].i;
@@ -446,7 +446,7 @@
     const int p=*factors++; /* the radix  */
     const int m=*factors++; /* stage's fft length/p */
     /*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
-    if (m!=1) 
+    if (m!=1)
         kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, m);
 
     /* Compensate for longer twiddles table (when sharing) */
@@ -459,7 +459,7 @@
         case 3: kf_bfly3(Fout,fstride,st,m, N, m2); break;
         case 5: kf_bfly5(Fout,fstride,st,m, N, m2); break;
 #endif
-    }    
+    }
 }
 
 
@@ -477,7 +477,7 @@
    const int p=*factors++; /* the radix  */
    const int m=*factors++; /* stage's fft length/p */
    /*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
-   if (m!=1) 
+   if (m!=1)
       ki_work( Fout , f, fstride*p, in_stride, factors,st, N*p, m);
 
    /* Compensate for longer twiddles table (when sharing) */
@@ -490,7 +490,7 @@
       case 3: ki_bfly3(Fout,fstride,st,m, N, m2); break;
       case 5: ki_bfly5(Fout,fstride,st,m, N, m2); break;
 #endif
-   }    
+   }
 }
 
 
@@ -531,10 +531,10 @@
 
 
 /*  facbuf is populated by p1,m1,p2,m2, ...
-    where 
+    where
     p[i] * m[i] = m[i-1]
     m0 = n                  */
-static 
+static
 int kf_factor(int n,opus_int16 * facbuf)
 {
     int p=4;
--- a/libcelt/kiss_fft.h
+++ b/libcelt/kiss_fft.h
@@ -115,9 +115,9 @@
 
 //typedef struct kiss_fft_state* kiss_fft_cfg;
 
-/** 
+/**
  *  kiss_fft_alloc
- *  
+ *
  *  Initialize a FFT (or IFFT) algorithm's cfg/state buffer.
  *
  *  typical usage:      kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL);
@@ -127,14 +127,14 @@
  *
  *  If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc.
  *  The returned value should be free()d when done to avoid memory leaks.
- *  
+ *
  *  The state can be placed in a user supplied buffer 'mem':
  *  If lenmem is not NULL and mem is not NULL and *lenmem is large enough,
  *      then the function places the cfg in mem and the size used in *lenmem
  *      and returns mem.
- *  
+ *
  *  If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough),
- *      then the function returns NULL and places the minimum cfg 
+ *      then the function returns NULL and places the minimum cfg
  *      buffer size in *lenmem.
  * */
 
@@ -159,7 +159,7 @@
 
 
 #ifdef __cplusplus
-} 
+}
 #endif
 
 #endif
--- a/libcelt/laplace.c
+++ b/libcelt/laplace.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/laplace.h
+++ b/libcelt/laplace.h
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/mathops.h
+++ b/libcelt/mathops.h
@@ -10,14 +10,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/mdct.c
+++ b/libcelt/mdct.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -29,14 +29,14 @@
 /* This is a simple MDCT implementation that uses a N/4 complex FFT
    to do most of the work. It should be relatively straightforward to
    plug in pretty much and FFT here.
-   
-   This replaces the Vorbis FFT (and uses the exact same API), which 
-   was a bit too messy and that was ending up duplicating code 
+
+   This replaces the Vorbis FFT (and uses the exact same API), which
+   was a bit too messy and that was ending up duplicating code
    (might as well use the same FFT everywhere).
-   
+
    The algorithm is similar to (and inspired from) Fabrice Bellard's
    MDCT implementation in FFMPEG, but has differences in signs, ordering
-   and scaling in many places. 
+   and scaling in many places.
 */
 
 #ifndef SKIP_CONFIG_H
@@ -227,7 +227,7 @@
 #else
    sine = (kiss_twiddle_scalar)2*M_PI*(.125f)/N;
 #endif
-   
+
    /* Pre-rotate */
    {
       /* Temp pointers to make it really clear to the compiler what we're doing */
@@ -235,7 +235,7 @@
       const kiss_fft_scalar * restrict xp2 = in+N2-1;
       kiss_fft_scalar * restrict yp = f2;
       const kiss_twiddle_scalar *t = &l->trig[0];
-      for(i=0;i<N4;i++) 
+      for(i=0;i<N4;i++)
       {
          kiss_fft_scalar yr, yi;
          yr = -S_MUL(*xp2, t[i<<shift]) + S_MUL(*xp1,t[(N4-i)<<shift]);
@@ -250,7 +250,7 @@
 
    /* Inverse N/4 complex FFT. This one should *not* downscale even in fixed-point */
    kiss_ifft(l->kfft[shift], (kiss_fft_cpx *)f2, (kiss_fft_cpx *)f);
-   
+
    /* Post-rotate */
    {
       kiss_fft_scalar * restrict fp = f;
--- a/libcelt/mdct.h
+++ b/libcelt/mdct.h
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -29,14 +29,14 @@
 /* This is a simple MDCT implementation that uses a N/4 complex FFT
    to do most of the work. It should be relatively straightforward to
    plug in pretty much and FFT here.
-   
-   This replaces the Vorbis FFT (and uses the exact same API), which 
-   was a bit too messy and that was ending up duplicating code 
+
+   This replaces the Vorbis FFT (and uses the exact same API), which
+   was a bit too messy and that was ending up duplicating code
    (might as well use the same FFT everywhere).
-   
+
    The algorithm is similar to (and inspired from) Fabrice Bellard's
    MDCT implementation in FFMPEG, but has differences in signs, ordering
-   and scaling in many places. 
+   and scaling in many places.
 */
 
 #ifndef MDCT_H
@@ -58,7 +58,7 @@
 /** Compute a forward MDCT and scale by 4/N */
 void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const opus_val16 *window, int overlap, int shift);
 
-/** Compute a backward MDCT (no scaling) and performs weighted overlap-add 
+/** Compute a backward MDCT (no scaling) and performs weighted overlap-add
     (scales implicitly by 1/2) */
 void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *out, const opus_val16 * restrict window, int overlap, int shift);
 
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -1,19 +1,19 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2009 Xiph.Org Foundation
-   Copyright (c) 2008 Gregory Maxwell 
+   Copyright (c) 2008 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -115,10 +115,10 @@
    high = nBark-lin;
    *nbEBands = low+high;
    eBands = celt_alloc(sizeof(opus_int16)*(*nbEBands+2));
-   
+
    if (eBands==NULL)
       return NULL;
-   
+
    /* Linear spacing (min_width) */
    for (i=0;i<low;i++)
       eBands[i] = i;
@@ -234,8 +234,8 @@
 #if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA)
    if (global_stack==NULL)
       goto failure;
-#endif 
 #endif
+#endif
 
 #ifndef CUSTOM_MODES_ONLY
    for (i=0;i<TOTAL_MODES;i++)
@@ -261,7 +261,7 @@
 #else
 
    /* The good thing here is that permutation of the arguments will automatically be invalid */
-   
+
    if (Fs < 8000 || Fs > 96000)
    {
       if (error)
@@ -350,7 +350,7 @@
    mode->effEBands = mode->nbEBands;
    while (mode->eBands[mode->effEBands] > mode->shortMdctSize)
       mode->effEBands--;
-   
+
    /* Overlap must be divisible by 4 */
    mode->overlap = ((mode->shortMdctSize>>2)<<2);
 
@@ -357,7 +357,7 @@
    compute_allocation_table(mode);
    if (mode->allocVectors==NULL)
       goto failure;
-   
+
    window = (opus_val16*)celt_alloc(mode->overlap*sizeof(opus_val16));
    if (window==NULL)
       goto failure;
@@ -415,7 +415,7 @@
 #endif /* CUSTOM_MODES_ONLY */
    celt_free((opus_int16*)mode->eBands);
    celt_free((opus_int16*)mode->allocVectors);
-   
+
    celt_free((opus_val16*)mode->window);
    celt_free((opus_int16*)mode->logN);
 
--- a/libcelt/modes.h
+++ b/libcelt/modes.h
@@ -1,19 +1,19 @@
 /* Copyright (c) 2007-2008 CSIRO
    Copyright (c) 2007-2009 Xiph.Org Foundation
-   Copyright (c) 2008 Gregory Maxwell 
+   Copyright (c) 2008 Gregory Maxwell
    Written by Jean-Marc Valin and Gregory Maxwell */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -65,7 +65,7 @@
 } PulseCache;
 
 /** Mode definition (opaque)
- @brief Mode definition 
+ @brief Mode definition
  */
 struct CELTMode {
    opus_int32 Fs;
@@ -75,10 +75,10 @@
    int          effEBands;
    opus_val16    preemph[4];
    const opus_int16   *eBands;   /**< Definition for each "pseudo-critical band" */
-   
+
    int          nbAllocVectors; /**< Number of lines in the matrix below */
    const unsigned char   *allocVectors;   /**< Number of bits in each band for several rates */
-   
+
    /* Stuff that could go in the {en,de}coder, but we save space this way */
    mdct_lookup mdct;
 
--- a/libcelt/opus_types.h
+++ b/libcelt/opus_types.h
@@ -41,7 +41,7 @@
    typedef uint16_t opus_uint16;
    typedef int32_t opus_int32;
    typedef uint32_t opus_uint32;
-#elif defined(_WIN32) 
+#elif defined(_WIN32)
 
 #  if defined(__CYGWIN__)
 #    include <_G_config.h>
--- a/libcelt/os_support.h
+++ b/libcelt/os_support.h
@@ -1,5 +1,5 @@
 /* Copyright (C) 2007 Jean-Marc Valin
-      
+
    File: os_support.h
    This is the (tiny) OS abstraction layer. Aside from math.h, this is the
    only place where system headers are allowed.
@@ -39,12 +39,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-/** CELT wrapper for calloc(). To do your own dynamic allocation, all you need to do is replace this function, celt_realloc and celt_free 
+/** CELT wrapper for calloc(). To do your own dynamic allocation, all you need to do is replace this function, celt_realloc and celt_free
     NOTE: celt_alloc needs to CLEAR THE MEMORY */
 #ifndef OVERRIDE_CELT_ALLOC
 static inline void *celt_alloc (int size)
 {
-   /* WARNING: this is not equivalent to malloc(). If you want to use malloc() 
+   /* WARNING: this is not equivalent to malloc(). If you want to use malloc()
       or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise
       you will experience strange bugs */
    return calloc(size,1);
@@ -81,7 +81,7 @@
 #define CELT_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
 #endif
 
-/** Copy n bytes of memory from src to dst, allowing overlapping regions. The 0* term 
+/** Copy n bytes of memory from src to dst, allowing overlapping regions. The 0* term
     provides compile-time type checking */
 #ifndef OVERRIDE_CELT_MOVE
 #define CELT_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -10,14 +10,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -226,7 +226,7 @@
          offset = 1;
       else if ((a-c) > MULT16_32_Q15(QCONST16(.7f,15),b-c))
          offset = -1;
-      else 
+      else
          offset = 0;
    } else {
       offset = 0;
--- a/libcelt/pitch.h
+++ b/libcelt/pitch.h
@@ -10,14 +10,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/plc.c
+++ b/libcelt/plc.c
@@ -42,7 +42,7 @@
 int          p
 )
 {
-   int i, j;  
+   int i, j;
    opus_val32 r;
    opus_val32 error = ac[0];
 #ifdef FIXED_POINT
@@ -144,7 +144,7 @@
                    opus_val32       *ac,  /* out: [0...lag-1] ac values */
                    const opus_val16       *window,
                    int          overlap,
-                   int          lag, 
+                   int          lag,
                    int          n
                   )
 {
@@ -176,7 +176,7 @@
 #endif
    while (lag>=0)
    {
-      for (i = lag, d = 0; i < n; i++) 
+      for (i = lag, d = 0; i < n; i++)
          d += xx[i] * xx[i-lag];
       ac[lag] = d;
       /*printf ("%f ", ac[lag]);*/
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -245,7 +245,7 @@
          error[i+c*m->nbEBands] = PSHR32(f,7) - SHL16(qi,DB_SHIFT);
          badness += abs(qi0-qi);
          q = SHL32(EXTEND32(qi),DB_SHIFT);
-         
+
          tmp = PSHR32(MULT16_16(coef,oldE),8) + prev[c] + SHL32(q,7);
 #ifdef FIXED_POINT
          tmp = MAX32(-QCONST32(28.f, DB_SHIFT+7), tmp);
@@ -493,7 +493,7 @@
    {
       if (fine_quant[i] <= 0)
          continue;
-      c=0; 
+      c=0;
       do {
          int q2;
          opus_val16 offset;
--- a/libcelt/quant_bands.h
+++ b/libcelt/quant_bands.h
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -537,7 +537,7 @@
    VARDECL(int, thresh);
    VARDECL(int, trim_offset);
    SAVE_STACK;
-   
+
    total = IMAX(total, 0);
    len = m->nbEBands;
    skip_start = start;
--- a/libcelt/rate.h
+++ b/libcelt/rate.h
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -92,7 +92,7 @@
 opus_int16 **compute_alloc_cache(CELTMode *m, int M);
 
 /** Compute the pulse allocation, i.e. how many pulses will go in each
-  * band. 
+  * band.
  @param m mode
  @param offsets Requested increase or decrease in the number of bits for
                 each band
--- a/libcelt/stack_alloc.h
+++ b/libcelt/stack_alloc.h
@@ -8,14 +8,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -127,7 +127,7 @@
 #define RESTORE_STACK ((global_stack = _saved_stack),VALGRIND_MAKE_MEM_NOACCESS(global_stack, global_stack_top-global_stack))
 #define ALLOC_STACK char *_saved_stack; ((global_stack = (global_stack==0) ? ((global_stack_top=celt_alloc_scratch(GLOBAL_STACK_SIZE*2)+(GLOBAL_STACK_SIZE*2))-(GLOBAL_STACK_SIZE*2)) : global_stack),VALGRIND_MAKE_MEM_NOACCESS(global_stack, global_stack_top-global_stack)); _saved_stack = global_stack;
 
-#else 
+#else
 
 #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
 #define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char))))
@@ -134,7 +134,7 @@
 #define RESTORE_STACK (global_stack = _saved_stack)
 #define ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? celt_alloc_scratch(GLOBAL_STACK_SIZE) : global_stack); _saved_stack = global_stack;
 
-#endif /*ENABLE_VALGRIND*/ 
+#endif /*ENABLE_VALGRIND*/
 
 #include "os_support.h"
 #define VARDECL(type, var) type *var
--- a/libcelt/testcelt.c
+++ b/libcelt/testcelt.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -67,7 +67,7 @@
                "<input> <output>\n");
       return 1;
    }
-   
+
    rate = atoi(argv[1]);
    channels = atoi(argv[2]);
    frame_size = atoi(argv[3]);
@@ -100,7 +100,7 @@
       fprintf (stderr, "Could not open output file %s\n", argv[argc-1]);
       return 1;
    }
-   
+
    enc = celt_encoder_create_custom(mode, channels, &err);
    if (err != 0)
    {
@@ -120,7 +120,7 @@
       complexity=atoi(argv[5]);
       celt_encoder_ctl(enc,CELT_SET_COMPLEXITY(complexity));
    }
-   
+
    in = (opus_int16*)malloc(frame_size*channels*sizeof(opus_int16));
    out = (opus_int16*)malloc(frame_size*channels*sizeof(opus_int16));
 
@@ -182,7 +182,7 @@
       skip = 0;
    }
    PRINT_MIPS(stderr);
-   
+
    celt_encoder_destroy(enc);
    celt_decoder_destroy(dec);
    fclose(fin);
--- a/libcelt/tests/cwrs32-test.c
+++ b/libcelt/tests/cwrs32-test.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#define CELT_C 
+#define CELT_C
 #include "../libcelt/stack_alloc.h"
 #include "../libcelt/entenc.c"
 #include "../libcelt/entdec.c"
--- a/libcelt/tests/dft-test.c
+++ b/libcelt/tests/dft-test.c
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include "kiss_fft.h"
 
-#define CELT_C 
+#define CELT_C
 #include "../libcelt/stack_alloc.h"
 #include "../libcelt/kiss_fft.c"
 #include "../libcelt/mathops.c"
@@ -22,7 +22,7 @@
 #define M_PI 3.141592653
 #endif
 
-#ifdef FIXED_DEBUG  
+#ifdef FIXED_DEBUG
 long long celt_mips=0;
 #endif
 int ret = 0;
@@ -31,7 +31,7 @@
 {
     int bin,k;
     double errpow=0,sigpow=0, snr;
-    
+
     for (bin=0;bin<nfft;++bin) {
         double ansr = 0;
         double ansi = 0;
@@ -88,7 +88,7 @@
        in[k].i *= 32768;
     }
 #endif
-    
+
     if (isinverse)
     {
        for (k=0;k<nfft;++k) {
@@ -96,9 +96,9 @@
           in[k].i /= nfft;
        }
     }
-    
+
     /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/
-       
+
     if (isinverse)
        kiss_ifft(cfg,in,out);
     else
--- a/libcelt/tests/ectest.c
+++ b/libcelt/tests/ectest.c
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
-#include <time.h>       
+#include <time.h>
 #include "entcode.h"
 #include "entenc.h"
 #include "entdec.h"
--- a/libcelt/tests/laplace-test.c
+++ b/libcelt/tests/laplace-test.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "laplace.h"
-#define CELT_C 
+#define CELT_C
 #include "../libcelt/stack_alloc.h"
 
 #include "../libcelt/entenc.c"
@@ -33,7 +33,7 @@
    ALLOC_STACK;
    ptr = malloc(DATA_SIZE);
    ec_enc_init(&enc,ptr,DATA_SIZE);
-   
+
    val[0] = 3; decay[0] = 6000;
    val[1] = 0; decay[1] = 5800;
    val[2] = -1; decay[2] = 5600;
@@ -60,6 +60,6 @@
          ret = 1;
       }
    }
-   
+
    return ret;
 }
--- a/libcelt/tests/mathops-test.c
+++ b/libcelt/tests/mathops-test.c
@@ -13,7 +13,7 @@
 #define WORD "%f"
 #endif
 
-#ifdef FIXED_DEBUG  
+#ifdef FIXED_DEBUG
 long long celt_mips=0;
 #endif
 int ret = 0;
@@ -67,7 +67,7 @@
       if (error>0.0009)
       {
          fprintf (stderr, "celt_log2 failed: fabs((1.442695040888963387*log(x))-celt_log2(x))>0.001 (x = %f, error = %f)\n", x,error);
-         ret = 1;    
+         ret = 1;
       }
    }
 }
@@ -81,7 +81,7 @@
       if (error>0.0002)
       {
          fprintf (stderr, "celt_exp2 failed: fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = %f, error = %f)\n", x,error);
-         ret = 1;    
+         ret = 1;
       }
    }
 }
@@ -95,7 +95,7 @@
       if (error>0.001)
       {
          fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_log2(celt_exp2(x))))>0.001 (x = %f, error = %f)\n", x,error);
-         ret = 1;    
+         ret = 1;
       }
    }
 }
--- a/libcelt/tests/mdct-test.c
+++ b/libcelt/tests/mdct-test.c
@@ -10,7 +10,7 @@
 
 #include <stdio.h>
 #include "mdct.h"
-#define CELT_C 
+#define CELT_C
 #include "../libcelt/stack_alloc.h"
 
 #include "../libcelt/kiss_fft.c"
@@ -22,7 +22,7 @@
 #define M_PI 3.141592653
 #endif
 
-#ifdef FIXED_DEBUG  
+#ifdef FIXED_DEBUG
 long long celt_mips=0;
 #endif
 int ret = 0;
@@ -38,7 +38,7 @@
         for (k=0;k<nfft;++k) {
            double phase = 2*M_PI*(k+.5+.25*nfft)*(bin+.5)/nfft;
            double re = cos(phase);
-            
+
            re /= nfft/4;
 
            ansr += in[k] * re;
@@ -110,7 +110,7 @@
        in[k] *= 32768;
     }
 #endif
-    
+
     if (isinverse)
     {
        for (k=0;k<nfft;++k) {
@@ -117,9 +117,9 @@
           in[k] /= nfft;
        }
     }
-    
+
     /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/
-       
+
     if (isinverse)
     {
        for (k=0;k<nfft;++k)
--- a/libcelt/tests/real-fft-test.c
+++ b/libcelt/tests/real-fft-test.c
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#define CELT_C 
+#define CELT_C
 #include "../libcelt/stack_alloc.h"
 #include "../libcelt/kiss_fft.c"
 #include "../libcelt/kiss_fftr.c"
@@ -18,7 +18,7 @@
 int ret=0;
 
 static
-kiss_fft_scalar rand_scalar(void) 
+kiss_fft_scalar rand_scalar(void)
 {
     return (rand()%32767)-16384;
 }
@@ -31,7 +31,7 @@
 
     vec1[0].i = vec1[n].r;
     for (k=0;k<n;++k) {
-        sigpow += (double)vec1[k].r * (double)vec1[k].r + 
+        sigpow += (double)vec1[k].r * (double)vec1[k].r +
                   (double)vec1[k].i * (double)vec1[k].i;
         err = (double)vec1[k].r - (double)vec2[2*k];
         /*printf ("%f %f\n", (double)vec1[k].r, (double)vec2[2*k]);*/
@@ -107,7 +107,7 @@
     kiss_fftr_state = kiss_fftr_alloc(NFFT,0,0);
     kiss_fft(kiss_fft_state,cin,cout);
     kiss_fftr(kiss_fftr_state,rin,sout);
-    
+
     printf( "nfft=%d, inverse=%d, snr=%g\n",
             NFFT,0, snr_compare(cout,sout,(NFFT/2)) );
 
@@ -120,13 +120,13 @@
         cin[i].i = rand_scalar();
     }
 
-    // conjugate symmetry of real signal 
+    // conjugate symmetry of real signal
     for (i=1;i< NFFT/2;++i) {
         cin[NFFT-i].r = cin[i].r;
         cin[NFFT-i].i = - cin[i].i;
     }
 
-    
+
 #ifdef FIXED_POINT
 #ifdef DOUBLE_PRECISION
     for (i=0;i< NFFT;++i) {
@@ -139,7 +139,7 @@
        cin[i].i /= NFFT;
     }
 #endif
-    
+
     fin[0] = cin[0].r;
     fin[1] = cin[NFFT/2].r;
     for (i=1;i< NFFT/2;++i)
@@ -147,13 +147,13 @@
        fin[2*i] = cin[i].r;
        fin[2*i+1] = cin[i].i;
     }
-    
+
     kiss_ifft(kiss_fft_state,cin,cout);
     kiss_fftri(kiss_fftr_state,fin,rout);
     /*
     printf(" results from inverse kiss_fft : (%f,%f), (%f,%f), (%f,%f), (%f,%f), (%f,%f) ...\n "
             , (float)cout[0].r , (float)cout[0].i , (float)cout[1].r , (float)cout[1].i , (float)cout[2].r , (float)cout[2].i , (float)cout[3].r , (float)cout[3].i , (float)cout[4].r , (float)cout[4].i
-            ); 
+            );
 
     printf(" results from inverse kiss_fftr: %f,%f,%f,%f,%f ... \n"
             ,(float)rout[0] ,(float)rout[1] ,(float)rout[2] ,(float)rout[3] ,(float)rout[4]);
--- a/libcelt/tests/tandem-test.c
+++ b/libcelt/tests/tandem-test.c
@@ -1,6 +1,6 @@
 /* (C) 2009 Gregory Maxwell
 
-   This test runs pink noise through the encoder and decoder many times 
+   This test runs pink noise through the encoder and decoder many times
    while feeding the output back into the input. It checks that after
    a number of cycles the energy has not increased or decreased by too
    large an amount.
@@ -8,14 +8,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -70,7 +70,7 @@
     if (bmin >= bmax)
         bmax = bmin + 8;
 
-    increment += (bmax - bmin) / 128; 
+    increment += (bmax - bmin) / 128;
 
     printf ("Testing asynchronous tandeming (%dHz, %dch, %d samples, %d - %d bytes).\n",
          rate, channels, frame_size, bmin, bmax);
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -5,14 +5,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -190,7 +190,7 @@
    ALLOC(y, N, celt_norm);
    ALLOC(iy, N, int);
    ALLOC(signx, N, opus_val16);
-   
+
    exp_rotation(X, N, 1, B, K, spread);
 
    /* Get rid of the sign */
@@ -278,7 +278,7 @@
       rshift = 1+celt_ilog2(K-pulsesLeft+i+1);
 #endif
       best_id = 0;
-      /* The squared magnitude term gets added anyway, so we might as well 
+      /* The squared magnitude term gets added anyway, so we might as well
          add it outside the loop */
       yy = ADD32(yy, 1);
       j=0;
@@ -302,7 +302,7 @@
             best_id = j;
          }
       } while (++j<N);
-      
+
       /* Updating the sums of the new pulse(s) */
       xy = ADD32(xy, EXTEND32(X[best_id]));
       /* We're multiplying y[j] by two so we don't have to do it here */
@@ -322,7 +322,7 @@
          iy[j] = -iy[j];
    } while (++j<N);
    encode_pulses(iy, N, K, enc);
-   
+
    if (resynth)
    {
       normalise_residual(iy, X, N, yy, gain);
--- a/libcelt/vq.h
+++ b/libcelt/vq.h
@@ -9,14 +9,14 @@
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
-   
+
    - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
-   
+
    - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
-   
+
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -37,9 +37,9 @@
 #include "entdec.h"
 #include "modes.h"
 
-/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of 
-  * the pitch and a combination of pulses such that its norm is still equal 
-  * to 1. This is the function that will typically require the most CPU. 
+/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of
+  * the pitch and a combination of pulses such that its norm is still equal
+  * to 1. This is the function that will typically require the most CPU.
  * @param x Residual signal to quantise/encode (returns quantised version)
  * @param W Perceptual weight to use when optimising (currently unused)
  * @param N Number of samples to encode