ref: 445720f9133a449927e3998edb6e7dbe1bb29a4e
parent: 527db5c4501a7c03b26ff1ab365e74da50250e90
author: Jean-Marc Valin <[email protected]>
date: Tue Jun 2 03:59:32 EDT 2009
It is no longer necessary to have a minimum of one bit for fine energy allocation
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -115,15 +115,12 @@
{
int N, d;
int offset;
- int min_bits=0;
- if (bits[j] >= C<<BITRES)
- min_bits = 1;
N=m->eBands[j+1]-m->eBands[j];
d=C*N<<BITRES;
offset = 50 - log2_frac(N, 4);
/* Offset for the number of fine bits compared to their "fair share" of total/N */
- ebits[j] = IMAX(min_bits, (bits[j]-offset*N*C+(d>>1))/d);
+ ebits[j] = (bits[j]-offset*N*C+(d>>1))/d;
/* Make sure not to bust */
if (C*ebits[j] > (bits[j]>>BITRES))