From f304d5c8e7ac1a0fb8bb86c48de8a70194bd6123 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Tue, 7 Jun 2016 17:02:03 +0100 Subject: [PATCH] Zero segment counter before accumulating. The segment counts are computed as part of packing the bitstream, so they might have been computed already in the recode loop. Zero the accumulator to avoid double counting. This fixes some encoder/decoder mismatches. Change-Id: Ib7816034cbbb1db41101116b706302b02fad3a2c --- vp10/encoder/segmentation.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vp10/encoder/segmentation.c b/vp10/encoder/segmentation.c index 222dc0d6f..bb6e4c4a3 100644 --- a/vp10/encoder/segmentation.c +++ b/vp10/encoder/segmentation.c @@ -317,6 +317,9 @@ void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) { (void) xd; + // We are about to recompute all the segment counts, so zero the accumulators. + vp10_zero(cm->counts.seg); + // First of all generate stats regarding how well the last segment map // predicts this one for (tile_row = 0; tile_row < cm->tile_rows; tile_row++) {