shithub: libvpx

Download patch

ref: 2e45ce1493a0dd6ff7bc13391b3600bfb9758aea
parent: ba7ea4456f175bb23e86456abf95da8256d17c09
author: Ronald S. Bultje <rsbultje@gmail.com>
date: Mon Oct 12 10:45:04 EDT 2015

vp10: update assertion/allocation for tokens.

We only write EOSB tokens if we write tokens (i.e. not for skip blocks),
and we write EOSB tokens per-plane instead of per block.

Change-Id: I8d7ee99f8ec50eb7ae809f9f9282c1c91dbf6537

--- a/vp10/encoder/encodeframe.c
+++ b/vp10/encoder/encodeframe.c
@@ -2423,7 +2423,7 @@
   }
 
   if (bsize == BLOCK_64X64) {
-    assert(tp_orig < *tp);
+    assert(tp_orig < *tp || (tp_orig == *tp && xd->mi[0]->mbmi.skip));
     assert(best_rdc.rate < INT_MAX);
     assert(best_rdc.dist < INT64_MAX);
   } else {
--- a/vp10/encoder/encoder.h
+++ b/vp10/encoder/encoder.h
@@ -572,8 +572,8 @@
   // 32x32 transform crossing a boundary at a multiple of 16.
   // mb_rows, cols are in units of 16 pixels. We assume 3 planes all at full
   // resolution. We assume up to 1 token per pixel, and then allow
-  // a head room of 4.
-  return mb_rows * mb_cols * (16 * 16 * 3 + 4);
+  // a head room of 1 EOSB token per 8x8 block per plane.
+  return mb_rows * mb_cols * (16 * 16 + 4) * 3;
 }
 
 // Get the allocated token size for a tile. It does the same calculation as in