Skip to content
Snippets Groups Projects
Commit 16901bfb authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Avoid left-shift by 32 on int32 in ectest.

parent 8a670b19
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ void ec_enc_bits(ec_enc *_this,opus_uint32 _fl,unsigned _bits){
int used;
window=_this->end_window;
used=_this->nend_bits;
celt_assert(_bits>0);
if(used+_bits>EC_WINDOW_SIZE){
do{
_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.
_fl: The 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);
/*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.*/
for(ftb=0;ftb<16;ftb++){
for(ftb=1;ftb<16;ftb++){
for(i=0;i<(1<<ftb);i++){
entropy+=ftb;
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++){
sym=ec_dec_bits(&dec,ftb);
if(sym!=(unsigned)i){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment