ref: 0449ee0fececb00d89afbb42505cb7e43ee67db0
parent: 9068bce4e795215b59d0145d560d27ef5bd79295
author: Yaowu Xu <[email protected]>
date: Fri May 31 07:18:23 EDT 2013
Fix a off-by-one bug in the calculation of maximum number of tiles in log2 scale. Change-Id: Id283d6e51a8b926015fd3fc631cdbfb4b8268d4a
--- a/vp9/common/vp9_tile_common.c
+++ b/vp9/common/vp9_tile_common.c
@@ -49,10 +49,15 @@
for (max_log2_n_tiles = 0;
(sb_cols >> max_log2_n_tiles) >= MIN_TILE_WIDTH_SBS;
max_log2_n_tiles++) {}
+ max_log2_n_tiles--;
+ if (max_log2_n_tiles < 0)
+ max_log2_n_tiles = 0;
+
for (min_log2_n_tiles = 0;
(MAX_TILE_WIDTH_SBS << min_log2_n_tiles) < sb_cols;
min_log2_n_tiles++) {}
+ assert(max_log2_n_tiles >= min_log2_n_tiles);
*min_log2_n_tiles_ptr = min_log2_n_tiles;
*delta_log2_n_tiles = max_log2_n_tiles - min_log2_n_tiles;
}