More C89 fixes, making sure to include config.h from all source files.

This commit is contained in:
Jean-Marc Valin 2008-02-20 12:09:29 +11:00
parent a85657bd29
commit 02fa913c32
19 changed files with 85 additions and 5 deletions

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bitree.h" #include "bitree.h"
int ec_bitree_find_and_update(unsigned *_this,int _sz,int _split, int ec_bitree_find_and_update(unsigned *_this,int _sz,int _split,

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bitree.h" #include "bitree.h"
void ec_bitree_to_counts(unsigned *_this,int _sz,int _split){ void ec_bitree_to_counts(unsigned *_this,int _sz,int _split){

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bitrenc.h" #include "bitrenc.h"
void ec_bitree_update(unsigned *_this,int _sz,int _sym,int _val){ void ec_bitree_update(unsigned *_this,int _sz,int _sym,int _val){

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "os_support.h" #include "os_support.h"
#include "mdct.h" #include "mdct.h"
#include <math.h> #include <math.h>
@ -82,10 +86,11 @@ struct CELTEncoder {
CELTEncoder *celt_encoder_new(const CELTMode *mode) CELTEncoder *celt_encoder_new(const CELTMode *mode)
{ {
int i, N, B, C, N4; int i, N, B, C, N4;
CELTEncoder *st;
N = mode->mdctSize; N = mode->mdctSize;
B = mode->nbMdctBlocks; B = mode->nbMdctBlocks;
C = mode->nbChannels; C = mode->nbChannels;
CELTEncoder *st = celt_alloc(sizeof(CELTEncoder)); st = celt_alloc(sizeof(CELTEncoder));
st->mode = mode; st->mode = mode;
st->frame_size = B*N; st->frame_size = B*N;
@ -153,13 +158,15 @@ static float compute_mdcts(mdct_lookup *mdct_lookup, float *window, float *in, f
{ {
int i, c; int i, c;
float E = 1e-15; float E = 1e-15;
VARDECL(float *x);
VARDECL(float *tmp);
ALLOC(x, 2*N, float);
ALLOC(tmp, N, float);
for (c=0;c<C;c++) for (c=0;c<C;c++)
{ {
for (i=0;i<B;i++) for (i=0;i<B;i++)
{ {
int j; int j;
float x[2*N];
float tmp[N];
for (j=0;j<2*N;j++) for (j=0;j<2*N;j++)
{ {
x[j] = window[j]*in[C*i*N+C*j+c]; x[j] = window[j]*in[C*i*N+C*j+c];
@ -177,14 +184,16 @@ static float compute_mdcts(mdct_lookup *mdct_lookup, float *window, float *in, f
static void compute_inv_mdcts(mdct_lookup *mdct_lookup, float *window, float *X, float *out_mem, float *mdct_overlap, int N, int overlap, int B, int C) static void compute_inv_mdcts(mdct_lookup *mdct_lookup, float *window, float *X, float *out_mem, float *mdct_overlap, int N, int overlap, int B, int C)
{ {
int i, c, N4; int i, c, N4;
VARDECL(float *x);
VARDECL(float *tmp);
ALLOC(x, 2*N, float);
ALLOC(tmp, N, float);
N4 = (N-overlap)/2; N4 = (N-overlap)/2;
for (c=0;c<C;c++) for (c=0;c<C;c++)
{ {
for (i=0;i<B;i++) for (i=0;i<B;i++)
{ {
int j; int j;
float x[2*N];
float tmp[N];
/* De-interleaving the sub-frames */ /* De-interleaving the sub-frames */
for (j=0;j<N;j++) for (j=0;j<N;j++)
tmp[j] = X[C*B*j+C*i+c]; tmp[j] = X[C*B*j+C*i+c];

View file

@ -32,6 +32,11 @@
/* Functions for encoding and decoding pulse vectors. For more details, see: /* Functions for encoding and decoding pulse vectors. For more details, see:
http://people.xiph.org/~tterribe/notes/cwrs.html http://people.xiph.org/~tterribe/notes/cwrs.html
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include "cwrs.h" #include "cwrs.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "entcode.h" #include "entcode.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h> #include <stddef.h>
#include "entdec.h" #include "entdec.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "entenc.h" #include "entenc.h"

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "entenc.h" #include "entenc.h"
#include "entdec.h" #include "entdec.h"

View file

@ -42,6 +42,10 @@
and scaling in many places. and scaling in many places.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "mdct.h" #include "mdct.h"
#include "kiss_fft.h" #include "kiss_fft.h"
#include <math.h> #include <math.h>

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "celt.h" #include "celt.h"
#include "modes.h" #include "modes.h"
#include "rate.h" #include "rate.h"

View file

@ -20,6 +20,9 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "psy.h" #include "psy.h"
#include <math.h> #include <math.h>
#include "os_support.h" #include "os_support.h"

View file

@ -29,6 +29,9 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "quant_bands.h" #include "quant_bands.h"
#include "laplace.h" #include "laplace.h"

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "quant_pitch.h" #include "quant_pitch.h"
#include <math.h> #include <math.h>
#include "pgain_table.h" #include "pgain_table.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h> #include <stddef.h>
#include "entdec.h" #include "entdec.h"
#include "mfrngcod.h" #include "mfrngcod.h"

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h> #include <stddef.h>
#include "entenc.h" #include "entenc.h"
#include "mfrngcod.h" #include "mfrngcod.h"

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h> #include <math.h>
#include "modes.h" #include "modes.h"
#include "cwrs.h" #include "cwrs.h"

View file

@ -29,6 +29,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include "cwrs.h" #include "cwrs.h"