From 7bfc20ac7a29f346231dd6dd6b4b2a9c8d748910 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Wed, 13 Nov 2013 19:33:12 -0800 Subject: [PATCH] Eliminating usage of txfrm_block_to_raster_block() from encode_block(). Change-Id: I7d11f1b6075a1115cdc2dcd605225b9c9c9b39c7 --- vp9/encoder/vp9_encodemb.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index ca46e8570..565722d3b 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -421,19 +421,16 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, MACROBLOCKD *const xd = &x->e_mbd; struct optimize_ctx *const ctx = args->ctx; struct macroblockd_plane *const pd = &xd->plane[plane]; - const int raster_block = txfrm_block_to_raster_block(plane_bsize, tx_size, - block); - int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - uint8_t *const dst = raster_block_offset_uint8(plane_bsize, raster_block, - pd->dst.buf, pd->dst.stride); + int i, j; + uint8_t *dst; + txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); + dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i]; // TODO(jingning): per transformed block zero forcing only enabled for // luma component. will integrate chroma components as well. if (x->zcoeff_blk[tx_size][block] && plane == 0) { - int i, j; pd->eobs[block] = 0; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); ctx->ta[plane][i] = 0; ctx->tl[plane][j] = 0; return; @@ -445,10 +442,8 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { vp9_optimize_b(plane, block, plane_bsize, tx_size, x, ctx); } else { - int i, k; - txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &k); ctx->ta[plane][i] = pd->eobs[block] > 0; - ctx->tl[plane][k] = pd->eobs[block] > 0; + ctx->tl[plane][j] = pd->eobs[block] > 0; } if (x->skip_encode || pd->eobs[block] == 0)