Commit 59228957 authored by Urvang Joshi's avatar Urvang Joshi

Fix build with --enable-palette.

Signature of aom_read_xxx function changed recently:
https://aomedia-review.googlesource.com/#/c/3520/
So, updated the palette code to call those functions with the additional
parameter.

Change-Id: I364faee2e002f2bb7ac889ee15c5f14b0d857128
parent c1a87fad
...@@ -343,7 +343,7 @@ static INLINE int read_uniform(aom_reader *r, int n) { ...@@ -343,7 +343,7 @@ static INLINE int read_uniform(aom_reader *r, int n) {
const int v = aom_read_literal(r, l - 1, ACCT_STR); const int v = aom_read_literal(r, l - 1, ACCT_STR);
assert(l != 0); assert(l != 0);
return (v < m) ? v : ((v << 1) - m + aom_read_literal(r, 1), ACCT_STR); return (v < m) ? v : ((v << 1) - m + aom_read_literal(r, 1, ACCT_STR));
} }
#endif // CONFIG_EXT_INTRA || CONFIG_PALETTE #endif // CONFIG_EXT_INTRA || CONFIG_PALETTE
...@@ -364,32 +364,34 @@ static void read_palette_mode_info(AV1_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -364,32 +364,34 @@ static void read_palette_mode_info(AV1_COMMON *const cm, MACROBLOCKD *const xd,
if (left_mi) if (left_mi)
palette_ctx += (left_mi->mbmi.palette_mode_info.palette_size[0] > 0); palette_ctx += (left_mi->mbmi.palette_mode_info.palette_size[0] > 0);
if (aom_read( if (aom_read(
r, r, av1_default_palette_y_mode_prob[bsize - BLOCK_8X8][palette_ctx],
av1_default_palette_y_mode_prob[bsize - BLOCK_8X8][palette_ctx])) { ACCT_STR)) {
pmi->palette_size[0] = pmi->palette_size[0] =
aom_read_tree(r, av1_palette_size_tree, aom_read_tree(r, av1_palette_size_tree,
av1_default_palette_y_size_prob[bsize - BLOCK_8X8]) + av1_default_palette_y_size_prob[bsize - BLOCK_8X8],
ACCT_STR) +
2; 2;
n = pmi->palette_size[0]; n = pmi->palette_size[0];
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
pmi->palette_colors[i] = aom_read_literal(r, cm->bit_depth); pmi->palette_colors[i] = aom_read_literal(r, cm->bit_depth, ACCT_STR);
xd->plane[0].color_index_map[0] = read_uniform(r, n); xd->plane[0].color_index_map[0] = read_uniform(r, n);
assert(xd->plane[0].color_index_map[0] < n); assert(xd->plane[0].color_index_map[0] < n);
} }
} }
if (mbmi->uv_mode == DC_PRED) { if (mbmi->uv_mode == DC_PRED) {
if (aom_read(r, if (aom_read(r, av1_default_palette_uv_mode_prob[pmi->palette_size[0] > 0],
av1_default_palette_uv_mode_prob[pmi->palette_size[0] > 0])) { ACCT_STR)) {
pmi->palette_size[1] = pmi->palette_size[1] =
aom_read_tree(r, av1_palette_size_tree, aom_read_tree(r, av1_palette_size_tree,
av1_default_palette_uv_size_prob[bsize - BLOCK_8X8]) + av1_default_palette_uv_size_prob[bsize - BLOCK_8X8],
ACCT_STR) +
2; 2;
n = pmi->palette_size[1]; n = pmi->palette_size[1];
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
pmi->palette_colors[PALETTE_MAX_SIZE + i] = pmi->palette_colors[PALETTE_MAX_SIZE + i] =
aom_read_literal(r, cm->bit_depth); aom_read_literal(r, cm->bit_depth, ACCT_STR);
pmi->palette_colors[2 * PALETTE_MAX_SIZE + i] = pmi->palette_colors[2 * PALETTE_MAX_SIZE + i] =
aom_read_literal(r, cm->bit_depth); aom_read_literal(r, cm->bit_depth, ACCT_STR);
} }
xd->plane[1].color_index_map[0] = read_uniform(r, n); xd->plane[1].color_index_map[0] = read_uniform(r, n);
assert(xd->plane[1].color_index_map[0] < n); assert(xd->plane[1].color_index_map[0] < n);
......
...@@ -302,7 +302,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, ...@@ -302,7 +302,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
color_ctx = color_ctx =
av1_get_palette_color_context(color_map, cols, i, j, n, color_order); av1_get_palette_color_context(color_map, cols, i, j, n, color_order);
color_idx = aom_read_tree(r, av1_palette_color_tree[n - 2], color_idx = aom_read_tree(r, av1_palette_color_tree[n - 2],
prob[n - 2][color_ctx]); prob[n - 2][color_ctx], ACCT_STR);
assert(color_idx >= 0 && color_idx < n); assert(color_idx >= 0 && color_idx < n);
color_map[i * cols + j] = color_order[color_idx]; color_map[i * cols + j] = color_order[color_idx];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment