Optimize lossless decoding for trivial(ARB) codes.

Optimize the decoding for region that have trivial literal codes.
The trivial literal is defined as huffman image with Red, Blue and Alpha
huffman trees with only single code values.
This speeds up lossless decoding by 3%

Change-Id: I0204949917836f74c0eb4ba5a7f4052a4797833b
This commit is contained in:
Vikas Arora
2014-09-12 09:06:35 -07:00
parent 924fcfd900
commit f9ced95a9b
2 changed files with 28 additions and 4 deletions

View File

@ -39,6 +39,11 @@ typedef struct {
typedef struct HTreeGroup HTreeGroup;
struct HTreeGroup {
HuffmanCode* htrees[HUFFMAN_CODES_PER_META_CODE];
int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha
// Symbols are trivial (have a single code).
uint32_t literal_arb; // If is_trivial_literal is true, this is the
// ARGB value of the pixel, with Green channel
// being set to zero.
};
// Creates the instance of HTreeGroup with specified number of tree-groups.