Adds many syntactically unnecessary parentheses to silence MSVC C4554.
The object code is unchanged.
This commit is contained in:
parent
be89c39587
commit
75d27803d5
9 changed files with 30 additions and 30 deletions
|
@ -68,7 +68,7 @@ static int bitexact_log2tan(int isin,int icos)
|
||||||
ls=EC_ILOG(isin);
|
ls=EC_ILOG(isin);
|
||||||
icos<<=15-lc;
|
icos<<=15-lc;
|
||||||
isin<<=15-ls;
|
isin<<=15-ls;
|
||||||
return (ls-lc<<11)
|
return ((ls-lc)<<11)
|
||||||
+FRAC_MUL16(isin, FRAC_MUL16(isin, -2597) + 7932)
|
+FRAC_MUL16(isin, FRAC_MUL16(isin, -2597) + 7932)
|
||||||
-FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932);
|
-FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932);
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ void anti_collapse(const CELTMode *m, celt_norm *_X, unsigned char *collapse_mas
|
||||||
|
|
||||||
N0 = m->eBands[i+1]-m->eBands[i];
|
N0 = m->eBands[i+1]-m->eBands[i];
|
||||||
/* depth in 1/8 bits */
|
/* depth in 1/8 bits */
|
||||||
depth = (1+pulses[i])/(m->eBands[i+1]-m->eBands[i]<<LM);
|
depth = (1+pulses[i])/((m->eBands[i+1]-m->eBands[i])<<LM);
|
||||||
|
|
||||||
#ifdef FIXED_POINT
|
#ifdef FIXED_POINT
|
||||||
thresh = MULT16_32_Q15(QCONST16(0.5f, 15), MIN32(32767,SHR32(celt_exp2(-SHL16(depth, 10-BITRES)),1) ));
|
thresh = MULT16_32_Q15(QCONST16(0.5f, 15), MIN32(32767,SHR32(celt_exp2(-SHL16(depth, 10-BITRES)),1) ));
|
||||||
|
@ -903,14 +903,14 @@ static unsigned quant_band(int encode, const CELTMode *m, int i, celt_norm *X, c
|
||||||
{
|
{
|
||||||
imid = 0;
|
imid = 0;
|
||||||
iside = 32767;
|
iside = 32767;
|
||||||
fill &= (1<<B)-1<<B;
|
fill &= ((1<<B)-1)<<B;
|
||||||
delta = 16384;
|
delta = 16384;
|
||||||
} else {
|
} else {
|
||||||
imid = bitexact_cos(itheta);
|
imid = bitexact_cos(itheta);
|
||||||
iside = bitexact_cos(16384-itheta);
|
iside = bitexact_cos(16384-itheta);
|
||||||
/* This is the mid vs side allocation that minimizes squared error
|
/* This is the mid vs side allocation that minimizes squared error
|
||||||
in that band. */
|
in that band. */
|
||||||
delta = FRAC_MUL16(N-1<<7,bitexact_log2tan(iside,imid));
|
delta = FRAC_MUL16((N-1)<<7,bitexact_log2tan(iside,imid));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FIXED_POINT
|
#ifdef FIXED_POINT
|
||||||
|
|
|
@ -1025,7 +1025,7 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
|
||||||
was entirely empty, but to allow 0 in hybrid mode. */
|
was entirely empty, but to allow 0 in hybrid mode. */
|
||||||
vbr_bound = vbr_rate;
|
vbr_bound = vbr_rate;
|
||||||
max_allowed = IMIN(IMAX(tell==1?2:0,
|
max_allowed = IMIN(IMAX(tell==1?2:0,
|
||||||
vbr_rate+vbr_bound-st->vbr_reservoir>>(BITRES+3)),
|
(vbr_rate+vbr_bound-st->vbr_reservoir)>>(BITRES+3)),
|
||||||
nbAvailableBytes);
|
nbAvailableBytes);
|
||||||
if(max_allowed < nbAvailableBytes)
|
if(max_allowed < nbAvailableBytes)
|
||||||
{
|
{
|
||||||
|
@ -1404,9 +1404,9 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
|
||||||
result in the encoder running out of bits.
|
result in the encoder running out of bits.
|
||||||
The margin of 2 bytes ensures that none of the bust-prevention logic
|
The margin of 2 bytes ensures that none of the bust-prevention logic
|
||||||
in the decoder will have triggered so far. */
|
in the decoder will have triggered so far. */
|
||||||
min_allowed = (tell+total_boost+(1<<BITRES+3)-1>>(BITRES+3)) + 2 - nbFilledBytes;
|
min_allowed = ((tell+total_boost+(1<<(BITRES+3))-1)>>(BITRES+3)) + 2 - nbFilledBytes;
|
||||||
|
|
||||||
nbAvailableBytes = target+(1<<(BITRES+2))>>(BITRES+3);
|
nbAvailableBytes = (target+(1<<(BITRES+2)))>>(BITRES+3);
|
||||||
nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes);
|
nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes);
|
||||||
nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes;
|
nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes;
|
||||||
|
|
||||||
|
@ -1492,8 +1492,8 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const opus_val16 * pcm, int f
|
||||||
ALLOC(fine_priority, st->mode->nbEBands, int);
|
ALLOC(fine_priority, st->mode->nbEBands, int);
|
||||||
|
|
||||||
/* bits = packet size - where we are - safety*/
|
/* bits = packet size - where we are - safety*/
|
||||||
bits = ((opus_int32)nbCompressedBytes*8<<BITRES) - ec_tell_frac(enc) - 1;
|
bits = (((opus_int32)nbCompressedBytes*8)<<BITRES) - ec_tell_frac(enc) - 1;
|
||||||
anti_collapse_rsv = isTransient&&LM>=2&&bits>=(LM+2<<BITRES) ? (1<<BITRES) : 0;
|
anti_collapse_rsv = isTransient&&LM>=2&&bits>=((LM+2)<<BITRES) ? (1<<BITRES) : 0;
|
||||||
bits -= anti_collapse_rsv;
|
bits -= anti_collapse_rsv;
|
||||||
codedBands = compute_allocation(st->mode, st->start, st->end, offsets, cap,
|
codedBands = compute_allocation(st->mode, st->start, st->end, offsets, cap,
|
||||||
alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses,
|
alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses,
|
||||||
|
@ -2480,8 +2480,8 @@ int celt_decode_with_ec(CELTDecoder * restrict st, const unsigned char *data, in
|
||||||
alloc_trim = tell+(6<<BITRES) <= total_bits ?
|
alloc_trim = tell+(6<<BITRES) <= total_bits ?
|
||||||
ec_dec_icdf(dec, trim_icdf, 7) : 5;
|
ec_dec_icdf(dec, trim_icdf, 7) : 5;
|
||||||
|
|
||||||
bits = ((opus_int32)len*8<<BITRES) - ec_tell_frac(dec) - 1;
|
bits = (((opus_int32)len*8)<<BITRES) - ec_tell_frac(dec) - 1;
|
||||||
anti_collapse_rsv = isTransient&&LM>=2&&bits>=(LM+2<<BITRES) ? (1<<BITRES) : 0;
|
anti_collapse_rsv = isTransient&&LM>=2&&bits>=((LM+2)<<BITRES) ? (1<<BITRES) : 0;
|
||||||
bits -= anti_collapse_rsv;
|
bits -= anti_collapse_rsv;
|
||||||
codedBands = compute_allocation(st->mode, st->start, st->end, offsets, cap,
|
codedBands = compute_allocation(st->mode, st->start, st->end, offsets, cap,
|
||||||
alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses,
|
alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses,
|
||||||
|
|
|
@ -118,12 +118,12 @@ static inline opus_uint32 imusdiv32even(opus_uint32 _a,opus_uint32 _b,
|
||||||
celt_assert(_d>0);
|
celt_assert(_d>0);
|
||||||
celt_assert(_d<=54);
|
celt_assert(_d<=54);
|
||||||
shift=EC_ILOG(_d^_d-1);
|
shift=EC_ILOG(_d^_d-1);
|
||||||
inv=INV_TABLE[_d-1>>shift];
|
inv=INV_TABLE[(_d-1)>>shift];
|
||||||
shift--;
|
shift--;
|
||||||
one=1<<shift;
|
one=1<<shift;
|
||||||
mask=one-1;
|
mask=one-1;
|
||||||
return (_a*(_b>>shift)-(_c>>shift)+
|
return (_a*(_b>>shift)-(_c>>shift)+
|
||||||
(_a*(_b&mask)+one-(_c&mask)>>shift)-1)*inv&MASK32;
|
((_a*(_b&mask)+one-(_c&mask))>>shift)-1)*inv&MASK32;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SMALL_FOOTPRINT */
|
#endif /* SMALL_FOOTPRINT */
|
||||||
|
@ -356,7 +356,7 @@ static opus_uint32 ncwrs_urow(unsigned _n,unsigned _k,opus_uint32 *_u){
|
||||||
/*U(N,K) = ((2*N-1)*U(N,K-1)-U(N,K-2))/(K-1) + U(N,K-2)*/
|
/*U(N,K) = ((2*N-1)*U(N,K-1)-U(N,K-2))/(K-1) + U(N,K-2)*/
|
||||||
_u[k]=um2=imusdiv32even(n2m1,um1,um2,k-1)+um2;
|
_u[k]=um2=imusdiv32even(n2m1,um1,um2,k-1)+um2;
|
||||||
if(++k>=len)break;
|
if(++k>=len)break;
|
||||||
_u[k]=um1=imusdiv32odd(n2m1,um2,um1,k-1>>1)+um1;
|
_u[k]=um1=imusdiv32odd(n2m1,um2,um1,(k-1)>>1)+um1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* SMALL_FOOTPRINT */
|
#endif /* SMALL_FOOTPRINT */
|
||||||
|
@ -385,7 +385,7 @@ static inline void cwrsi2(int _k,opus_uint32 _i,int *_y){
|
||||||
s=-(_i>=p);
|
s=-(_i>=p);
|
||||||
_i-=p&s;
|
_i-=p&s;
|
||||||
yj=_k;
|
yj=_k;
|
||||||
_k=_i+1>>1;
|
_k=(_i+1)>>1;
|
||||||
p=_k?ucwrs2(_k):0;
|
p=_k?ucwrs2(_k):0;
|
||||||
_i-=p;
|
_i-=p;
|
||||||
yj-=_k;
|
yj-=_k;
|
||||||
|
@ -406,7 +406,7 @@ static void cwrsi3(int _k,opus_uint32 _i,int *_y){
|
||||||
yj=_k;
|
yj=_k;
|
||||||
/*Finds the maximum _k such that ucwrs3(_k)<=_i (tested for all
|
/*Finds the maximum _k such that ucwrs3(_k)<=_i (tested for all
|
||||||
_i<2147418113=U(3,32768)).*/
|
_i<2147418113=U(3,32768)).*/
|
||||||
_k=_i>0?isqrt32(2*_i-1)+1>>1:0;
|
_k=_i>0?(isqrt32(2*_i-1)+1)>>1:0;
|
||||||
p=_k?ucwrs3(_k):0;
|
p=_k?ucwrs3(_k):0;
|
||||||
_i-=p;
|
_i-=p;
|
||||||
yj-=_k;
|
yj-=_k;
|
||||||
|
@ -433,7 +433,7 @@ static void cwrsi4(int _k,opus_uint32 _i,int *_y){
|
||||||
kl=0;
|
kl=0;
|
||||||
kr=_k;
|
kr=_k;
|
||||||
for(;;){
|
for(;;){
|
||||||
_k=kl+kr>>1;
|
_k=(kl+kr)>>1;
|
||||||
p=_k?ucwrs4(_k):0;
|
p=_k?ucwrs4(_k):0;
|
||||||
if(p<_i){
|
if(p<_i){
|
||||||
if(_k>=kr)break;
|
if(_k>=kr)break;
|
||||||
|
|
|
@ -76,7 +76,7 @@ opus_uint32 ec_tell_frac(ec_ctx *_this){
|
||||||
encoder or decoder claims to have used 1 bit.*/
|
encoder or decoder claims to have used 1 bit.*/
|
||||||
nbits=_this->nbits_total<<BITRES;
|
nbits=_this->nbits_total<<BITRES;
|
||||||
l=EC_ILOG(_this->rng);
|
l=EC_ILOG(_this->rng);
|
||||||
r=_this->rng>>l-16;
|
r=_this->rng>>(l-16);
|
||||||
for(i=BITRES;i-->0;){
|
for(i=BITRES;i-->0;){
|
||||||
int b;
|
int b;
|
||||||
r=r*r>>15;
|
r=r*r>>15;
|
||||||
|
|
|
@ -114,7 +114,7 @@ static void ec_dec_normalize(ec_dec *_this){
|
||||||
/*Read the next value from the input.*/
|
/*Read the next value from the input.*/
|
||||||
_this->rem=ec_read_byte(_this);
|
_this->rem=ec_read_byte(_this);
|
||||||
/*Take the rest of the bits we need from this new symbol.*/
|
/*Take the rest of the bits we need from this new symbol.*/
|
||||||
sym=(sym<<EC_SYM_BITS|_this->rem)>>EC_SYM_BITS-EC_CODE_EXTRA;
|
sym=(sym<<EC_SYM_BITS|_this->rem)>>(EC_SYM_BITS-EC_CODE_EXTRA);
|
||||||
/*And subtract them from val, capped to be less than EC_CODE_TOP.*/
|
/*And subtract them from val, capped to be less than EC_CODE_TOP.*/
|
||||||
_this->val=(_this->val<<EC_SYM_BITS)+(EC_SYM_MAX&~sym)&EC_CODE_TOP-1;
|
_this->val=(_this->val<<EC_SYM_BITS)+(EC_SYM_MAX&~sym)&EC_CODE_TOP-1;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ void ec_dec_init(ec_dec *_this,unsigned char *_buf,opus_uint32 _storage){
|
||||||
_this->offs=0;
|
_this->offs=0;
|
||||||
_this->rng=1U<<EC_CODE_EXTRA;
|
_this->rng=1U<<EC_CODE_EXTRA;
|
||||||
_this->rem=ec_read_byte(_this);
|
_this->rem=ec_read_byte(_this);
|
||||||
_this->val=_this->rng-1-(_this->rem>>EC_SYM_BITS-EC_CODE_EXTRA);
|
_this->val=_this->rng-1-(_this->rem>>(EC_SYM_BITS-EC_CODE_EXTRA));
|
||||||
_this->error=0;
|
_this->error=0;
|
||||||
/*Normalize the interval.*/
|
/*Normalize the interval.*/
|
||||||
ec_dec_normalize(_this);
|
ec_dec_normalize(_this);
|
||||||
|
|
|
@ -103,7 +103,7 @@ static void ec_enc_normalize(ec_enc *_this){
|
||||||
while(_this->rng<=EC_CODE_BOT){
|
while(_this->rng<=EC_CODE_BOT){
|
||||||
ec_enc_carry_out(_this,(int)(_this->val>>EC_CODE_SHIFT));
|
ec_enc_carry_out(_this,(int)(_this->val>>EC_CODE_SHIFT));
|
||||||
/*Move the next-to-high-order symbol into the high-order position.*/
|
/*Move the next-to-high-order symbol into the high-order position.*/
|
||||||
_this->val=_this->val<<EC_SYM_BITS&EC_CODE_TOP-1;
|
_this->val=(_this->val<<EC_SYM_BITS)&EC_CODE_TOP-1;
|
||||||
_this->rng<<=EC_SYM_BITS;
|
_this->rng<<=EC_SYM_BITS;
|
||||||
_this->nbits_total+=EC_SYM_BITS;
|
_this->nbits_total+=EC_SYM_BITS;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ void ec_enc_patch_initial_bits(ec_enc *_this,unsigned _val,unsigned _nbits){
|
||||||
unsigned mask;
|
unsigned mask;
|
||||||
celt_assert(_nbits<=EC_SYM_BITS);
|
celt_assert(_nbits<=EC_SYM_BITS);
|
||||||
shift=EC_SYM_BITS-_nbits;
|
shift=EC_SYM_BITS-_nbits;
|
||||||
mask=(1<<_nbits)-1<<shift;
|
mask=((1<<_nbits)-1)<<shift;
|
||||||
if(_this->offs>0){
|
if(_this->offs>0){
|
||||||
/*The first byte has been finalized.*/
|
/*The first byte has been finalized.*/
|
||||||
_this->buf[0]=(unsigned char)(_this->buf[0]&~mask|_val<<shift);
|
_this->buf[0]=(unsigned char)(_this->buf[0]&~mask|_val<<shift);
|
||||||
|
@ -224,10 +224,10 @@ void ec_enc_patch_initial_bits(ec_enc *_this,unsigned _val,unsigned _nbits){
|
||||||
/*The first byte is still awaiting carry propagation.*/
|
/*The first byte is still awaiting carry propagation.*/
|
||||||
_this->rem=_this->rem&~mask|_val<<shift;
|
_this->rem=_this->rem&~mask|_val<<shift;
|
||||||
}
|
}
|
||||||
else if(_this->rng<=EC_CODE_TOP>>shift){
|
else if(_this->rng<=(EC_CODE_TOP>>shift)){
|
||||||
/*The renormalization loop has never been run.*/
|
/*The renormalization loop has never been run.*/
|
||||||
_this->val=_this->val&~((opus_uint32)mask<<EC_CODE_SHIFT)|
|
_this->val=_this->val&~((opus_uint32)mask<<EC_CODE_SHIFT)|
|
||||||
(opus_uint32)_val<<EC_CODE_SHIFT+shift;
|
(opus_uint32)_val<<(EC_CODE_SHIFT+shift);
|
||||||
}
|
}
|
||||||
/*The encoder hasn't even encoded _nbits of data yet.*/
|
/*The encoder hasn't even encoded _nbits of data yet.*/
|
||||||
else _this->error=-1;
|
else _this->error=-1;
|
||||||
|
@ -249,7 +249,7 @@ void ec_enc_done(ec_enc *_this){
|
||||||
/*We output the minimum number of bits that ensures that the symbols encoded
|
/*We output the minimum number of bits that ensures that the symbols encoded
|
||||||
thus far will be decoded correctly regardless of the bits that follow.*/
|
thus far will be decoded correctly regardless of the bits that follow.*/
|
||||||
l=EC_CODE_BITS-EC_ILOG(_this->rng);
|
l=EC_CODE_BITS-EC_ILOG(_this->rng);
|
||||||
msk=EC_CODE_TOP-1>>l;
|
msk=(EC_CODE_TOP-1)>>l;
|
||||||
end=_this->val+msk&~msk;
|
end=_this->val+msk&~msk;
|
||||||
if((end|msk)>=_this->val+_this->rng){
|
if((end|msk)>=_this->val+_this->rng){
|
||||||
l++;
|
l++;
|
||||||
|
@ -258,7 +258,7 @@ void ec_enc_done(ec_enc *_this){
|
||||||
}
|
}
|
||||||
while(l>0){
|
while(l>0){
|
||||||
ec_enc_carry_out(_this,(int)(end>>EC_CODE_SHIFT));
|
ec_enc_carry_out(_this,(int)(end>>EC_CODE_SHIFT));
|
||||||
end=end<<EC_SYM_BITS&EC_CODE_TOP-1;
|
end=(end<<EC_SYM_BITS)&EC_CODE_TOP-1;
|
||||||
l-=EC_SYM_BITS;
|
l-=EC_SYM_BITS;
|
||||||
}
|
}
|
||||||
/*If we have a buffered byte flush it into the output buffer.*/
|
/*If we have a buffered byte flush it into the output buffer.*/
|
||||||
|
|
|
@ -48,11 +48,11 @@ unsigned isqrt32(opus_uint32 _val){
|
||||||
The main idea is to search for the largest binary digit b such that
|
The main idea is to search for the largest binary digit b such that
|
||||||
(g+b)*(g+b) <= _val, and add it to the solution g.*/
|
(g+b)*(g+b) <= _val, and add it to the solution g.*/
|
||||||
g=0;
|
g=0;
|
||||||
bshift=EC_ILOG(_val)-1>>1;
|
bshift=(EC_ILOG(_val)-1)>>1;
|
||||||
b=1U<<bshift;
|
b=1U<<bshift;
|
||||||
do{
|
do{
|
||||||
opus_uint32 t;
|
opus_uint32 t;
|
||||||
t=((opus_uint32)g<<1)+b<<bshift;
|
t=(((opus_uint32)g<<1)+b)<<bshift;
|
||||||
if(t<=_val){
|
if(t<=_val){
|
||||||
g+=b;
|
g+=b;
|
||||||
_val-=t;
|
_val-=t;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
/*Bits to shift by to move a symbol into the high-order position.*/
|
/*Bits to shift by to move a symbol into the high-order position.*/
|
||||||
# define EC_CODE_SHIFT (EC_CODE_BITS-EC_SYM_BITS-1)
|
# define EC_CODE_SHIFT (EC_CODE_BITS-EC_SYM_BITS-1)
|
||||||
/*Carry bit of the high-order range symbol.*/
|
/*Carry bit of the high-order range symbol.*/
|
||||||
# define EC_CODE_TOP (((opus_uint32)1U)<<EC_CODE_BITS-1)
|
# define EC_CODE_TOP (((opus_uint32)1U)<<(EC_CODE_BITS-1))
|
||||||
/*Low-order bit of the high-order range symbol.*/
|
/*Low-order bit of the high-order range symbol.*/
|
||||||
# define EC_CODE_BOT (EC_CODE_TOP>>EC_SYM_BITS)
|
# define EC_CODE_BOT (EC_CODE_TOP>>EC_SYM_BITS)
|
||||||
/*The number of bits available for the last, partial symbol in the code field.*/
|
/*The number of bits available for the last, partial symbol in the code field.*/
|
||||||
|
|
|
@ -497,7 +497,7 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int
|
||||||
{
|
{
|
||||||
int extra_fine;
|
int extra_fine;
|
||||||
int extra_bits;
|
int extra_bits;
|
||||||
extra_fine = IMIN(excess >> stereo+BITRES, MAX_FINE_BITS-ebits[j]);
|
extra_fine = IMIN(excess>>(stereo+BITRES),MAX_FINE_BITS-ebits[j]);
|
||||||
ebits[j] += extra_fine;
|
ebits[j] += extra_fine;
|
||||||
extra_bits = extra_fine*C<<BITRES;
|
extra_bits = extra_fine*C<<BITRES;
|
||||||
fine_priority[j] = extra_bits >= excess-balance;
|
fine_priority[j] = extra_bits >= excess-balance;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue