summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2013-12-03 10:51:13 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-12-03 10:51:13 -0800
commitf63c75de841429caafe987e80b51c5dc7283d1bb (patch)
treed5e23bdecef7514d15e855b6764f75a6764c5b83 /vp9/encoder
parentb88b49a7bc6a5b08ae0af0304eee67ced7d55352 (diff)
parent2360a5f0938a4cbd93cc04ecab65f89fdab4f0a4 (diff)
downloadlibvpx-f63c75de841429caafe987e80b51c5dc7283d1bb.tar
libvpx-f63c75de841429caafe987e80b51c5dc7283d1bb.tar.gz
libvpx-f63c75de841429caafe987e80b51c5dc7283d1bb.tar.bz2
libvpx-f63c75de841429caafe987e80b51c5dc7283d1bb.zip
Merge "Remove plane_block_idx."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_quantize.c41
-rw-r--r--vp9/encoder/vp9_quantize.h2
-rw-r--r--vp9/encoder/vp9_rdopt.c4
3 files changed, 10 insertions, 37 deletions
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index 698130aed..2591a5783 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -137,45 +137,18 @@ void vp9_quantize_b_32x32_c(const int16_t *coeff_ptr, intptr_t n_coeffs,
*eob_ptr = eob + 1;
}
-struct plane_block_idx {
- int plane;
- int block;
-};
-
-// TODO(jkoleszar): returning a struct so it can be used in a const context,
-// expect to refactor this further later.
-static INLINE struct plane_block_idx plane_block_idx(int y_blocks,
- int b_idx) {
- const int v_offset = y_blocks * 5 / 4;
- struct plane_block_idx res;
-
- if (b_idx < y_blocks) {
- res.plane = 0;
- res.block = b_idx;
- } else if (b_idx < v_offset) {
- res.plane = 1;
- res.block = b_idx - y_blocks;
- } else {
- assert(b_idx < y_blocks * 3 / 2);
- res.plane = 2;
- res.block = b_idx - v_offset;
- }
- return res;
-}
-
-void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int y_blocks, int b_idx,
+void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
const int16_t *scan, const int16_t *iscan) {
MACROBLOCKD *const xd = &x->e_mbd;
- const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
- struct macroblock_plane* p = &x->plane[pb_idx.plane];
- struct macroblockd_plane* pd = &xd->plane[pb_idx.plane];
+ struct macroblock_plane* p = &x->plane[plane];
+ struct macroblockd_plane* pd = &xd->plane[plane];
- vp9_quantize_b(BLOCK_OFFSET(p->coeff, pb_idx.block),
+ vp9_quantize_b(BLOCK_OFFSET(p->coeff, block),
16, x->skip_block,
p->zbin, p->round, p->quant, p->quant_shift,
- BLOCK_OFFSET(p->qcoeff, pb_idx.block),
- BLOCK_OFFSET(pd->dqcoeff, pb_idx.block),
- pd->dequant, p->zbin_extra, &pd->eobs[pb_idx.block], scan, iscan);
+ BLOCK_OFFSET(p->qcoeff, block),
+ BLOCK_OFFSET(pd->dqcoeff, block),
+ pd->dequant, p->zbin_extra, &pd->eobs[block], scan, iscan);
}
static void invert_quant(int16_t *quant, int16_t *shift, int d) {
diff --git a/vp9/encoder/vp9_quantize.h b/vp9/encoder/vp9_quantize.h
index c078e1d41..41cfa5283 100644
--- a/vp9/encoder/vp9_quantize.h
+++ b/vp9/encoder/vp9_quantize.h
@@ -13,7 +13,7 @@
#include "vp9/encoder/vp9_block.h"
-void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int y_blocks, int b_idx,
+void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
const int16_t *scan, const int16_t *iscan);
struct VP9_COMP;
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 087d036ca..65cf5c797 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1055,7 +1055,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
else
x->fwd_txm4x4(src_diff, coeff, 8);
- vp9_regular_quantize_b_4x4(x, 4, block, so->scan, so->iscan);
+ vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
so->scan, so->neighbors);
@@ -1541,7 +1541,7 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
coeff = BLOCK_OFFSET(p->coeff, k);
x->fwd_txm4x4(raster_block_offset_int16(BLOCK_8X8, k, p->src_diff),
coeff, 8);
- vp9_regular_quantize_b_4x4(x, 4, k, so->scan, so->iscan);
+ vp9_regular_quantize_b_4x4(x, 0, k, so->scan, so->iscan);
thisdistortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k),
16, &ssz);
thissse += ssz;