WIP: extract the float-calculation of HuffmanCost from loop

new function: VP8FinalHuffmanCost()

Change-Id: I42102f8e5ef6d7a7af66490af77b7dc2048a9cb9
This commit is contained in:
skal
2014-04-14 17:57:26 +02:00
parent 8ff96a027a
commit b30a04cf11
2 changed files with 39 additions and 27 deletions

View File

@ -90,6 +90,13 @@ static WEBP_INLINE int VP8LHistogramNumCodes(int palette_code_bits) {
((palette_code_bits > 0) ? (1 << palette_code_bits) : 0);
}
// Used to finalized the Huffman cost:
// cnt_z / cnt_nz: counts the number of 0's and non-0's
// streak_{z,nz}_le3 / streak_{z,nz}_gt3: number of streaks larger than 3
// or less-or-equal than 3.
double VP8FinalHuffmanCost(int cnt_z, int streak_z_le3, int streak_z_gt3,
int cnt_nz, int streak_nz_le3, int streak_nz_gt3);
// Builds the histogram image.
int VP8LGetHistoImageSymbols(int xsize, int ysize,
const VP8LBackwardRefs* const refs,