shithub: libvpx

Download patch

ref: 8c16dee4f2b36238abdaa8d55bb8e572b4108ed7
parent: 467431238257ef9985478ace1612e17f8b3dce04
parent: 35524e223147f457cf2591062a4329fc411a4d35
author: Ronald S. Bultje <rbultje@google.com>
date: Thu Feb 21 06:30:29 EST 2013

Merge "Remove "eobs" array in MACROBLOCKD." into experimental

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -293,7 +293,6 @@
   DECLARE_ALIGNED(16, uint8_t,  predictor[384]);
   DECLARE_ALIGNED(16, int16_t,  qcoeff[384]);
   DECLARE_ALIGNED(16, int16_t,  dqcoeff[384]);
-  DECLARE_ALIGNED(16, uint16_t, eobs[24]);
 
   SUPERBLOCKD sb_coeff_data;
 
@@ -374,10 +373,10 @@
   void (*dc_only_itxm_add)(int input_dc, uint8_t *pred_ptr,
     uint8_t *dst_ptr, int pitch, int stride);
   void (*itxm_add_y_block)(int16_t *q, const int16_t *dq,
-    uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs);
+    uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd);
   void (*itxm_add_uv_block)(int16_t *q, const int16_t *dq,
     uint8_t *pre, uint8_t *dst_u, uint8_t *dst_v, int stride,
-    uint16_t *eobs);
+    struct macroblockd *xd);
 
   struct subpix_fn_table  subpix;
 
--- a/vp9/common/vp9_rtcd_defs.sh
+++ b/vp9/common/vp9_rtcd_defs.sh
@@ -29,10 +29,10 @@
 prototype void vp9_dequantize_b "struct blockd *x"
 specialize vp9_dequantize_b
 
-prototype void vp9_dequant_idct_add_y_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs, struct macroblockd *xd"
+prototype void vp9_dequant_idct_add_y_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd"
 specialize vp9_dequant_idct_add_y_block_8x8
 
-prototype void vp9_dequant_idct_add_uv_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, uint16_t *eobs, struct macroblockd *xd"
+prototype void vp9_dequant_idct_add_uv_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
 specialize vp9_dequant_idct_add_uv_block_8x8
 
 prototype void vp9_dequant_idct_add_16x16 "int16_t *input, const int16_t *dq, uint8_t *pred, uint8_t *dest, int pitch, int stride, int eob"
@@ -44,16 +44,16 @@
 prototype void vp9_dequant_idct_add "int16_t *input, const int16_t *dq, uint8_t *pred, uint8_t *dest, int pitch, int stride"
 specialize vp9_dequant_idct_add
 
-prototype void vp9_dequant_idct_add_y_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs"
+prototype void vp9_dequant_idct_add_y_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int stride, struct macroblockd *xd"
 specialize vp9_dequant_idct_add_y_block
 
-prototype void vp9_dequant_idct_add_uv_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, uint16_t *eobs"
+prototype void vp9_dequant_idct_add_uv_block "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
 specialize vp9_dequant_idct_add_uv_block
 
 prototype void vp9_dequant_idct_add_32x32 "int16_t *q, const int16_t *dq, uint8_t *pre, uint8_t *dst, int pitch, int stride, int eob"
 specialize vp9_dequant_idct_add_32x32
 
-prototype void vp9_dequant_idct_add_uv_block_16x16 "int16_t *q, const int16_t *dq, uint8_t *dstu, uint8_t *dstv, int stride, uint16_t *eobs"
+prototype void vp9_dequant_idct_add_uv_block_16x16 "int16_t *q, const int16_t *dq, uint8_t *dstu, uint8_t *dstv, int stride, struct macroblockd *xd"
 specialize vp9_dequant_idct_add_uv_block_16x16
 
 #
@@ -299,7 +299,7 @@
 specialize vp9_short_iht16x16
 #endif
 
