• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revision69078e8190a9a202168a6e380e4405fd9a3afa46 (tree)
Time2012-08-01 17:31:02
AuthorGwenole Beauchesne <gwenole.beauchesne@inte...>
CommiterGwenole Beauchesne

Log Message

tests: fix JPEG decoding test to match the latest API.

Fix bug in parsing Huffman DC table and also sync the code to match
the latest API change. In particular, pad the Huffman table with
zero to suit 4-byte boundaries.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit d4c88950dafefead1a775c0ae6636917e23339fd)

Change Summary

Incremental Difference

--- a/test/decode/tinyjpeg.c
+++ b/test/decode/tinyjpeg.c
@@ -325,11 +325,9 @@ static int parse_DHT(struct jdec_private *priv, const unsigned char *stream)
325325 Th = index & 0x0f;
326326 if (Tc) {
327327 memcpy(priv->HTAC[index & 0xf].bits, stream, 16);
328- priv->HTAC_valid[index & 0xf] = 1;
329328 }
330329 else {
331- memcpy(priv->HTDC[index & 0xf].bits, stream, 12);
332- priv->HTDC_valid[index & 0xf] = 1;
330+ memcpy(priv->HTDC[index & 0xf].bits, stream, 16);
333331 }
334332
335333 count = 0;
@@ -347,9 +345,11 @@ static int parse_DHT(struct jdec_private *priv, const unsigned char *stream)
347345
348346 if (Tc) {
349347 memcpy(priv->HTAC[index & 0xf].values, stream, count);
348+ priv->HTAC_valid[index & 0xf] = 1;
350349 }
351350 else {
352351 memcpy(priv->HTDC[index & 0xf].values, stream, count);
352+ priv->HTDC_valid[index & 0xf] = 1;
353353 }
354354
355355 length -= 1;
@@ -663,6 +663,8 @@ int tinyjpeg_decode(struct jdec_private *priv)
663663 sizeof(huffman_table.huffman_table[i].num_ac_codes));
664664 memcpy(huffman_table.huffman_table[i].ac_values, priv->HTAC[i].values,
665665 sizeof(huffman_table.huffman_table[i].ac_values));
666+ memset(huffman_table.huffman_table[i].pad, 0,
667+ sizeof(huffman_table.huffman_table[i].pad));
666668 }
667669
668670 va_status = vaCreateBuffer(va_dpy, context_id,