summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rdopt.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2013-04-24 09:18:16 -0700
committerRonald S. Bultje <rbultje@google.com>2013-04-25 14:20:59 -0700
commitc849eaca5918cbe523968cde479fbb5a125b866d (patch)
treedf747effc3c87e52a210f7b5f2bb13696c7e3bcc /vp9/encoder/vp9_rdopt.c
parente40a769036a97403718244caa81b8680a4c9c7eb (diff)
downloadlibvpx-c849eaca5918cbe523968cde479fbb5a125b866d.tar
libvpx-c849eaca5918cbe523968cde479fbb5a125b866d.tar.gz
libvpx-c849eaca5918cbe523968cde479fbb5a125b866d.tar.bz2
libvpx-c849eaca5918cbe523968cde479fbb5a125b866d.zip
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
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r--vp9/encoder/vp9_rdopt.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 5c4402a5b..6778c09b0 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -360,7 +360,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
}
case TX_8X8: {
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;
TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_8x8(xd, y + (x >> 1)) : DCT_DCT;
@@ -376,7 +376,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
}
case TX_16X16: {
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;
TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
@@ -666,8 +666,8 @@ static int block_error_sbuv(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, int shift) {
static int rdcost_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) + 2, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) + 2);
+ const int bwl = b_width_log2(bsize), bw = 1 << bwl;
+ const int bh = 1 << b_height_log2(bsize);
int cost = 0, b;
MACROBLOCKD *const xd = &x->e_mbd;
ENTROPY_CONTEXT_PLANES t_above[4], t_left[4];
@@ -691,7 +691,7 @@ static int rdcost_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
static void super_block_yrd_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
int *rate, int *distortion, int *skippable,
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);
MACROBLOCKD *const xd = &x->e_mbd;
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
@@ -705,8 +705,8 @@ static void super_block_yrd_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
static int rdcost_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) + 1);
+ const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 1);
int cost = 0, b;
MACROBLOCKD *const xd = &x->e_mbd;
ENTROPY_CONTEXT_PLANES t_above[4], t_left[4];
@@ -744,8 +744,8 @@ static void super_block_yrd_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
static int rdcost_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize), bw = 1 << bwl;
- const int bh = 1 << mb_height_log2(bsize);
+ const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 2);
int cost = 0, b;
MACROBLOCKD *const xd = &x->e_mbd;
ENTROPY_CONTEXT_PLANES t_above[4], t_left[4];
@@ -781,8 +781,8 @@ static void super_block_yrd_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
static int rdcost_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) - 1);
+ const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 3);
int cost = 0, b;
MACROBLOCKD * const xd = &x->e_mbd;
ENTROPY_CONTEXT_PLANES t_above[4], t_left[4];
@@ -1345,8 +1345,8 @@ static int64_t rd_pick_intra8x8mby_modes_and_txsz(VP9_COMP *cpi, MACROBLOCK *x,
#define UVCTX(c, p) ((p) ? (c).v : (c).u)
static int rd_cost_sbuv_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) + 1, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) + 1);
+ const int bwl = b_width_log2(bsize) - 1, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 1);
int yoff = 4 * bw * bh;
int p, b, cost = 0;
MACROBLOCKD *const xd = &x->e_mbd;
@@ -1386,8 +1386,8 @@ static void super_block_uvrd_4x4(VP9_COMMON *const cm, MACROBLOCK *x,
static int rd_cost_sbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize), bw = 1 << bwl;
- const int bh = 1 << mb_height_log2(bsize);
+ const int bwl = b_width_log2(bsize) - 2, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 2);
int yoff = 16 * bw * bh;
int p, b, cost = 0;
MACROBLOCKD *const xd = &x->e_mbd;
@@ -1427,8 +1427,8 @@ static void super_block_uvrd_8x8(VP9_COMMON *const cm, MACROBLOCK *x,
static int rd_cost_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) - 1, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) - 1);
+ const int bwl = b_width_log2(bsize) - 3, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 3);
int yoff = 64 * bw * bh;
int p, b, cost = 0;
MACROBLOCKD *const xd = &x->e_mbd;
@@ -1468,8 +1468,8 @@ static void super_block_uvrd_16x16(VP9_COMMON *const cm, MACROBLOCK *x,
static int rd_cost_sbuv_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
- const int bwl = mb_width_log2(bsize) - 2, bw = 1 << bwl;
- const int bh = 1 << (mb_height_log2(bsize) - 2);
+ const int bwl = b_width_log2(bsize) - 4, bw = 1 << bwl;
+ const int bh = 1 << (b_height_log2(bsize) - 4);
int yoff = 256 * bh * bw;
int p, b, cost = 0;
MACROBLOCKD *const xd = &x->e_mbd;