-prototype void vp9_ihtllm "const int16_t *input, int16_t *output, int pitch, int tx_type, int tx_dim, int16_t eobs"
+prototype void vp9_ihtllm "const int16_t *input, int16_t *output, int pitch, int tx_type, int tx_dim, int eob"
 specialize vp9_ihtllm
 
 
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -228,16 +228,16 @@
     vp9_ht_dequant_idct_add_16x16_c(tx_type, xd->qcoeff,
                                     xd->block[0].dequant, xd->predictor,
                                     xd->dst.y_buffer, 16, xd->dst.y_stride,
-                                    xd->eobs[0]);
+                                    xd->block[0].eob);
   } else {
     vp9_dequant_idct_add_16x16(xd->qcoeff, xd->block[0].dequant,
                                xd->predictor, xd->dst.y_buffer,
-                               16, xd->dst.y_stride, xd->eobs[0]);
+                               16, xd->dst.y_stride, xd->block[0].eob);
   }
   vp9_dequant_idct_add_uv_block_8x8(
       xd->qcoeff + 16 * 16, xd->block[16].dequant,
       xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
-      xd->dst.uv_stride, xd->eobs + 16, xd);
+      xd->dst.uv_stride, xd);
 }
 
 static void decode_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd,
@@ -274,10 +274,10 @@
       tx_type = get_tx_type_8x8(xd, &xd->block[ib]);
       if (tx_type != DCT_DCT) {
         vp9_ht_dequant_idct_add_8x8_c(tx_type, q, dq, pre, dst, 16, stride,
-                                      xd->eobs[idx]);
+                                      xd->block[idx].eob);
       } else {
         vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride,
-                                   xd->eobs[idx]);
+                                   xd->block[idx].eob);
       }
     }
   } else {
@@ -286,7 +286,7 @@
                                      xd->predictor,
                                      xd->dst.y_buffer,
                                      xd->dst.y_stride,
-                                     xd->eobs, xd);
+                                     xd);
   }
 
   // Now do UV
@@ -308,12 +308,12 @@
   } else if (xd->mode_info_context->mbmi.mode == SPLITMV) {
     xd->itxm_add_uv_block(xd->qcoeff + 16 * 16, xd->block[16].dequant,
          xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
-         xd->dst.uv_stride, xd->eobs + 16);
+         xd->dst.uv_stride, xd);
   } else {
     vp9_dequant_idct_add_uv_block_8x8
         (xd->qcoeff + 16 * 16, xd->block[16].dequant,
          xd->predictor + 16 * 16, xd->dst.u_buffer, xd->dst.v_buffer,
-         xd->dst.uv_stride, xd->eobs + 16, xd);
+         xd->dst.uv_stride, xd);
   }
 #ifdef DEC_DEBUG
   if (dec_debug) {
@@ -399,7 +399,7 @@
                            xd->dst.u_buffer,
                            xd->dst.v_buffer,
                            xd->dst.uv_stride,
-                           xd->eobs + 16);
+                           xd);
   } else if (mode == SPLITMV || get_tx_type_4x4(xd, &xd->block[0]) == DCT_DCT) {
     xd->itxm_add_y_block(xd->qcoeff,
                           xd->block[0].dequant,
@@ -406,7 +406,7 @@
                           xd->predictor,
                           xd->dst.y_buffer,
                           xd->dst.y_stride,
-                          xd->eobs);
+                          xd);
     xd->itxm_add_uv_block(xd->qcoeff + 16 * 16,
                            xd->block[16].dequant,
                            xd->predictor + 16 * 16,
@@ -413,7 +413,7 @@
                            xd->dst.u_buffer,
                            xd->dst.v_buffer,
                            xd->dst.uv_stride,
-                           xd->eobs + 16);
+                           xd);
   } else {
 #ifdef DEC_DEBUG
     if (dec_debug) {
@@ -451,7 +451,7 @@
                            xd->dst.u_buffer,
                            xd->dst.v_buffer,
                            xd->dst.uv_stride,
-                           xd->eobs + 16);
+                           xd);
   }
 }
 
