diff options
author | Jingning Han <jingning@google.com> | 2016-07-01 12:20:45 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2016-07-04 18:41:47 -0700 |
commit | 14011f037d0353d1bef1b21dd65a348d9792bfd3 (patch) | |
tree | e8377177d9faeca0a047df1b17c7601667dfe393 /vp9/encoder/vp9_rdopt.c | |
parent | c02a4beed882521dd1ddcecbda88934868ea5844 (diff) | |
download | libvpx-14011f037d0353d1bef1b21dd65a348d9792bfd3.tar libvpx-14011f037d0353d1bef1b21dd65a348d9792bfd3.tar.gz libvpx-14011f037d0353d1bef1b21dd65a348d9792bfd3.tar.bz2 libvpx-14011f037d0353d1bef1b21dd65a348d9792bfd3.zip |
Remove txfrm_block_to_raster_xy() from vp9 encoder
The transform block row and column positions are always available
outside the callees. There is no need to re-compute these values
again. This approach has been used by the decoder. This commit
removes txfrm_block_to_raster_xy() function.
Change-Id: I5b90f91a0d8b7c35cfa7d171da9edf8202630108
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 47bcd8665..28530386c 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -498,18 +498,16 @@ static void dist_block(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size, } } -static int rate_block(int plane, int block, BLOCK_SIZE plane_bsize, +static int rate_block(int plane, int block, int row, int col, TX_SIZE tx_size, struct rdcost_block_args* args) { - int x_idx, y_idx; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x_idx, &y_idx); - - return cost_coeffs(args->x, plane, block, args->t_above + x_idx, - args->t_left + y_idx, tx_size, + return cost_coeffs(args->x, plane, block, args->t_above + col, + args->t_left + row, tx_size, args->so->scan, args->so->neighbors, args->use_fast_coef_costing); } -static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, +static void block_rd_txfm(int plane, int block, int row, int col, + BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct rdcost_block_args *args = arg; MACROBLOCK *const x = args->x; @@ -525,20 +523,20 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, if (!is_inter_block(mi)) { struct encode_b_args arg = {x, NULL, &mi->skip}; - vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &arg); + vp9_encode_block_intra(plane, block, row, col, plane_bsize, tx_size, &arg); dist_block(x, plane, block, tx_size, &dist, &sse); } else if (max_txsize_lookup[plane_bsize] == tx_size) { if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == SKIP_TXFM_NONE) { // full forward transform and quantization - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); + vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size); dist_block(x, plane, block, tx_size, &dist, &sse); } else if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == SKIP_TXFM_AC_ONLY) { // compute DC coefficient tran_low_t *const coeff = BLOCK_OFFSET(x->plane[plane].coeff, block); tran_low_t *const dqcoeff = BLOCK_OFFSET(xd->plane[plane].dqcoeff, block); - vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size); + vp9_xform_quant_dc(x, plane, block, row, col, plane_bsize, tx_size); sse = x->bsse[(plane << 2) + (block >> (tx_size << 1))] << 4; dist = sse; if (x->plane[plane].eobs[block]) { @@ -562,7 +560,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, } } else { // full forward transform and quantization - vp9_xform_quant(x, plane, block, plane_bsize, tx_size); + vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size); dist_block(x, plane, block, tx_size, &dist, &sse); } @@ -572,7 +570,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, return; } - rate = rate_block(plane, block, plane_bsize, tx_size, args); + rate = rate_block(plane, block, row, col, tx_size, args); rd1 = RDCOST(x->rdmult, x->rddiv, rate, dist); rd2 = RDCOST(x->rdmult, x->rddiv, 0, sse); |