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

Load only middle plane data for middle plane codebook training.

parent e5e53660
Branches
No related tags found
No related merge requests found
...@@ -306,7 +306,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm ...@@ -306,7 +306,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
} }
final int[] indices = quantizeVectorsImpl(quantizer, voxelData, options.getWorkerCount()); final int[] indices = quantizeVectorsImpl(quantizer, voxelData, options.getWorkerCount());
voxelLayersSizes[voxelLayerIndex] = writeHuffmanEncodedIndices(compressStream, huffman, indices); voxelLayersSizes[voxelLayerIndex] = writeHuffmanEncodedIndices(compressStream, huffman, indices);
stopwatch.stop(); stopwatch.stop();
if (options.isConsoleApplication()) { if (options.isConsoleApplication()) {
...@@ -395,7 +395,10 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm ...@@ -395,7 +395,10 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
int[][] loadDataForCodebookTraining(final IPlaneLoader planeLoader) throws ImageCompressionException { int[][] loadDataForCodebookTraining(final IPlaneLoader planeLoader) throws ImageCompressionException {
final int[][] trainingData; final int[][] trainingData;
if (options.getInputDataInfo().isPlaneIndexSet()) { if (options.getCodebookType() == CompressionOptions.CodebookType.MiddlePlane) {
final int middlePlaneIndex = (options.getInputDataInfo().getDimensions().getZ() / 2);
trainingData = planeLoader.loadVectorsFromPlaneRange(options, new Range<>(middlePlaneIndex, middlePlaneIndex + 1));
} else if (options.getInputDataInfo().isPlaneIndexSet()) {
reportStatusToListeners("VQ: Loading single plane data."); reportStatusToListeners("VQ: Loading single plane data.");
final int planeIndex = options.getInputDataInfo().getPlaneIndex(); final int planeIndex = options.getInputDataInfo().getPlaneIndex();
trainingData = planeLoader.loadVectorsFromPlaneRange(options, new Range<>(planeIndex, planeIndex + 1)); trainingData = planeLoader.loadVectorsFromPlaneRange(options, new Range<>(planeIndex, planeIndex + 1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment