shithub: libvpx

Download patch

ref: acc9c125dd632b5c6651b7330cb8eec9272a796b
parent: 6c622e2783143c0f50558fc452297ae98d81cc20
author: John Koleszar <jkoleszar@google.com>
date: Fri May 3 06:24:11 EDT 2013

Remove old_block_idx_4x4

Removes several instances where the old block numbering was
still in use.

Change-Id: Id35130591455a4abe6844613e45c0b70c1220c08

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -885,24 +885,6 @@
   return res;
 }
 
-/* TODO(jkoleszar): Probably best to remove instances that require this,
- * as the data likely becomes per-plane and stored in the per-plane structures.
- * This is a stub to work with the existing code.
- */
-static INLINE int old_block_idx_4x4(MACROBLOCKD* const xd, int block_size_b,
-                                    int plane, int i) {
-  const int luma_blocks = 1 << block_size_b;
-  assert(xd->plane[0].subsampling_x == 0);
-  assert(xd->plane[0].subsampling_y == 0);
-  assert(xd->plane[1].subsampling_x == 1);
-  assert(xd->plane[1].subsampling_y == 1);
-  assert(xd->plane[2].subsampling_x == 1);
-  assert(xd->plane[2].subsampling_y == 1);
-  return plane == 0 ? i :
-         plane == 1 ? luma_blocks + i :
-                      luma_blocks * 5 / 4 + i;
-}
-
 typedef void (*foreach_transformed_block_visitor)(int plane, int block,
                                                   BLOCK_SIZE_TYPE bsize,
                                                   int ss_txfrm_size,
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -356,9 +356,7 @@
                          int ss_txfrm_size,
                          void *argv) {
   const struct decode_block_args* const arg = argv;
-  const int bw = b_width_log2(bsize), bh = b_height_log2(bsize);
-  const int old_block_idx = old_block_idx_4x4(arg->xd, bw + bh,
-                                              plane, block);
+  const int bw = b_width_log2(bsize);
 
   // find the maximum eob for this transform size, adjusted by segment
   const int segment_id = arg->xd->mode_info_context->mbmi.segment_id;
@@ -370,7 +368,7 @@
   const int aoff = (off & ((1 << mod) - 1)) << ss_tx_size;
   const int loff = (off >> mod) << ss_tx_size;
 
-  const int eob = decode_coefs(arg->pbi, arg->xd, arg->r, old_block_idx,
+  const int eob = decode_coefs(arg->pbi, arg->xd, arg->r, block,
                                arg->xd->plane[plane].plane_type, seg_eob,
                                BLOCK_OFFSET(qcoeff_base, block, 16),
                                ss_tx_size, arg->xd->plane[plane].dequant,
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -112,8 +112,6 @@
   PLANE_TYPE type = plane ? PLANE_TYPE_UV : PLANE_TYPE_Y_WITH_DC;
   TX_SIZE tx_size = ss_txfrm_size / 2;
   int dry_run = args->dry_run;
-  int ib = old_block_idx_4x4(xd, b_width_log2(bsize) + b_height_log2(bsize),
-                             plane, block);
 
   MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
   int pt; /* near block/prev token context index */
@@ -158,7 +156,7 @@
     default:
     case TX_4X4: {
       tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
-          get_tx_type_4x4(xd, ib) : DCT_DCT;
+          get_tx_type_4x4(xd, block) : DCT_DCT;
       above_ec = A[0] != 0;
       left_ec = L[0] != 0;
       seg_eob = 16;
@@ -173,7 +171,7 @@
     }
     case TX_8X8: {
       const int sz = 1 + b_width_log2(sb_type);
-      const int x = ib & ((1 << sz) - 1), y = ib - x;
+      const int x = block & ((1 << sz) - 1), y = block - x;
       tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
           get_tx_type_8x8(xd, y + (x >> 1)) : DCT_DCT;
       above_ec = (A[0] + A[1]) != 0;
@@ -190,7 +188,7 @@
     }
     case TX_16X16: {
       const int sz = 2 + b_width_log2(sb_type);
-      const int x = ib & ((1 << sz) - 1), y = ib - x;
+      const int x = block & ((1 << sz) - 1), y = block - x;
       tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
           get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
       above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;