@@ -471,7 +471,7 @@
         xd->qcoeff, xd->block[0].dequant,
         xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
         xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
-        xd->dst.y_stride, xd->dst.y_stride, xd->eobs[0]);
+        xd->dst.y_stride, xd->dst.y_stride, xd->block[0].eob);
   }
   vp9_dequant_idct_add_uv_block_8x8_inplace_c(
       xd->qcoeff + 16 * 16,
@@ -478,7 +478,7 @@
       xd->block[16].dequant,
       xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
       xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
-      xd->dst.uv_stride, xd->eobs + 16, xd);
+      xd->dst.uv_stride, xd);
 };
 
 static void decode_8x8_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
@@ -518,13 +518,13 @@
     vp9_dequant_idct_add_y_block_8x8_inplace_c(
         xd->qcoeff, xd->block[0].dequant,
         xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
-        xd->dst.y_stride, xd->eobs, xd);
+        xd->dst.y_stride, xd);
   }
   vp9_dequant_idct_add_uv_block_8x8_inplace_c(
       xd->qcoeff + 16 * 16, xd->block[16].dequant,
       xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
       xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
-      xd->dst.uv_stride, xd->eobs + 16, xd);
+      xd->dst.uv_stride, xd);
 };
 
 static void decode_4x4_sb(VP9D_COMP *pbi, MACROBLOCKD *xd,
@@ -559,13 +559,13 @@
     vp9_dequant_idct_add_y_block_4x4_inplace_c(
         xd->qcoeff, xd->block[0].dequant,
         xd->dst.y_buffer + y_idx * 16 * xd->dst.y_stride + x_idx * 16,
-        xd->dst.y_stride, xd->eobs, xd);
+        xd->dst.y_stride, xd);
   }
   vp9_dequant_idct_add_uv_block_4x4_inplace_c(
       xd->qcoeff + 16 * 16, xd->block[16].dequant,
       xd->dst.u_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
       xd->dst.v_buffer + y_idx * 8 * xd->dst.uv_stride + x_idx * 8,
-      xd->dst.uv_stride, xd->eobs + 16, xd);
+      xd->dst.uv_stride, xd);
 };
 
 static void decode_superblock64(VP9D_COMP *pbi, MACROBLOCKD *xd,
@@ -648,7 +648,7 @@
                                    xd->dst.y_buffer + x_idx * 32 +
                                        xd->dst.y_stride * y_idx * 32,
                                    xd->dst.y_stride, xd->dst.y_stride,
-                                   xd->eobs[0]);
+                                   xd->block[0].eob);
         vp9_dequant_idct_add_uv_block_16x16_c(xd->sb_coeff_data.qcoeff + 1024,
                                               xd->block[16].dequant,
                                               xd->dst.u_buffer + x_idx * 16 +
@@ -655,7 +655,7 @@
                                                 xd->dst.uv_stride * y_idx * 16,
                                               xd->dst.v_buffer + x_idx * 16 +
                                                 xd->dst.uv_stride * y_idx * 16,
-                                              xd->dst.uv_stride, xd->eobs + 16);
+                                              xd->dst.uv_stride, xd);
       }
     }
   } else {
@@ -670,7 +670,6 @@
       xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
       for (i = 0; i < 24; i++) {
         xd->block[i].eob = 0;
-        xd->eobs[i] = 0;
       }
 
       eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
@@ -757,11 +756,11 @@
       vp9_dequant_idct_add_32x32(xd->sb_coeff_data.qcoeff, xd->block[0].dequant,
                                  xd->dst.y_buffer, xd->dst.y_buffer,
                                  xd->dst.y_stride, xd->dst.y_stride,
-                                 xd->eobs[0]);
+                                 xd->block[0].eob);
       vp9_dequant_idct_add_uv_block_16x16_c(xd->sb_coeff_data.qcoeff + 1024,
                                             xd->block[16].dequant,
                                             xd->dst.u_buffer, xd->dst.v_buffer,
-                                            xd->dst.uv_stride, xd->eobs + 16);
+                                            xd->dst.uv_stride, xd);
     }
   } else {
     for (n = 0; n < 4; n++) {
@@ -775,7 +774,6 @@
       xd->mode_info_context = orig_mi + x_idx + y_idx * mis;
       for (i = 0; i < 24; i++) {
         xd->block[i].eob = 0;
-        xd->eobs[i] = 0;
       }
 
       eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
@@ -821,7 +819,6 @@
   } else if (!bool_error(bc)) {
     for (i = 0; i < 24; i++) {
       xd->block[i].eob = 0;
-      xd->eobs[i] = 0;
     }
     if (mode != B_PRED) {
       eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
--- a/vp9/decoder/vp9_dequantize.c
+++ b/vp9/decoder/vp9_dequantize.c
@@ -60,7 +60,7 @@
 void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input,
                                const int16_t *dq,
                                uint8_t *pred, uint8_t *dest,
-                               int pitch, int stride, uint16_t eobs) {
+                               int pitch, int stride, int eob) {
   int16_t output[16];
   int16_t *diff_ptr = output;
   int i;
@@ -72,7 +72,7 @@
 #if CONFIG_INTHT4X4
   vp9_short_iht4x4(input, output, 8, tx_type);
 #else
-  vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eobs);
+  vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eob);
 #endif
 
   vpx_memset(input, 0, 32);
@@ -83,14 +83,14 @@
 void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
                                    const int16_t *dq,
                                    uint8_t *pred, uint8_t *dest,
-                                   int pitch, int stride, uint16_t eobs) {
+                                   int pitch, int stride, int eob) {
   int16_t output[64];
   int16_t *diff_ptr = output;
   int i;
-  if (eobs == 0) {
+  if (eob == 0) {
     /* All 0 DCT coefficient */
     vp9_copy_mem8x8(pred, pitch, dest, stride);
-  } else if (eobs > 0) {
+  } else if (eob > 0) {
     input[0] = dq[0] * input[0];
     for (i = 1; i < 64; i++) {
       input[i] = dq[1] * input[i];
@@ -99,7 +99,7 @@
 #if CONFIG_INTHT
     vp9_short_iht8x8(input, output, 16, tx_type);
 #else
-    vp9_ihtllm(input, output, 16, tx_type, 8, eobs);
+    vp9_ihtllm(input, output, 16, tx_type, 8, eob);
 #endif
     vpx_memset(input, 0, 128);
 
@@ -250,14 +250,14 @@
 void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
                                      const int16_t *dq, uint8_t *pred,
                                      uint8_t *dest, int pitch, int stride,
-                                     uint16_t eobs) {
+                                     int eob) {
   int16_t output[256];
   int16_t *diff_ptr = output;
   int i;
-  if (eobs == 0) {
+  if (eob == 0) {
     /* All 0 DCT coefficient */
     vp9_copy_mem16x16(pred, pitch, dest, stride);
-  } else if (eobs > 0) {
+  } else if (eob > 0) {
     input[0]= input[0] * dq[0];
 
     // recover quantizer for 4 4x4 blocks
@@ -268,7 +268,7 @@
 #if CONFIG_INTHT16X16
     vp9_short_iht16x16(input, output, 32, tx_type);
 #else
-    vp9_ihtllm(input, output, 32, tx_type, 16, eobs);
+    vp9_ihtllm(input, output, 32, tx_type, 16, eob);
 #endif
 
     // the idct halves ( >> 1) the pitch
@@ -365,8 +365,9 @@
                                            uint8_t *dstu,
                                            uint8_t *dstv,
                                            int stride,
-                                           uint16_t *eobs) {
-  vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride, eobs[0]);
-  vp9_dequant_idct_add_16x16_c(q + 256, dq,
-                               dstv, dstv, stride, stride, eobs[4]);
+                                           MACROBLOCKD *xd) {
+  vp9_dequant_idct_add_16x16_c(q, dq, dstu, dstu, stride, stride,
+                               xd->block[16].eob);
+  vp9_dequant_idct_add_16x16_c(q + 256, dq, dstv, dstv, stride, stride,
+                               xd->block[20].eob);
 }
--- a/vp9/decoder/vp9_dequantize.h
+++ b/vp9/decoder/vp9_dequantize.h
@@ -27,38 +27,36 @@
                                                        unsigned char *pre,
                                                        unsigned char *dst,
                                                        int stride,
-                                                       uint16_t *eobs,
                                                        const int16_t *dc);
 extern void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
                                                     unsigned char *pre,
                                                     unsigned char *dst,
                                                     int stride,
-                                                    uint16_t *eobs);
+                                                    struct macroblockd *xd);
 extern void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
                                                      unsigned char *pre,
                                                      unsigned char *dst_u,
                                                      unsigned char *dst_v,
                                                      int stride,
-                                                     uint16_t *eobs);
+                                                     struct macroblockd *xd);
 
 void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input, const int16_t *dq,
                                     unsigned char *pred, unsigned char *dest,
