Commit c849eaca authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Use b_width/height_log2 instead of mb_ where appropriate.

Basic assumption: when talking about transform units, use b_; when
talking about macroblock indices, use mb_.

Change-Id: Ifd163f595d4924ff892de4eb0401ccd56dc81884
parent e40a7690
...@@ -574,12 +574,12 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) { ...@@ -574,12 +574,12 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
// is smaller than the prediction size // is smaller than the prediction size
TX_TYPE tx_type = DCT_DCT; TX_TYPE tx_type = DCT_DCT;
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int wb = mb_width_log2(sb_type), hb = mb_height_log2(sb_type); const int wb = b_width_log2(sb_type), hb = b_height_log2(sb_type);
#if !USE_ADST_FOR_SB #if !USE_ADST_FOR_SB
if (sb_type > BLOCK_SIZE_MB16X16) if (sb_type > BLOCK_SIZE_MB16X16)
return tx_type; return tx_type;
#endif #endif
if (ib >= (16 << (wb + hb))) // no chroma adst if (ib >= (1 << (wb + hb))) // no chroma adst
return tx_type; return tx_type;
if (xd->lossless) if (xd->lossless)
return DCT_DCT; return DCT_DCT;
...@@ -630,7 +630,7 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) { ...@@ -630,7 +630,7 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
xd->q_index < ACTIVE_HT) { xd->q_index < ACTIVE_HT) {
#if USE_ADST_FOR_I16X16_4X4 #if USE_ADST_FOR_I16X16_4X4
#if USE_ADST_PERIPHERY_ONLY #if USE_ADST_PERIPHERY_ONLY
const int hmax = 4 << wb; const int hmax = 1 << wb;
tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode)); tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode));
#if USE_ADST_FOR_REMOTE_EDGE #if USE_ADST_FOR_REMOTE_EDGE
if ((ib & (hmax - 1)) != 0 && ib >= hmax) if ((ib & (hmax - 1)) != 0 && ib >= hmax)
...@@ -663,12 +663,12 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) { ...@@ -663,12 +663,12 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) {
// is smaller than the prediction size // is smaller than the prediction size
TX_TYPE tx_type = DCT_DCT; TX_TYPE tx_type = DCT_DCT;
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int wb = mb_width_log2(sb_type), hb = mb_height_log2(sb_type); const int wb = b_width_log2(sb_type), hb = b_height_log2(sb_type);
#if !USE_ADST_FOR_SB #if !USE_ADST_FOR_SB
if (sb_type > BLOCK_SIZE_MB16X16) if (sb_type > BLOCK_SIZE_MB16X16)
return tx_type; return tx_type;
#endif #endif
if (ib >= (16 << (wb + hb))) // no chroma adst if (ib >= (1 << (wb + hb))) // no chroma adst
return tx_type; return tx_type;
if (xd->mode_info_context->mbmi.mode == I8X8_PRED && if (xd->mode_info_context->mbmi.mode == I8X8_PRED &&
xd->q_index < ACTIVE_HT8) { xd->q_index < ACTIVE_HT8) {
...@@ -681,7 +681,7 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) { ...@@ -681,7 +681,7 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) {
xd->q_index < ACTIVE_HT8) { xd->q_index < ACTIVE_HT8) {
#if USE_ADST_FOR_I16X16_8X8 #if USE_ADST_FOR_I16X16_8X8
#if USE_ADST_PERIPHERY_ONLY #if USE_ADST_PERIPHERY_ONLY
const int hmax = 4 << wb; const int hmax = 1 << wb;
tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode)); tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode));
#if USE_ADST_FOR_REMOTE_EDGE #if USE_ADST_FOR_REMOTE_EDGE
if ((ib & (hmax - 1)) != 0 && ib >= hmax) if ((ib & (hmax - 1)) != 0 && ib >= hmax)
...@@ -712,19 +712,19 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) { ...@@ -712,19 +712,19 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) {
static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd, int ib) { static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd, int ib) {
TX_TYPE tx_type = DCT_DCT; TX_TYPE tx_type = DCT_DCT;
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int wb = mb_width_log2(sb_type), hb = mb_height_log2(sb_type); const int wb = b_width_log2(sb_type), hb = b_height_log2(sb_type);
#if !USE_ADST_FOR_SB #if !USE_ADST_FOR_SB
if (sb_type > BLOCK_SIZE_MB16X16) if (sb_type > BLOCK_SIZE_MB16X16)
return tx_type; return tx_type;
#endif #endif
if (ib >= (16 << (wb + hb))) if (ib >= (1 << (wb + hb)))
return tx_type; return tx_type;
if (xd->mode_info_context->mbmi.mode < I8X8_PRED && if (xd->mode_info_context->mbmi.mode < I8X8_PRED &&
xd->q_index < ACTIVE_HT16) { xd->q_index < ACTIVE_HT16) {
tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode)); tx_type = txfm_map(pred_mode_conv(xd->mode_info_context->mbmi.mode));
#if USE_ADST_PERIPHERY_ONLY #if USE_ADST_PERIPHERY_ONLY
if (sb_type > BLOCK_SIZE_MB16X16) { if (sb_type > BLOCK_SIZE_MB16X16) {
const int hmax = 4 << wb; const int hmax = 1 << wb;
#if USE_ADST_FOR_REMOTE_EDGE #if USE_ADST_FOR_REMOTE_EDGE
if ((ib & (hmax - 1)) != 0 && ib >= hmax) if ((ib & (hmax - 1)) != 0 && ib >= hmax)
tx_type = DCT_DCT; tx_type = DCT_DCT;
......
...@@ -31,8 +31,8 @@ void vp9_inverse_transform_b_16x16(int16_t *input_dqcoeff, ...@@ -31,8 +31,8 @@ void vp9_inverse_transform_b_16x16(int16_t *input_dqcoeff,
} }
void vp9_inverse_transform_sby_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sby_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) - 1); const int bh = 1 << (b_height_log2(bsize) - 3);
const int stride = 32 << bwl; const int stride = 32 << bwl;
int n; int n;
...@@ -46,8 +46,8 @@ void vp9_inverse_transform_sby_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -46,8 +46,8 @@ void vp9_inverse_transform_sby_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
const int bh = 1 << mb_height_log2(bsize); const int bh = 1 << (b_height_log2(bsize) - 2);
const int stride = 16 << bwl, bstride = 4 << bwl; const int stride = 16 << bwl, bstride = 4 << bwl;
int n; int n;
...@@ -68,8 +68,8 @@ void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -68,8 +68,8 @@ void vp9_inverse_transform_sby_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) + 1); const int bh = 1 << (b_height_log2(bsize) - 1);
const int stride = 8 << bwl, bstride = 2 << bwl; const int stride = 8 << bwl, bstride = 2 << bwl;
int n; int n;
...@@ -89,8 +89,8 @@ void vp9_inverse_transform_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -89,8 +89,8 @@ void vp9_inverse_transform_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bw = 1 << bwl; const int bwl = b_width_log2(bsize), bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) + 2); const int bh = 1 << b_height_log2(bsize);
const int stride = 4 << bwl, bstride = 1 << bwl; const int stride = 4 << bwl, bstride = 1 << bwl;
int n; int n;
...@@ -118,7 +118,7 @@ void vp9_inverse_transform_sbuv_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -118,7 +118,7 @@ void vp9_inverse_transform_sbuv_32x32(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sbuv_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sbuv_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bhl = mb_height_log2(bsize); const int bwl = b_width_log2(bsize) - 2, bhl = b_height_log2(bsize) - 2;
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 16 << (bwl - 1); const int stride = 16 << (bwl - 1);
int n; int n;
...@@ -135,7 +135,7 @@ void vp9_inverse_transform_sbuv_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -135,7 +135,7 @@ void vp9_inverse_transform_sbuv_16x16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bhl = mb_height_log2(bsize) + 1; const int bwl = b_width_log2(bsize) - 1, bhl = b_height_log2(bsize) - 1;
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 8 << (bwl - 1); const int stride = 8 << (bwl - 1);
int n; int n;
...@@ -152,7 +152,7 @@ void vp9_inverse_transform_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -152,7 +152,7 @@ void vp9_inverse_transform_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_inverse_transform_sbuv_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { void vp9_inverse_transform_sbuv_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bhl = mb_height_log2(bsize) + 2; const int bwl = b_width_log2(bsize), bhl = b_height_log2(bsize);
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 4 << (bwl - 1); const int stride = 4 << (bwl - 1);
int n; int n;
......
...@@ -388,8 +388,8 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, vp9_reader *r) { ...@@ -388,8 +388,8 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, vp9_reader *r) {
} }
static INLINE void decode_sby_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sby_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
const int bhl = mb_height_log2(bsize) - 1, bh = 1 << bhl; const int bhl = b_height_log2(bsize) - 3, bh = 1 << bhl;
const int y_count = bw * bh; const int y_count = bw * bh;
int n; int n;
...@@ -405,8 +405,8 @@ static INLINE void decode_sby_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { ...@@ -405,8 +405,8 @@ static INLINE void decode_sby_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sbuv_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sbuv_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) - 1, bw = (1 << bwl) / 2; const int bwl = b_width_log2(bsize) - 3, bw = (1 << bwl) / 2;
const int bhl = mb_height_log2(bsize) - 1, bh = (1 << bhl) / 2; const int bhl = b_height_log2(bsize) - 3, bh = (1 << bhl) / 2;
const int uv_count = bw * bh; const int uv_count = bw * bh;
int n; int n;
for (n = 0; n < uv_count; n++) { for (n = 0; n < uv_count; n++) {
...@@ -426,8 +426,8 @@ static INLINE void decode_sbuv_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { ...@@ -426,8 +426,8 @@ static INLINE void decode_sbuv_32x32(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sby_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sby_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
const int bhl = mb_height_log2(bsize), bh = 1 << bhl; const int bhl = b_height_log2(bsize) - 2, bh = 1 << bhl;
const int y_count = bw * bh; const int y_count = bw * bh;
int n; int n;
...@@ -444,8 +444,8 @@ static INLINE void decode_sby_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { ...@@ -444,8 +444,8 @@ static INLINE void decode_sby_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sbuv_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sbuv_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bw = (1 << bwl) / 2; const int bwl = b_width_log2(bsize) - 2, bw = (1 << bwl) / 2;
const int bhl = mb_height_log2(bsize), bh = (1 << bhl) / 2; const int bhl = b_height_log2(bsize) - 2, bh = (1 << bhl) / 2;
const int uv_count = bw * bh; const int uv_count = bw * bh;
int n; int n;
...@@ -465,8 +465,8 @@ static INLINE void decode_sbuv_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) { ...@@ -465,8 +465,8 @@ static INLINE void decode_sbuv_16x16(MACROBLOCKD *mb, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
const int bhl = mb_height_log2(bsize) + 1, bh = 1 << bhl; const int bhl = b_height_log2(bsize) - 1, bh = 1 << bhl;
const int y_count = bw * bh; const int y_count = bw * bh;
int n; int n;
...@@ -485,8 +485,8 @@ static INLINE void decode_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -485,8 +485,8 @@ static INLINE void decode_sby_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bw = 1 << (bwl - 1); const int bwl = b_width_log2(bsize) - 1, bw = 1 << (bwl - 1);
const int bhl = mb_height_log2(bsize) + 1, bh = 1 << (bhl - 1); const int bhl = b_height_log2(bsize) - 1, bh = 1 << (bhl - 1);
const int uv_count = bw * bh; const int uv_count = bw * bh;
int n; int n;
...@@ -505,8 +505,8 @@ static INLINE void decode_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -505,8 +505,8 @@ static INLINE void decode_sbuv_8x8(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bw = 1 << bwl; const int bwl = b_width_log2(bsize), bw = 1 << bwl;
const int bhl = mb_height_log2(bsize) + 2, bh = 1 << bhl; const int bhl = b_height_log2(bsize), bh = 1 << bhl;
const int y_count = bw * bh; const int y_count = bw * bh;
int n; int n;
...@@ -528,8 +528,8 @@ static INLINE void decode_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -528,8 +528,8 @@ static INLINE void decode_sby_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
} }
static INLINE void decode_sbuv_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { static INLINE void decode_sbuv_4x4(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bw = 1 << (bwl - 1); const int bwl = b_width_log2(bsize), bw = 1 << (bwl - 1);
const int bhl = mb_height_log2(bsize) + 2, bh = 1 << (bhl - 1); const int bhl = b_height_log2(bsize), bh = 1 << (bhl - 1);
const int uv_count = bw * bh; const int uv_count = bw * bh;
int n; int n;
......
...@@ -175,7 +175,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, ...@@ -175,7 +175,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
} }
case TX_8X8: { case TX_8X8: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int sz = 3 + mb_width_log2(sb_type); const int sz = 1 + b_width_log2(sb_type);
const int x = block_idx & ((1 << sz) - 1); const int x = block_idx & ((1 << sz) - 1);
const int y = block_idx - x; const int y = block_idx - x;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
...@@ -194,7 +194,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, ...@@ -194,7 +194,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
} }
case TX_16X16: { case TX_16X16: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int sz = 4 + mb_width_log2(sb_type); const int sz = 2 + b_width_log2(sb_type);
const int x = block_idx & ((1 << sz) - 1); const int x = block_idx & ((1 << sz) - 1);
const int y = block_idx - x; const int y = block_idx - x;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
......
...@@ -68,8 +68,8 @@ void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -68,8 +68,8 @@ void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
void vp9_transform_sby_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sby_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) - 1); const int bh = 1 << (b_height_log2(bsize) - 3);
const int stride = 32 << bwl; const int stride = 32 << bwl;
int n; int n;
...@@ -82,8 +82,8 @@ void vp9_transform_sby_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -82,8 +82,8 @@ void vp9_transform_sby_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sby_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sby_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
const int bh = 1 << mb_height_log2(bsize); const int bh = 1 << (b_height_log2(bsize) - 2);
const int stride = 16 << bwl, bstride = 4 << bwl; const int stride = 16 << bwl, bstride = 4 << bwl;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
int n; int n;
...@@ -105,8 +105,8 @@ void vp9_transform_sby_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -105,8 +105,8 @@ void vp9_transform_sby_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sby_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sby_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) + 1); const int bh = 1 << (b_height_log2(bsize) - 1);
const int stride = 8 << bwl, bstride = 2 << bwl; const int stride = 8 << bwl, bstride = 2 << bwl;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
int n; int n;
...@@ -126,8 +126,8 @@ void vp9_transform_sby_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -126,8 +126,8 @@ void vp9_transform_sby_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sby_4x4(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sby_4x4(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bw = 1 << bwl; const int bwl = b_width_log2(bsize), bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) + 2); const int bh = 1 << b_height_log2(bsize);
const int stride = 4 << bwl; const int stride = 4 << bwl;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
int n; int n;
...@@ -154,7 +154,7 @@ void vp9_transform_sbuv_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -154,7 +154,7 @@ void vp9_transform_sbuv_32x32(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sbuv_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sbuv_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bhl = mb_height_log2(bsize); const int bwl = b_width_log2(bsize) - 2, bhl = b_height_log2(bsize) - 2;
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 16 << (bwl - 1); const int stride = 16 << (bwl - 1);
int n; int n;
...@@ -171,7 +171,7 @@ void vp9_transform_sbuv_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -171,7 +171,7 @@ void vp9_transform_sbuv_16x16(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sbuv_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sbuv_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bhl = mb_height_log2(bsize) + 1; const int bwl = b_width_log2(bsize) - 1, bhl = b_height_log2(bsize) - 1;
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 8 << (bwl - 1); const int stride = 8 << (bwl - 1);
int n; int n;
...@@ -188,7 +188,7 @@ void vp9_transform_sbuv_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { ...@@ -188,7 +188,7 @@ void vp9_transform_sbuv_8x8(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
} }
void vp9_transform_sbuv_4x4(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) { void vp9_transform_sbuv_4x4(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 2, bhl = mb_height_log2(bsize) + 2; const int bwl = b_width_log2(bsize), bhl = b_height_log2(bsize);
const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1); const int bw = 1 << (bwl - 1), bh = 1 << (bhl - 1);
const int stride = 4 << (bwl - 1); const int stride = 4 << (bwl - 1);
int n; int n;
...@@ -288,7 +288,7 @@ static void optimize_b(VP9_COMMON *const cm, ...@@ -288,7 +288,7 @@ static void optimize_b(VP9_COMMON *const cm,
} }
case TX_8X8: { case TX_8X8: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int sz = 3 + mb_width_log2(sb_type); const int sz = 1 + b_width_log2(sb_type);
const int x = ib & ((1 << sz) - 1), y = ib - x; const int x = ib & ((1 << sz) - 1), y = ib - x;
const TX_TYPE tx_type = get_tx_type_8x8(xd, y + (x >> 1)); const TX_TYPE tx_type = get_tx_type_8x8(xd, y + (x >> 1));
scan = get_scan_8x8(tx_type); scan = get_scan_8x8(tx_type);
...@@ -297,7 +297,7 @@ static void optimize_b(VP9_COMMON *const cm, ...@@ -297,7 +297,7 @@ static void optimize_b(VP9_COMMON *const cm,
} }
case TX_16X16: { case TX_16X16: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int sz = 4 + mb_width_log2(sb_type); const int sz = 2 + b_width_log2(sb_type);
const int x = ib & ((1 << sz) - 1), y = ib - x; const int x = ib & ((1 << sz) - 1), y = ib - x;
const TX_TYPE tx_type = get_tx_type_16x16(xd, y + (x >> 2)); const TX_TYPE tx_type = get_tx_type_16x16(xd, y + (x >> 2));
scan = get_scan_16x16(tx_type); scan = get_scan_16x16(tx_type);
...@@ -486,8 +486,8 @@ static void optimize_b(VP9_COMMON *const cm, ...@@ -486,8 +486,8 @@ static void optimize_b(VP9_COMMON *const cm,
void vp9_optimize_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_optimize_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
const int bh = 1 << (mb_height_log2(bsize) - 1); const int bh = 1 << (b_height_log2(bsize) - 3);
ENTROPY_CONTEXT ta[2], tl[2]; ENTROPY_CONTEXT ta[2], tl[2];
int n; int n;
...@@ -516,8 +516,8 @@ void vp9_optimize_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x, ...@@ -516,8 +516,8 @@ void vp9_optimize_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
const int bh = 1 << mb_height_log2(bsize); const int bh = 1 << (b_height_log2(bsize) - 2);
ENTROPY_CONTEXT ta[4], tl[4]; ENTROPY_CONTEXT ta[4], tl[4];
int n; int n;
...@@ -539,8 +539,8 @@ void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x, ...@@ -539,8 +539,8 @@ void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_optimize_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_optimize_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl; const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
const int bh = 2 << mb_height_log2(bsize); const int bh = 1 << (b_height_log2(bsize) - 1);
ENTROPY_CONTEXT ta[8], tl[8]; ENTROPY_CONTEXT ta[8], tl[8];
int n; int n;
...@@ -567,20 +567,17 @@ void vp9_optimize_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x, ...@@ -567,20 +567,17 @@ void vp9_optimize_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_optimize_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_optimize_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE_TYPE bsize) {
int bwl = mb_width_log2(bsize), bw = 1 << bwl; int bwl = b_width_log2(bsize), bw = 1 << bwl;
int bh = 1 << mb_height_log2(bsize); int bh = 1 << b_height_log2(bsize);
ENTROPY_CONTEXT ta[16], tl[16]; ENTROPY_CONTEXT ta[16], tl[16];
int n; int n;
for (n = 0; n < bw; n++) for (n = 0; n < bw; n += 4)
vpx_memcpy(&ta[n * 4], x->e_mbd.above_context + n, vpx_memcpy(&ta[n], x->e_mbd.above_context + (n >> 2),
sizeof(ENTROPY_CONTEXT) * 4); sizeof(ENTROPY_CONTEXT) * 4);
for (n = 0; n < bh; n++) for (n = 0; n < bh; n += 4)
vpx_memcpy(&tl[n * 4], x->e_mbd.left_context + n, vpx_memcpy(&tl[n], x->e_mbd.left_context + (n >> 2),
sizeof(ENTROPY_CONTEXT) * 4); sizeof(ENTROPY_CONTEXT) * 4);
bw *= 4;
bh *= 4;
bwl += 2;
for (n = 0; n < bw * bh; n++) { for (n = 0; n < bw * bh; n++) {
const int x_idx = n & (bw - 1), y_idx = n >> bwl; const int x_idx = n & (bw - 1), y_idx = n >> bwl;
...@@ -617,7 +614,7 @@ void vp9_optimize_sbuv_32x32(VP9_COMMON *const cm, MACROBLOCK *x, ...@@ -617,7 +614,7 @@ void vp9_optimize_sbuv_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_optimize_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_optimize_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE_TYPE bsize) {
const int bwl = mb_width_log2(bsize), bhl = mb_height_log2(bsize); const int bwl = b_width_log2(bsize) - 2, bhl = b_height_log2(bsize) - 2;
const int bw = 1 << (bwl - 1); const int bw = 1 << (bwl - 1);
const int bh = 1 << (bhl - 1); const int bh = 1 << (bhl - 1);
int uvoff = 16 << (bwl + bhl); int uvoff = 16 << (bwl + bhl);
...@@ -651,7 +648,7 @@ void vp9_optimize_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x, ...@@ -651,7 +648,7 @@ void vp9_optimize_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
void vp9_optimize_sbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *x, void vp9_o