summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-20 10:06:22 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-08-20 10:06:22 -0700
commit5826407f2a79f3c68147e9d3bec879b1b62ab09e (patch)
treeb4af8245ab2de45b09d557c05f51eae6ccb17fe0 /vp9/encoder
parent5baf510f74ca2fe82ea5aa547b1330d4c5059581 (diff)
parent569ca37d09d5ae4e6eb47f110cc33805a09df7af (diff)
downloadlibvpx-5826407f2a79f3c68147e9d3bec879b1b62ab09e.tar
libvpx-5826407f2a79f3c68147e9d3bec879b1b62ab09e.tar.gz
libvpx-5826407f2a79f3c68147e9d3bec879b1b62ab09e.tar.bz2
libvpx-5826407f2a79f3c68147e9d3bec879b1b62ab09e.zip
Merge "Moving plane_block_idx from vp9_blockd.h to vp9_quantize.c."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_quantize.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index 15f34a8eb..02c068552 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -152,6 +152,32 @@ void vp9_quantize_b_32x32_c(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 *mb, int b_idx, TX_TYPE tx_type,
int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;