-                                    int pitch, int stride, uint16_t eobs);
+                                    int pitch, int stride, int eob);
 
 void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input,
                                    const int16_t *dq, unsigned char *pred,
                                    unsigned char *dest, int pitch, int stride,
-                                   uint16_t eobs);
+                                   int eob);
 
 void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input,
                                      const int16_t *dq, unsigned char *pred,
                                      unsigned char *dest,
-                                     int pitch, int stride, uint16_t eobs);
+                                     int pitch, int stride, int eob);
 
 void vp9_dequant_dc_idct_add_y_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
                                                    unsigned char *dst,
                                                    int stride,
-                                                   uint16_t *eobs,
                                                    const int16_t *dc,
                                                    MACROBLOCKD *xd);
 
@@ -65,13 +63,11 @@
 void vp9_dequant_idct_add_y_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
                                                 unsigned char *dst,
                                                 int stride,
-                                                uint16_t *eobs,
                                                 MACROBLOCKD *xd);
 
 void vp9_dequant_dc_idct_add_y_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
                                                    unsigned char *dst,
                                                    int stride,
-                                                   uint16_t *eobs,
                                                    const int16_t *dc,
                                                    MACROBLOCKD *xd);
 
@@ -78,7 +74,6 @@
 void vp9_dequant_idct_add_y_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
                                                 unsigned char *dst,
                                                 int stride,
