shithub: libvpx

Download patch

ref: f857e074d7d761f668e998513f69ec2509efcadf
parent: ccc0577ab27a5eee2603fa5063110295c8dba7df
author: Dmitry Kovalev <dkovalev@google.com>
date: Thu Apr 4 06:49:17 EDT 2013

Fixing bug introduced by previous commit.

Inside decode_sb_4x4 it should be
"get_tx_type_4x4(mb, y_idx * y_size + x_idx)"
but it was
"get_tx_type_4x4(mb, y_idx * (2 * y_size) + x_idx)".
Also making code of decode_sb_4x4, decode_sb_8x8, and decode_sb_16x16
formatted in the same way.

Change-Id: I15c7bef4fb575f7e9da19f953912324cb35d24dd

--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -480,7 +480,7 @@
   }
 }
 
-static INLINE void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
+static void decode_sb_16x16(MACROBLOCKD *mb, int y_size) {
   const int y_count = y_size * y_size;
   const int uv_size = y_size / 2;
   const int uv_count = uv_size * uv_size;
@@ -495,8 +495,8 @@
     const int x_idx = n % y_size;
     const int y_idx = n / y_size;
     const int y_offset = (y_idx * 16) * mb->dst.y_stride + (x_idx * 16);
-    const TX_TYPE tx_type = get_tx_type_16x16(mb, (y_idx * (4 * y_size) +
-                                                   x_idx) * 4);
+    const TX_TYPE tx_type = get_tx_type_16x16(mb,
+                                (y_idx * (4 * y_size) + x_idx) * 4);
     if (tx_type == DCT_DCT) {
       vp9_dequant_idct_add_16x16(mb->qcoeff + n * 16 * 16,
                                  mb->block[0].dequant ,
@@ -534,13 +534,13 @@
   }
 }
 
-static INLINE void decode_sb_8x8(MACROBLOCKD *mb, int y_size) {
+static void decode_sb_8x8(MACROBLOCKD *mb, int y_size) {
   const int y_count = y_size * y_size;
   const int uv_size = y_size / 2;
   const int uv_count = uv_size * uv_size;
 
-  const int u_qcoeff_offset = 64 * y_count;
-  const int v_qcoeff_offset = u_qcoeff_offset + 64 * uv_count;
+  const int u_qcoeff_offset = (8 * 8) * y_count;
+  const int v_qcoeff_offset = u_qcoeff_offset + (8 * 8) * uv_count;
   const int u_eob_offset = 4 * y_count;
   const int v_eob_offset = u_eob_offset + 4 * uv_count;
   int n;
@@ -560,7 +560,8 @@
                                  mb->dst.y_stride, mb->dst.y_stride,
                                  mb->eobs[n * 4]);
     } else {
-      vp9_ht_dequant_idct_add_8x8_c(tx_type, mb->qcoeff + n * 8 * 8,
+      vp9_ht_dequant_idct_add_8x8_c(tx_type,
+                                    mb->qcoeff + n * 8 * 8,
                                     mb->block[0].dequant,
                                     mb->dst.y_buffer + y_offset,
                                     mb->dst.y_buffer + y_offset,
@@ -595,11 +596,10 @@
   const int uv_size = y_size / 2;
   const int uv_count = uv_size * uv_size;
 
-  const int u_qcoeff_offset = y_count * 4 * 4;
-  const int v_qcoeff_offset = u_qcoeff_offset + uv_count * 4 * 4;
+  const int u_qcoeff_offset = (4 * 4) * y_count;
+  const int v_qcoeff_offset = u_qcoeff_offset + (4 * 4) * uv_count;
   const int u_eob_offset = y_count;
   const int v_eob_offset = u_eob_offset + uv_count;
-
   int n;
 
   for (n = 0; n < y_count; n++) {
@@ -606,7 +606,7 @@
     const int x_idx = n % y_size;
     const int y_idx = n / y_size;
     const int y_offset = (y_idx * 4) * mb->dst.y_stride + (x_idx * 4);
-    const TX_TYPE tx_type = get_tx_type_4x4(mb, y_idx * (2 * y_size) + x_idx);
+    const TX_TYPE tx_type = get_tx_type_4x4(mb, y_idx * y_size + x_idx);
     if (tx_type == DCT_DCT) {
       mb->itxm_add(mb->qcoeff + n * 4 * 4,
                    mb->block[0].dequant,
@@ -615,12 +615,12 @@
                    mb->dst.y_stride, mb->dst.y_stride,
                    mb->eobs[n]);
     } else {
-      vp9_ht_dequant_idct_add_c(tx_type, mb->qcoeff + n * 4 * 4,
+      vp9_ht_dequant_idct_add_c(tx_type,
+                                mb->qcoeff + n * 4 * 4,
                                 mb->block[0].dequant,
                                 mb->dst.y_buffer + y_offset,
                                 mb->dst.y_buffer + y_offset,
-                                mb->dst.y_stride,
-                                mb->dst.y_stride,
+                                mb->dst.y_stride, mb->dst.y_stride,
                                 mb->eobs[n]);
     }
   }
@@ -630,17 +630,17 @@
     const int y_idx = n / uv_size;
     const int uv_offset = (y_idx * 4) * mb->dst.uv_stride + (x_idx * 4);
     mb->itxm_add(mb->qcoeff + u_qcoeff_offset + n * 4 * 4,
-        mb->block[16].dequant,
-        mb->dst.u_buffer + uv_offset,
-        mb->dst.u_buffer + uv_offset,
-        mb->dst.uv_stride, mb->dst.uv_stride,
-        mb->eobs[u_eob_offset + n]);
+                 mb->block[16].dequant,
+                 mb->dst.u_buffer + uv_offset,
+                 mb->dst.u_buffer + uv_offset,
+                 mb->dst.uv_stride, mb->dst.uv_stride,
+                 mb->eobs[u_eob_offset + n]);
     mb->itxm_add(mb->qcoeff + v_qcoeff_offset + n * 4 * 4,
-        mb->block[20].dequant,
-        mb->dst.v_buffer + uv_offset,
-        mb->dst.v_buffer + uv_offset,
-        mb->dst.uv_stride, mb->dst.uv_stride,
-        mb->eobs[v_eob_offset + n]);
+                 mb->block[20].dequant,
+                 mb->dst.v_buffer + uv_offset,
+                 mb->dst.v_buffer + uv_offset,
+                 mb->dst.uv_stride, mb->dst.uv_stride,
+                 mb->eobs[v_eob_offset + n]);
   }
 }