From 3819f11b28b6634c4bb27f22a7cf2ded055bcb2e Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Thu, 16 May 2013 13:30:00 -0700 Subject: [PATCH] Use b_width_log2_ in partition type parse Replace mi_width/height_log2 with b_width/height_log2 in partition type parsing at bit-stream writing stage. This allows parsing resolution at 4x4 block level and makes the 4x4/4x8/8x4 partition coding consistent with other superblock types. Change-Id: I7db3617ea042e0db2dc898999b0c323bff91a22f --- vp9/encoder/vp9_bitstream.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 3c234afd5..7e6419fb9 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -887,8 +887,8 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc, MACROBLOCKD *xd = &cpi->mb.e_mbd; const int mis = cm->mode_info_stride; int bwl, bhl; - int bw, bh; - int bsl = mi_width_log2(bsize), bs = (1 << bsl) / 2; + int bsl = b_width_log2(bsize); + int bs = (1 << bsl) / 4; // mode_info step for subsize int n; PARTITION_TYPE partition; BLOCK_SIZE_TYPE subsize; @@ -896,10 +896,8 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc, if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; - bwl = mi_width_log2(m->mbmi.sb_type); - bhl = mi_height_log2(m->mbmi.sb_type); - bw = 1 << bwl; - bh = 1 << bhl; + bwl = b_width_log2(m->mbmi.sb_type); + bhl = b_height_log2(m->mbmi.sb_type); // parse the partition type if ((bwl == bsl) && (bhl == bsl)) @@ -914,8 +912,6 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc, assert(0); #if CONFIG_AB4X4 - if (bsize == BLOCK_SIZE_SB8X8 && m->mbmi.sb_type < BLOCK_SIZE_SB8X8) - partition = PARTITION_SPLIT; if (bsize < BLOCK_SIZE_SB8X8) if (xd->ab_index != 0) return; @@ -943,13 +939,13 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc, break; case PARTITION_HORZ: write_modes_b(cpi, m, bc, tok, tok_end, mi_row, mi_col); - if ((mi_row + bh) < cm->mi_rows) - write_modes_b(cpi, m + bh * mis, bc, tok, tok_end, mi_row + bh, mi_col); + if ((mi_row + bs) < cm->mi_rows) + write_modes_b(cpi, m + bs * mis, bc, tok, tok_end, mi_row + bs, mi_col); break; case PARTITION_VERT: write_modes_b(cpi, m, bc, tok, tok_end, mi_row, mi_col); - if ((mi_col + bw) < cm->mi_cols) - write_modes_b(cpi, m + bw, bc, tok, tok_end, mi_row, mi_col + bw); + if ((mi_col + bs) < cm->mi_cols) + write_modes_b(cpi, m + bs, bc, tok, tok_end, mi_row, mi_col + bs); break; case PARTITION_SPLIT: for (n = 0; n < 4; n++) { -- 2.40.0