-                                                uint16_t *eobs,
                                                 MACROBLOCKD *xd);
 
 void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
@@ -85,7 +80,6 @@
                                                  unsigned char *dstu,
                                                  unsigned char *dstv,
                                                  int stride,
-                                                 uint16_t *eobs,
                                                  MACROBLOCKD *xd);
 
 void vp9_dequant_idct_add_uv_block_4x4_inplace_c(int16_t *q, const int16_t *dq,
@@ -92,7 +86,6 @@
                                                  unsigned char *dstu,
                                                  unsigned char *dstv,
                                                  int stride,
-                                                 uint16_t *eobs,
                                                  MACROBLOCKD *xd);
 
 #endif
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -295,25 +295,24 @@
 int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
                          MACROBLOCKD* const xd,
                          BOOL_DECODER* const bc) {
-  uint16_t *const eobs = xd->eobs;
   const int segment_id = xd->mode_info_context->mbmi.segment_id;
   int c, i, eobtotal = 0, seg_eob;
 
   // Luma block
-  eobs[0] = c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
-                             DCT_DCT, get_eob(xd, segment_id, 1024),
-                             xd->sb_coeff_data.qcoeff,
-                             vp9_default_zig_zag1d_32x32,
-                             TX_32X32);
+  c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
+                   DCT_DCT, get_eob(xd, segment_id, 1024),
+                   xd->sb_coeff_data.qcoeff,
+                   vp9_default_zig_zag1d_32x32, TX_32X32);
+  xd->block[0].eob = c;
   eobtotal += c;
 
   // 16x16 chroma blocks
   seg_eob = get_eob(xd, segment_id, 256);
   for (i = 16; i < 24; i += 4) {
-    eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, DCT_DCT, seg_eob,
-                               xd->sb_coeff_data.qcoeff + 1024 + (i - 16) * 64,
-                               vp9_default_zig_zag1d_16x16,
-                               TX_16X16);
+    c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, DCT_DCT, seg_eob,
+                     xd->sb_coeff_data.qcoeff + 1024 + (i - 16) * 64,
+                     vp9_default_zig_zag1d_16x16, TX_16X16);
+    xd->block[i].eob = c;
     eobtotal += c;
   }
 
