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

Don't try to write non-existent quantizer to compress stream.

parent e979652a
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
quantizer = loadQuantizerFromCache();
huffman = createHuffmanCoder(huffmanSymbols, quantizer.getFrequencies());
reportStatusToListeners("Cached quantizer with huffman coder created.");
writeQuantizerToCompressStream(quantizer, compressStream);
} else if (options.getCodebookType() == CompressionOptions.CodebookType.MiddlePlane) {
stopwatch.restart();
reportStatusToListeners("Training vector quantizer from middle plane.");
......@@ -175,8 +176,8 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
huffman = createHuffmanCoder(huffmanSymbols, quantizer.getFrequencies());
stopwatch.stop();
reportStatusToListeners("Middle plane codebook created in: " + stopwatch.getElapsedTimeString());
writeQuantizerToCompressStream(quantizer, compressStream);
}
writeQuantizerToCompressStream(quantizer, compressStream);
}
final int[] planeIndices = getPlaneIndicesForCompression(inputData);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment