Commit 40c478a5 authored by Angie Chiang's avatar Angie Chiang
Browse files

Fix duplicated update of skip counts

This will fix the bitstream error when NEW_MULTISYMBOL is off
Change-Id: I49396c04f9415bd4ae21702fe9fc560246943aaa
parent d78f64b9
...@@ -2384,25 +2384,19 @@ void av1_update_and_record_txb_context(int plane, int block, int blk_row, ...@@ -2384,25 +2384,19 @@ void av1_update_and_record_txb_context(int plane, int block, int blk_row,
void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td, void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate, RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
int mi_row, int mi_col) { int mi_row, int mi_col) {
const AV1_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &td->mb; MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int ctx = av1_get_skip_context(xd);
const int skip_inc =
!segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
struct tokenize_b_args arg = { cpi, td, NULL, 0 }; struct tokenize_b_args arg = { cpi, td, NULL, 0 };
(void)rate; (void)rate;
(void)mi_row; (void)mi_row;
(void)mi_col; (void)mi_col;
if (mbmi->skip) { if (mbmi->skip) {
if (!dry_run) td->counts->skip[ctx][1] += skip_inc;
av1_reset_skip_context(xd, mi_row, mi_col, bsize); av1_reset_skip_context(xd, mi_row, mi_col, bsize);
return; return;
} }
if (!dry_run) { if (!dry_run) {
td->counts->skip[ctx][0] += skip_inc;
av1_foreach_transformed_block(xd, bsize, mi_row, mi_col, av1_foreach_transformed_block(xd, bsize, mi_row, mi_col,
av1_update_and_record_txb_context, &arg); av1_update_and_record_txb_context, &arg);
} else if (dry_run == DRY_RUN_NORMAL) { } else if (dry_run == DRY_RUN_NORMAL) {
......
...@@ -704,15 +704,11 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t, ...@@ -704,15 +704,11 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
#else #else
TOKENEXTRA *t_backup = *t; TOKENEXTRA *t_backup = *t;
#endif #endif
const int ctx = av1_get_skip_context(xd);
const int skip_inc =
!segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
struct tokenize_b_args arg = { cpi, td, t, 0 }; struct tokenize_b_args arg = { cpi, td, t, 0 };
int plane; int plane;
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return;
if (mbmi->skip) { if (mbmi->skip) {
if (!dry_run) td->counts->skip[ctx][1] += skip_inc;
av1_reset_skip_context(xd, mi_row, mi_col, bsize); av1_reset_skip_context(xd, mi_row, mi_col, bsize);
#if !CONFIG_LV_MAP #if !CONFIG_LV_MAP
if (dry_run) *t = t_backup; if (dry_run) *t = t_backup;
...@@ -720,7 +716,6 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t, ...@@ -720,7 +716,6 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
return; return;
} }
if (!dry_run) td->counts->skip[ctx][0] += skip_inc;
#if !CONFIG_LV_MAP #if !CONFIG_LV_MAP
else else
*t = t_backup; *t = t_backup;
...@@ -795,28 +790,21 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t, ...@@ -795,28 +790,21 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
void av1_tokenize_sb(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t, void av1_tokenize_sb(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate, RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
const int mi_row, const int mi_col) { const int mi_row, const int mi_col) {
const AV1_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &td->mb; MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int ctx = av1_get_skip_context(xd);
const int skip_inc =
!segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
struct tokenize_b_args arg = { cpi, td, t, 0 }; struct tokenize_b_args arg = { cpi, td, t, 0 };
if (mbmi->skip) { if (mbmi->skip) {
if (!dry_run) td->counts->skip[ctx][1] += skip_inc;
av1_reset_skip_context(xd, mi_row, mi_col, bsize); av1_reset_skip_context(xd, mi_row, mi_col, bsize);
return; return;
} }
if (!dry_run) { if (!dry_run) {
#if CONFIG_COEF_INTERLEAVE #if CONFIG_COEF_INTERLEAVE
td->counts->skip[ctx][0] += skip_inc;
av1_foreach_transformed_block_interleave(xd, bsize, tokenize_b, &arg); av1_foreach_transformed_block_interleave(xd, bsize, tokenize_b, &arg);
#else #else
int plane; int plane;
td->counts->skip[ctx][0] += skip_inc;
for (plane = 0; plane < MAX_MB_PLANE; ++plane) { for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
#if CONFIG_CB4X4 #if CONFIG_CB4X4
if (!is_chroma_reference(mi_row, mi_col, bsize, if (!is_chroma_reference(mi_row, mi_col, bsize,
......
Supports Markdown
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