some microtuning

This commit is contained in:
Arndt Brenschede 2019-07-20 10:10:51 +02:00
parent d963814d78
commit 2213d4f7fc
9 changed files with 278 additions and 149 deletions

View file

@ -502,7 +502,7 @@ public final class MicroCache2 extends MicroCache
}
if ( pass == 3 )
{
return bc.getEncodedLength();
return bc.closeAndGetEncodedLength();
}
}
}

View file

@ -137,7 +137,7 @@ public final class TagValueCoder
}
byte[] res;
int len = ctx.getEncodedLength();
int len = ctx.closeAndGetEncodedLength();
if ( validator == null )
{
res = new byte[len];

View file

@ -20,6 +20,7 @@ public class StatCoderContextTest
ctx.encodeNoisyNumber( i, noisybits );
}
}
ctx.closeAndGetEncodedLength();
ctx = new StatCoderContext( ab );
for ( int noisybits = 1; noisybits < 12; noisybits++ )
@ -47,6 +48,7 @@ public class StatCoderContextTest
ctx.encodeNoisyDiff( i, noisybits );
}
}
ctx.closeAndGetEncodedLength();
ctx = new StatCoderContext( ab );
for ( int noisybits = 0; noisybits < 12; noisybits++ )
@ -74,6 +76,7 @@ public class StatCoderContextTest
ctx.encodePredictedValue( value, predictor );
}
}
ctx.closeAndGetEncodedLength();
ctx = new StatCoderContext( ab );
for ( int value = -100; value < 100; value += 5 )
@ -111,6 +114,7 @@ public class StatCoderContextTest
StatCoderContext ctx = new StatCoderContext( ab );
ctx.encodeSortedArray( values, 0, size, 0x08000000, 0 );
ctx.closeAndGetEncodedLength();
ctx = new StatCoderContext( ab );
int[] decodedValues = new int[size];