diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index a1dbd3e857ee800a226f0f07556ad17ffe18638b..d05be990d72c2439a9be06bbe0007980b7990fdd 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -2105,11 +2105,10 @@ int vp9_get_coef_context(const int *scan, const int *neighbors, int nb_pad, uint8_t *token_cache, int c, int l) { int eob = l; assert(nb_pad == MAX_NEIGHBORS); - if (c == eob - 1) { + if (c == eob) { return 0; } else { int ctx; - c++; assert(neighbors[MAX_NEIGHBORS * c + 0] >= 0); if (neighbors[MAX_NEIGHBORS * c + 1] >= 0) { ctx = (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] + diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c index b6eec373efd1116c9df8a75dd18b6fc79bce4641..a7440502fd68fb14d1787634943e236b7b63732a 100644 --- a/vp9/decoder/vp9_detokenize.c +++ b/vp9/decoder/vp9_detokenize.c @@ -69,7 +69,7 @@ static int get_signed(BOOL_DECODER *br, int value_to_sign) { [pt][token]++; \ token_cache[c] = token; \ pt = vp9_get_coef_context(scan, nb, pad, token_cache, \ - c, default_eob); \ + c + 1, default_eob); \ } while (0) #if CONFIG_CODE_NONZEROCOUNT diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index ad9b96050434d68e625a9bf6b6c96900abe7da8f..0083e8ae1a5000b5a547afe276ad2ad1b269e8f3 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -595,7 +595,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, [get_coef_band(scan, tx_size, c)] [pt][0], 1); #endif - pt = vp9_get_coef_context(scan, nb, pad, token_cache, c, default_eob); + pt = vp9_get_coef_context(scan, nb, pad, token_cache, c + 1, default_eob); } #if CONFIG_CODE_NONZEROCOUNT cost += nzc_cost[nzc]; diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index 6e2b8474d7c0874a2835d63da2106529895fb801..21401d1759c598c2ae41c4377a07f730d83a1853 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -291,7 +291,7 @@ static void tokenize_b(VP9_COMP *cpi, #endif token_cache[c] = token; - pt = vp9_get_coef_context(scan, nb, pad, token_cache, c, default_eob); + pt = vp9_get_coef_context(scan, nb, pad, token_cache, c + 1, default_eob); ++t; } while (c < eob && ++c < seg_eob); #if CONFIG_CODE_NONZEROCOUNT