summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-06-18 13:54:06 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-06-18 16:25:16 +0200
commit54b10025d4c153c5be2c9415975afd9f8798646e (patch)
tree2916fbe5b95295d68f2f3296eb323c85d3cd3350
parentda40f0857bb0f5f230456b3d3339a71cd3947a80 (diff)
jpeg: mark default Huffman table as valid.
When no Huffman table is defined in the JPEG segments, then the default Huffman tables are used, but values were not marked as valid. Fixed this to notify HW decoder that it needs to load the default tables. Note: this is not specifically needed to be handled at the application level. The driver also ought to generate default tables, should the HW decoder require so and no table was provided from the application. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--test/decode/tinyjpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/decode/tinyjpeg.c b/test/decode/tinyjpeg.c
index fe9435b..1d3205f 100644
--- a/test/decode/tinyjpeg.c
+++ b/test/decode/tinyjpeg.c
@@ -158,8 +158,10 @@ static int build_default_huffman_tables(struct jdec_private *priv)
return 0;
for (i = 0; i < 4; i++) {
+ priv->HTDC_valid[i] = 1;
memcpy(priv->HTDC[i].bits, default_huffman_table_param.huffman_table[i].num_dc_codes, 16);
memcpy(priv->HTDC[i].values, default_huffman_table_param.huffman_table[i].dc_values, 16);
+ priv->HTAC_valid[i] = 1;
memcpy(priv->HTAC[i].bits, default_huffman_table_param.huffman_table[i].num_ac_codes, 16);
memcpy(priv->HTAC[i].values, default_huffman_table_param.huffman_table[i].ac_values, 256);
}