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

Tuning the allocation trim

parent c40addcb
No related branches found
No related tags found
No related merge requests found
......@@ -572,11 +572,14 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
trim_index-=3;
else if (sum > QCONST16(.92,10))
trim_index-=2;
else if (sum > QCONST16(.75,10))
else if (sum > QCONST16(.8,10))
trim_index-=1;
else if (sum < QCONST16(.4,10))
trim_index+=1;
}
#if 0
float diff=0;
int c;
for (c=0;c<C;c++)
{
for (i=0;i<nbEBands-1;i++)
......@@ -590,8 +593,8 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
trim_index--;
if (diff > 8)
trim_index--;
/*if (diff < -10)
trim_index++;*/
if (diff < -4)
trim_index++;
#endif
if (trim_index<0)
trim_index = 0;
......
......@@ -278,8 +278,10 @@ int compute_allocation(const CELTMode *m, int start, int end, int *offsets, int
ALLOC(thresh, len, int);
ALLOC(trim_offset, len, int);
/* Below this threshold, we don't allocate any PVQ bits */
for (j=start;j<end;j++)
thresh[j] = 3*(C*(m->eBands[j+1]-m->eBands[j])<<LM<<BITRES)>>3;
/* Tilt of the allocation curve */
for (j=start;j<end;j++)
trim_offset[j] = C*(m->eBands[j+1]-m->eBands[j])*(alloc_trim-3)*(m->nbEBands-j-1)
<<(LM+BITRES)>>5;
......
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