Skip to content
Snippets Groups Projects
Commit 47aa203f authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Fixed cache file naming.

parent 8030f87f
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
Log("Saving cache file to %s", options.getOutputFile());
QuantizationValueCache cache = new QuantizationValueCache(options.getOutputFile());
try {
cache.saveQuantizationValues(options.getInputFile(), lbgResult.getCodebook());
cache.saveQuantizationValues(options.getInputFile(), lbgResult.getCodebook(), options.getVectorDimension());
} catch (IOException e) {
throw new ImageCompressionException("Unable to write cache.", e);
}
......
package azgracompress.quantization;
import azgracompress.data.V2i;
import azgracompress.quantization.vector.CodebookEntry;
import java.io.*;
......@@ -50,10 +51,12 @@ public class QuantizationValueCache {
}
}
public void saveQuantizationValues(final String trainFile, final CodebookEntry[] entries) throws IOException {
public void saveQuantizationValues(final String trainFile,
final CodebookEntry[] entries,
final V2i qVecDims) throws IOException {
final int codebookSize = entries.length;
final int entryWidth = entries[0].getWidth();
final int entryHeight = entries[0].getHeight();
final int entryWidth = qVecDims.getX();
final int entryHeight = qVecDims.getY();
final String cacheFile = getCacheFileForVectorValues(trainFile,
codebookSize,
entryWidth,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment