From d69e36ec59da88f67bfb7754943efc42fc642ab6 Mon Sep 17 00:00:00 2001 From: Vikas Arora Date: Wed, 12 Nov 2014 15:21:29 -0800 Subject: [PATCH] Remove TODOs from lossless encoder code. histogram.c: - Verified (earlier) that there's low correlation between Red & Blue colors (particularly after applying Cross-color transform). The Bin based histogram merge, bins on three entropies viz literal, red & blue symbols. Removing either of blue or red increases the compression density. So keeping the bins for red & blue sybmols. - Keeping the compact bins method as-is. This way it's simpler to read. huffman_encode.h: Added field comments for struct HuffmanTree and removed the TODO. Change-Id: Ia76f7bc730079d1b3b644038c5d9931db3797f0e --- src/enc/histogram.c | 3 --- src/utils/huffman_encode.h | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/enc/histogram.c b/src/enc/histogram.c index e19ff805..43f78271 100644 --- a/src/enc/histogram.c +++ b/src/enc/histogram.c @@ -435,7 +435,6 @@ static int GetBinIdForEntropy(double min, double max, double val) { return (int)(NUM_PARTITIONS * delta / range); } -// TODO(vikasa): Evaluate, if there's any correlation between red & blue. static int GetHistoBinIndex( const VP8LHistogram* const h, const DominantCostRange* const c) { const int bin_id = @@ -524,8 +523,6 @@ static void HistogramAnalyzeEntropyBin( // Compact the histogram set by moving the valid one left in the set to the // head and moving the ones that have been merged to other histograms towards // the end. -// TODO(vikasa): Evaluate if this method can be avoided by altering the code -// logic of HistogramCombineEntropyBin main loop. static void HistogramCompactBins(VP8LHistogramSet* const image_histo) { int start = 0; int end = image_histo->size - 1; diff --git a/src/utils/huffman_encode.h b/src/utils/huffman_encode.h index 91aa18f4..a1571651 100644 --- a/src/utils/huffman_encode.h +++ b/src/utils/huffman_encode.h @@ -34,10 +34,9 @@ typedef struct { } HuffmanTreeCode; // Struct to represent the Huffman tree. -// TODO(vikasa): Add comment for the fields of the Struct. typedef struct { - uint32_t total_count_; - int value_; + uint32_t total_count_; // Symbol frequency. + int value_; // Symbol value. int pool_index_left_; // Index for the left sub-tree. int pool_index_right_; // Index for the right sub-tree. } HuffmanTree;