Skip to content
Snippets Groups Projects
Commit 32a1e6b6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

More fine energy tuning, compensation for N=2

parent fffae794
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,10 @@ static inline void interp_bits2pulses(const CELTMode *m, int start, int end, int
/* Offset for the number of fine bits compared to their "fair share" of total/N */
offset = N*C*(((m->logN[j] + logM)>>1)-FINE_OFFSET);
/* N=2 is the only point that doesn't match the curve */
if (N==2)
offset += N*C<<BITRES>>2;
/* Changing the offset for allocating the second and third fine energy bit */
if (bits[j] + offset < den*2<<BITRES)
offset += (m->logN[j] + logM)*N*C>>BITRES-1;
......
......@@ -40,7 +40,7 @@
#define LOG_MAX_PULSES 7
#define BITRES 3
#define FINE_OFFSET 19
#define FINE_OFFSET 21
#define QTHETA_OFFSET 6
#define QTHETA_OFFSET_STEREO 4
......
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