@@ -323,25 +322,24 @@
 static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
                                       MACROBLOCKD* const xd,
                                       BOOL_DECODER* const bc) {
-  uint16_t *const eobs = xd->eobs;
   const int segment_id = xd->mode_info_context->mbmi.segment_id;
   int c, i, eobtotal = 0, seg_eob;
 
   // Luma block
-  eobs[0] = c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
-                             get_tx_type(xd, &xd->block[0]),
-                             get_eob(xd, segment_id, 256),
-                             xd->qcoeff, vp9_default_zig_zag1d_16x16,
-                             TX_16X16);
+  c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
+                   get_tx_type(xd, &xd->block[0]),
+                   get_eob(xd, segment_id, 256),
+                   xd->qcoeff, vp9_default_zig_zag1d_16x16, TX_16X16);
+  xd->block[0].eob = c;
   eobtotal += c;
 
   // 8x8 chroma blocks
   seg_eob = get_eob(xd, segment_id, 64);
   for (i = 16; i < 24; i += 4) {
-    eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
-                               DCT_DCT, seg_eob, xd->block[i].qcoeff,
-                               vp9_default_zig_zag1d_8x8,
-                               TX_8X8);
+    c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
+                     DCT_DCT, seg_eob, xd->block[i].qcoeff,
+                     vp9_default_zig_zag1d_8x8, TX_8X8);
+    xd->block[i].eob = c;
     eobtotal += c;
   }
   return eobtotal;
@@ -350,7 +348,6 @@
 static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
                                     MACROBLOCKD* const xd,
                                     BOOL_DECODER* const bc) {
-  uint16_t *const eobs = xd->eobs;
   int c, i, eobtotal = 0, seg_eob;
   const int segment_id = xd->mode_info_context->mbmi.segment_id;
 
@@ -357,10 +354,11 @@
   // luma blocks
   seg_eob = get_eob(xd, segment_id, 64);
   for (i = 0; i < 16; i += 4) {
-    eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC,
-                               get_tx_type(xd, xd->block + i),
-                               seg_eob, xd->block[i].qcoeff,
-                               vp9_default_zig_zag1d_8x8, TX_8X8);
+    c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC,
+                     get_tx_type(xd, xd->block + i),
+                     seg_eob, xd->block[i].qcoeff,
+                     vp9_default_zig_zag1d_8x8, TX_8X8);
+    xd->block[i].eob = c;
     eobtotal += c;
   }
 
@@ -370,16 +368,18 @@
     // use 4x4 transform for U, V components in I8X8/splitmv prediction mode
     seg_eob = get_eob(xd, segment_id, 16);
     for (i = 16; i < 24; i++) {
-      eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
-                                 DCT_DCT, seg_eob, xd->block[i].qcoeff,
-                                 vp9_default_zig_zag1d_4x4, TX_4X4);
+      c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
+                       DCT_DCT, seg_eob, xd->block[i].qcoeff,
+                       vp9_default_zig_zag1d_4x4, TX_4X4);
+      xd->block[i].eob = c;
       eobtotal += c;
     }
   } else {
     for (i = 16; i < 24; i += 4) {
-      eobs[i] = c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
-                                 DCT_DCT, seg_eob, xd->block[i].qcoeff,
-                                 vp9_default_zig_zag1d_8x8, TX_8X8);
+      c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV,
+                       DCT_DCT, seg_eob, xd->block[i].qcoeff,
+                       vp9_default_zig_zag1d_8x8, TX_8X8);
+      xd->block[i].eob = c;
       eobtotal += c;
     }
   }
