From a57e924f2e907af34dda301b6fcbedf14c698818 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sun, 27 Jun 2010 00:53:51 -0400 Subject: [PATCH] Removing some warnings --- libcelt/bands.c | 16 ++++++++-------- libcelt/bands.h | 2 +- libcelt/celt.c | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libcelt/bands.c b/libcelt/bands.c index 41b713b7..31d47885 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -469,7 +469,7 @@ static void haar1(celt_norm *X, int N0, int stride) in two and transmit the energy difference with the two half-bands. It can be called recursively so bands can end up being split in 8 parts. */ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_norm *Y, - int N, int b, int spread, int tf_change, celt_norm *lowband, int resynth, ec_enc *ec, + int N, int b, int spread, int tf_change, celt_norm *lowband, int resynth, void *ec, celt_int32 *remaining_bits, int LM, celt_norm *lowband_out, const celt_ener *bandE, int level) { int q; @@ -502,7 +502,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_ if (encode) { sign = x[0]<0; - ec_enc_bits(ec, sign, 1); + ec_enc_bits((ec_enc*)ec, sign, 1); } else { sign = ec_dec_bits((ec_dec*)ec, 1); } @@ -632,7 +632,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_ if (stereo || qb>9 || spread>1) { if (encode) - ec_enc_uint(ec, itheta, (1<eBands; @@ -922,7 +922,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, celt_norm *_X, ce Y = NULL; N = M*eBands[i+1]-M*eBands[i]; if (encode) - tell = ec_enc_tell(ec, BITRES); + tell = ec_enc_tell((ec_enc*)ec, BITRES); else tell = ec_dec_tell((ec_dec*)ec, BITRES); diff --git a/libcelt/bands.h b/libcelt/bands.h index db00ff27..89602694 100644 --- a/libcelt/bands.h +++ b/libcelt/bands.h @@ -85,7 +85,7 @@ int folding_decision(const CELTMode *m, celt_norm *X, celt_word16 *average, int * @param total_bits Total number of bits that can be used for the frame (including the ones already spent) * @param enc Entropy encoder */ -void quant_all_bands(int encode, const CELTMode *m, int start, celt_norm * X, celt_norm * Y, const celt_ener *bandE, int *pulses, int time_domain, int fold, int *tf_res, int resynth, int total_bits, ec_enc *enc, int M); +void quant_all_bands(int encode, const CELTMode *m, int start, celt_norm * X, celt_norm * Y, const celt_ener *bandE, int *pulses, int time_domain, int fold, int *tf_res, int resynth, int total_bits, void *enc, int M); void stereo_decision(const CELTMode *m, celt_norm * restrict X, int *stereo_mode, int len, int M); diff --git a/libcelt/celt.c b/libcelt/celt.c index db446442..19f4026f 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -455,10 +455,14 @@ static void encode_flags(ec_enc *enc, int intra_ener, int has_pitch, int shortBl flags |= shortBlocks ? FLAG_SHORT : 0; flags |= has_fold ? FLAG_FOLD : 0; for (i=0;i<8;i++) + { if (flags == (flaglist[i]&FLAG_MASK)) + { + flag_bits = flaglist[i]&0xf; break; + } + } celt_assert(i<8); - flag_bits = flaglist[i]&0xf; /*printf ("enc %d: %d %d %d %d\n", flag_bits, intra_ener, has_pitch, shortBlocks, has_fold);*/ if (i<2) ec_enc_uint(enc, flag_bits, 4);