summaryrefslogtreecommitdiffstats
path: root/media/libwebp/dec/tree_dec.c
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-06-30 06:05:23 +0200
committerGitHub <noreply@github.com>2018-06-30 06:05:23 +0200
commit6b25f35f84960ddb7fbfc3b4df3f244e42bb4470 (patch)
treee7408959f9dd586159e3481120fa047f9c377b44 /media/libwebp/dec/tree_dec.c
parentb5b0b28441642f1c15b6ca0834bfca068bcbb154 (diff)
parent53407e7bf2d8a1a27efef4f15ec8032014273803 (diff)
downloadUXP-6b25f35f84960ddb7fbfc3b4df3f244e42bb4470.tar
UXP-6b25f35f84960ddb7fbfc3b4df3f244e42bb4470.tar.gz
UXP-6b25f35f84960ddb7fbfc3b4df3f244e42bb4470.tar.lz
UXP-6b25f35f84960ddb7fbfc3b4df3f244e42bb4470.tar.xz
UXP-6b25f35f84960ddb7fbfc3b4df3f244e42bb4470.zip
Merge pull request #566 from JustOff/PR_libwebp-1.0.0
Update libwebp to v1.0.0 + known security patches
Diffstat (limited to 'media/libwebp/dec/tree_dec.c')
-rw-r--r--media/libwebp/dec/tree_dec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libwebp/dec/tree_dec.c b/media/libwebp/dec/tree_dec.c
index 9e805f60f..581886025 100644
--- a/media/libwebp/dec/tree_dec.c
+++ b/media/libwebp/dec/tree_dec.c
@@ -11,15 +11,19 @@
//
// Author: Skal (pascal.massimino@gmail.com)
-#include "./vp8i_dec.h"
+#include "../dec/vp8i_dec.h"
#include "../utils/bit_reader_inl_utils.h"
+#if !defined(USE_GENERIC_TREE)
#if !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__)
// using a table is ~1-2% slower on ARM. Prefer the coded-tree approach then.
-#define USE_GENERIC_TREE
+#define USE_GENERIC_TREE 1 // ALTERNATE_CODE
+#else
+#define USE_GENERIC_TREE 0
#endif
+#endif // USE_GENERIC_TREE
-#ifdef USE_GENERIC_TREE
+#if (USE_GENERIC_TREE == 1)
static const int8_t kYModesIntra4[18] = {
-B_DC_PRED, 1,
-B_TM_PRED, 2,
@@ -317,7 +321,7 @@ static void ParseIntraMode(VP8BitReader* const br,
int x;
for (x = 0; x < 4; ++x) {
const uint8_t* const prob = kBModesProba[top[x]][ymode];
-#ifdef USE_GENERIC_TREE
+#if (USE_GENERIC_TREE == 1)
// Generic tree-parsing
int i = kYModesIntra4[VP8GetBit(br, prob[0])];
while (i > 0) {
@@ -335,7 +339,7 @@ static void ParseIntraMode(VP8BitReader* const br,
(!VP8GetBit(br, prob[6]) ? B_LD_PRED :
(!VP8GetBit(br, prob[7]) ? B_VL_PRED :
(!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED)));
-#endif // USE_GENERIC_TREE
+#endif // USE_GENERIC_TREE
top[x] = ymode;
}
memcpy(modes, top, 4 * sizeof(*top));
@@ -498,7 +502,7 @@ static const uint8_t
// Paragraph 9.9
-static const int kBands[16 + 1] = {
+static const uint8_t kBands[16 + 1] = {
0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
0 // extra entry as sentinel
};