@@ -391,12 +391,11 @@
                             BOOL_DECODER* const bc,
                             PLANE_TYPE type, int i, int seg_eob,
                             TX_TYPE tx_type, const int *scan) {
-  uint16_t *const eobs = xd->eobs;
   int c;
 
   c = decode_coefs(dx, xd, bc, i, type, tx_type, seg_eob,
                    xd->block[i].qcoeff, scan, TX_4X4);
-  eobs[i] = c;
+  xd->block[i].eob = c;
 
   return c;
 }
--- a/vp9/decoder/vp9_idct_blk.c
+++ b/vp9/decoder/vp9_idct_blk.c
@@ -16,13 +16,12 @@
                                                 const int16_t *dq,
                                                 uint8_t *dst,
                                                 int stride,
-                                                uint16_t *eobs,
                                                 MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 4; i++) {
     for (j = 0; j < 4; j++) {
-      if (*eobs++ > 1) {
+      if (xd->block[i * 4 + j].eob > 1) {
         xd->itxm_add(q, dq, dst, dst, stride, stride);
       } else {
         xd->dc_only_itxm_add(q[0]*dq[0], dst, dst, stride, stride);
@@ -40,12 +39,12 @@
 void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
                                     uint8_t *pre,
                                     uint8_t *dst,
-                                    int stride, uint16_t *eobs) {
+                                    int stride, MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 4; i++) {
     for (j = 0; j < 4; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[i * 4 + j].eob > 1)
         vp9_dequant_idct_add_c(q, dq, pre, dst, 16, stride);
       else {
         vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride);
@@ -65,12 +64,12 @@
 void vp9_dequant_idct_add_uv_block_c(int16_t *q, const int16_t *dq,
                                      uint8_t *pre, uint8_t *dstu,
                                      uint8_t *dstv, int stride,
-                                     uint16_t *eobs) {
+                                     MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[16 + i * 2 + j].eob > 1)
         vp9_dequant_idct_add_c(q, dq, pre, dstu, 8, stride);
       else {
         vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride);
@@ -88,7 +87,7 @@
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[20 + i * 2 + j].eob > 1)
         vp9_dequant_idct_add_c(q, dq, pre, dstv, 8, stride);
       else {
         vp9_dc_only_idct_add_c(q[0]*dq[0], pre, dstv, 8, stride);
@@ -109,13 +108,12 @@
                                                  uint8_t *dstu,
                                                  uint8_t *dstv,
                                                  int stride,
-                                                 uint16_t *eobs,
                                                  MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1) {
+      if (xd->block[16 + i * 2 + j].eob > 1) {
         xd->itxm_add(q, dq, dstu, dstu, stride, stride);
       } else {
         xd->dc_only_itxm_add(q[0]*dq[0], dstu, dstu, stride, stride);
@@ -131,7 +129,7 @@
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1) {
+      if (xd->block[20 + i * 2 + j].eob > 1) {
         xd->itxm_add(q, dq, dstv, dstv, stride, stride);
       } else {
         xd->dc_only_itxm_add(q[0]*dq[0], dstv, dstv, stride, stride);
@@ -150,38 +148,37 @@
                                                 const int16_t *dq,
                                                 uint8_t *dst,
                                                 int stride,
-                                                uint16_t *eobs,
                                                 MACROBLOCKD *xd) {
-  vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->eobs[0]);
+  vp9_dequant_idct_add_8x8_c(q, dq, dst, dst, stride, stride, xd->block[0].eob);
 
   vp9_dequant_idct_add_8x8_c(&q[64], dq, dst + 8,
-                             dst + 8, stride, stride, xd->eobs[4]);
+                             dst + 8, stride, stride, xd->block[4].eob);
 
   vp9_dequant_idct_add_8x8_c(&q[128], dq, dst + 8 * stride,
                              dst + 8 * stride, stride, stride,
-                             xd->eobs[8]);
+                             xd->block[8].eob);
 
   vp9_dequant_idct_add_8x8_c(&q[192], dq, dst + 8 * stride + 8,
                              dst + 8 * stride + 8, stride, stride,
-                             xd->eobs[12]);
+                             xd->block[12].eob);
 }
 
 void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
                                         uint8_t *pre,
                                         uint8_t *dst,
-                                        int stride, uint16_t *eobs,
-                                        MACROBLOCKD *xd) {
+                                        int stride, MACROBLOCKD *xd) {
   uint8_t *origdest = dst;
   uint8_t *origpred = pre;
 
-  vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->eobs[0]);
+  vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->block[0].eob);
   vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
