Avoid left-shift by 32 on int32 in ectest.
This commit is contained in:
parent
8a670b19e1
commit
16901bfbbd
3 changed files with 4 additions and 3 deletions
|
@ -195,6 +195,7 @@ void ec_enc_bits(ec_enc *_this,opus_uint32 _fl,unsigned _bits){
|
||||||
int used;
|
int used;
|
||||||
window=_this->end_window;
|
window=_this->end_window;
|
||||||
used=_this->nend_bits;
|
used=_this->nend_bits;
|
||||||
|
celt_assert(_bits>0);
|
||||||
if(used+_bits>EC_WINDOW_SIZE){
|
if(used+_bits>EC_WINDOW_SIZE){
|
||||||
do{
|
do{
|
||||||
_this->error|=ec_write_byte_at_end(_this,(unsigned)window&EC_SYM_MAX);
|
_this->error|=ec_write_byte_at_end(_this,(unsigned)window&EC_SYM_MAX);
|
||||||
|
|
|
@ -73,7 +73,7 @@ void ec_enc_uint(ec_enc *_this,opus_uint32 _fl,opus_uint32 _ft);
|
||||||
/*Encodes a sequence of raw bits in the stream.
|
/*Encodes a sequence of raw bits in the stream.
|
||||||
_fl: The bits to encode.
|
_fl: The bits to encode.
|
||||||
_ftb: The number of bits to encode.
|
_ftb: The number of bits to encode.
|
||||||
This must be between 0 and 25, inclusive.*/
|
This must be between 1 and 25, inclusive.*/
|
||||||
void ec_enc_bits(ec_enc *_this,opus_uint32 _fl,unsigned _ftb);
|
void ec_enc_bits(ec_enc *_this,opus_uint32 _fl,unsigned _ftb);
|
||||||
|
|
||||||
/*Overwrites a few bits at the very start of an existing stream, after they
|
/*Overwrites a few bits at the very start of an existing stream, after they
|
||||||
|
|
|
@ -55,7 +55,7 @@ int main(int _argc,char **_argv){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*Testing encoding of raw bit values.*/
|
/*Testing encoding of raw bit values.*/
|
||||||
for(ftb=0;ftb<16;ftb++){
|
for(ftb=1;ftb<16;ftb++){
|
||||||
for(i=0;i<(1<<ftb);i++){
|
for(i=0;i<(1<<ftb);i++){
|
||||||
entropy+=ftb;
|
entropy+=ftb;
|
||||||
nbits=ec_tell(&enc);
|
nbits=ec_tell(&enc);
|
||||||
|
@ -84,7 +84,7 @@ int main(int _argc,char **_argv){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(ftb=0;ftb<16;ftb++){
|
for(ftb=1;ftb<16;ftb++){
|
||||||
for(i=0;i<(1<<ftb);i++){
|
for(i=0;i<(1<<ftb);i++){
|
||||||
sym=ec_dec_bits(&dec,ftb);
|
sym=ec_dec_bits(&dec,ftb);
|
||||||
if(sym!=(unsigned)i){
|
if(sym!=(unsigned)i){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue