Documentation fixes and a couple of other minor edits.

This commit is contained in:
Timothy B. Terriberry 2007-12-11 13:25:00 +11:00 committed by Jean-Marc Valin
parent 9d35ccdaea
commit d710177d0a
7 changed files with 37 additions and 26 deletions

View file

@ -41,15 +41,18 @@
/*Outputs a symbol, with a carry bit.
If there is a potential to propogate a carry over several symbols, they are
If there is a potential to propagate a carry over several symbols, they are
buffered until it can be determined whether or not an actual carry will
occur.
If the counter for the buffered symbols overflows, then the range is
truncated to force a carry to occur, towards whichever side maximizes the
remaining range.*/
If the counter for the buffered symbols overflows, then the stream becomes
undecodable.
This gives a theoretical limit of a few billion symbols in a single packet on
32-bit systems.
The alternative is to truncate the range in order to force a carry, but
requires similar carry tracking in the decoder, needlessly slowing it down.*/
static void ec_enc_carry_out(ec_enc *_this,int _c){
if(_c!=EC_SYM_MAX){
/*No further carry propogation possible, flush buffer.*/
/*No further carry propagation possible, flush buffer.*/
int carry;
carry=_c>>EC_SYM_BITS;
/*Don't output a byte on the first write.
@ -110,7 +113,7 @@ void ec_enc_done(ec_enc *_this){
msk=EC_CODE_TOP-1;
do{
msk>>=1;
end=(_this->low+msk)&~msk|msk+1;
end=_this->low+msk&~msk|msk+1;
}
while(end-_this->low>=_this->rng);
}