-                             origdest + 8, 16, stride, xd->eobs[4]);
+                             origdest + 8, 16, stride, xd->block[4].eob);
   vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
-                             origdest + 8 * stride, 16, stride, xd->eobs[8]);
+                             origdest + 8 * stride, 16, stride,
+                             xd->block[8].eob);
   vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
                              origdest + 8 * stride + 8, 16, stride,
-                             xd->eobs[12]);
+                             xd->block[12].eob);
 }
 
 void vp9_dequant_idct_add_uv_block_8x8_c(int16_t *q, const int16_t *dq,
@@ -188,14 +185,13 @@
                                          uint8_t *pre,
                                          uint8_t *dstu,
                                          uint8_t *dstv,
-                                         int stride, uint16_t *eobs,
-                                         MACROBLOCKD *xd) {
-  vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->eobs[16]);
+                                         int stride, MACROBLOCKD *xd) {
+  vp9_dequant_idct_add_8x8_c(q, dq, pre, dstu, 8, stride, xd->block[16].eob);
 
   q    += 64;
   pre  += 64;
 
-  vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->eobs[20]);
+  vp9_dequant_idct_add_8x8_c(q, dq, pre, dstv, 8, stride, xd->block[20].eob);
 }
 
 void vp9_dequant_idct_add_uv_block_8x8_inplace_c(int16_t *q, const int16_t *dq,
@@ -202,14 +198,13 @@
                                                  uint8_t *dstu,
                                                  uint8_t *dstv,
                                                  int stride,
-                                                 uint16_t *eobs,
                                                  MACROBLOCKD *xd) {
   vp9_dequant_idct_add_8x8_c(q, dq, dstu, dstu, stride, stride,
-                             xd->eobs[16]);
+                             xd->block[16].eob);
 
   q += 64;
   vp9_dequant_idct_add_8x8_c(q, dq, dstv, dstv, stride, stride,
-                             xd->eobs[20]);
+                             xd->block[20].eob);
 }
 
 
@@ -216,12 +211,12 @@
 void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
                                              uint8_t *pre,
                                              uint8_t *dst,
-                                             int stride, uint16_t *eobs) {
+                                             int stride, MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 4; i++) {
     for (j = 0; j < 4; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[i * 4 + j].eob > 1)
         vp9_dequant_idct_add_lossless_c(q, dq, pre, dst, 16, stride);
       else {
         vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dst, 16, stride);
@@ -243,12 +238,12 @@
                                               uint8_t *dstu,
                                               uint8_t *dstv,
                                               int stride,
-                                              uint16_t *eobs) {
+                                              MACROBLOCKD *xd) {
   int i, j;
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[16 + i * 2 + j].eob > 1)
         vp9_dequant_idct_add_lossless_c(q, dq, pre, dstu, 8, stride);
       else {
         vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstu, 8, stride);
@@ -266,7 +261,7 @@
 
   for (i = 0; i < 2; i++) {
     for (j = 0; j < 2; j++) {
-      if (*eobs++ > 1)
+      if (xd->block[20 + i * 2 + j].eob > 1)
         vp9_dequant_idct_add_lossless_c(q, dq, pre, dstv, 8, stride);
       else {
         vp9_dc_only_inv_walsh_add_c(q[0]*dq[0], pre, dstv, 8, stride);