From b7559258a45e4ad67cc492ca02e3c45319bd843e Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Mon, 8 Jul 2013 14:54:04 -0700 Subject: Using mi_cols instead of mb_cols. Eliminating usage of mb-units, switching to mi-units. Adding ALIGN_POWER_OF_TWO macro. Change-Id: I2491c969f713207c062011878b57e4e531818607 --- vp9/encoder/vp9_bitstream.c | 4 ++-- vp9/encoder/vp9_encodeframe.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 26456e021..530c9b107 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1476,8 +1476,8 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) { unsigned char *data_ptr = cx_data + header_bc.pos; TOKENEXTRA *tok[4][1 << 6], *tok_end; - vpx_memset(cpi->common.above_seg_context, 0, sizeof(PARTITION_CONTEXT) * - mi_cols_aligned_to_sb(&cpi->common)); + vpx_memset(pc->above_seg_context, 0, sizeof(PARTITION_CONTEXT) * + mi_cols_aligned_to_sb(pc->mi_cols)); tok[0][0] = cpi->tok; for (tile_row = 0; tile_row < pc->tile_rows; tile_row++) { if (tile_row) { diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 1a42961b5..3d3079a9f 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1690,9 +1690,10 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp, } static void init_encode_frame_mb_context(VP9_COMP *cpi) { - MACROBLOCK * const x = &cpi->mb; - VP9_COMMON * const cm = &cpi->common; - MACROBLOCKD * const xd = &x->e_mbd; + MACROBLOCK *const x = &cpi->mb; + VP9_COMMON *const cm = &cpi->common; + MACROBLOCKD *const xd = &x->e_mbd; + const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols); x->act_zbin_adj = 0; cpi->seg0_idx = 0; @@ -1735,11 +1736,10 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) { // Note: this memset assumes above_context[0], [1] and [2] // are allocated as part of the same buffer. - vpx_memset( - cm->above_context[0], 0, - sizeof(ENTROPY_CONTEXT) * 2 * MAX_MB_PLANE * mi_cols_aligned_to_sb(cm)); + vpx_memset(cm->above_context[0], 0, + sizeof(ENTROPY_CONTEXT) * 2 * MAX_MB_PLANE * aligned_mi_cols); vpx_memset(cm->above_seg_context, 0, - sizeof(PARTITION_CONTEXT) * mi_cols_aligned_to_sb(cm)); + sizeof(PARTITION_CONTEXT) * aligned_mi_cols); } static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { -- cgit v1.2.3