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

Remove unneccessary casts to V3i from V3i.

parent bd189cc5
Branches
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm ...@@ -31,7 +31,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
LBGVectorQuantizer vqInitializer = new LBGVectorQuantizer(planeVectors, LBGVectorQuantizer vqInitializer = new LBGVectorQuantizer(planeVectors,
getCodebookSize(), getCodebookSize(),
options.getWorkerCount(), options.getWorkerCount(),
options.getQuantizationVector().toV3i()); options.getQuantizationVector());
LBGResult vqResult = vqInitializer.findOptimalCodebook(); LBGResult vqResult = vqInitializer.findOptimalCodebook();
return new VectorQuantizer(vqResult.getCodebook()); return new VectorQuantizer(vqResult.getCodebook());
} }
...@@ -77,13 +77,13 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm ...@@ -77,13 +77,13 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
if (!cacheManager.doesVQCacheExists(options.getInputDataInfo().getCacheFileName(), if (!cacheManager.doesVQCacheExists(options.getInputDataInfo().getCacheFileName(),
getCodebookSize(), getCodebookSize(),
options.getQuantizationVector().toV3i())) { options.getQuantizationVector())) {
trainAndSaveCodebook(); trainAndSaveCodebook();
} }
final VQCodebook codebook = cacheManager.loadVQCodebook(options.getInputDataInfo().getCacheFileName(), final VQCodebook codebook = cacheManager.loadVQCodebook(options.getInputDataInfo().getCacheFileName(),
getCodebookSize(), getCodebookSize(),
options.getQuantizationVector().toV3i()); options.getQuantizationVector());
if (codebook == null) { if (codebook == null) {
throw new ImageCompressionException("Failed to read quantization vectors from cache."); throw new ImageCompressionException("Failed to read quantization vectors from cache.");
...@@ -253,7 +253,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm ...@@ -253,7 +253,7 @@ public class VQImageCompressor extends CompressorDecompressorBase implements IIm
LBGVectorQuantizer vqInitializer = new LBGVectorQuantizer(trainingData, LBGVectorQuantizer vqInitializer = new LBGVectorQuantizer(trainingData,
getCodebookSize(), getCodebookSize(),
options.getWorkerCount(), options.getWorkerCount(),
options.getQuantizationVector().toV3i()); options.getQuantizationVector());
reportStatusToListeners("Starting LBG optimization."); reportStatusToListeners("Starting LBG optimization.");
vqInitializer.setStatusListener(this::reportStatusToListeners); vqInitializer.setStatusListener(this::reportStatusToListeners);
LBGResult lbgResult = vqInitializer.findOptimalCodebook(); LBGResult lbgResult = vqInitializer.findOptimalCodebook();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment