]> granicus.if.org Git - libvpx/commitdiff
Separate coefficient cost of U/V planes in write_modes_b()
authorAngie Chiang <angiebird@google.com>
Thu, 3 Nov 2016 23:01:03 +0000 (16:01 -0700)
committerAngie Chiang <angiebird@google.com>
Fri, 4 Nov 2016 18:12:44 +0000 (11:12 -0700)
Change-Id: Ie3082db5b0fead8c322b2aeede4eff7cd723ea12

av1/common/blockd.h
av1/encoder/bitstream.c

index 53bca13df3fe8f5cc6ede88d8a17dad61ab34b0e..1d08cfab439edd7ff376cf969e3fb20ced2f8ff3 100644 (file)
@@ -251,8 +251,7 @@ typedef struct {
   int current_q_index;
 #endif
 #if CONFIG_RD_DEBUG
-  int64_t txb_cost_y;
-  int64_t txb_cost_uv;
+  int64_t txb_coeff_cost[MAX_MB_PLANE];
   int mi_row;
   int mi_col;
 #endif
index 568852f5e45b1c4656b16601f3dd00c152b74637..fa6b905dd004f7f69f1318f20d3da1097c3f6263 100644 (file)
@@ -1756,8 +1756,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
   int plane;
   int bh, bw;
 #if CONFIG_RD_DEBUG
-  int64_t txb_cost_y = 0;
-  int64_t txb_cost_uv = 0;
+  int64_t txb_coeff_cost[MAX_MB_PLANE] = { 0 };
 #endif
 #if CONFIG_RANS
   (void)tok;
@@ -1903,10 +1902,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
 #endif  // CONFIG_VAR_TX
 
 #if CONFIG_RD_DEBUG
-      if (plane == 0)
-        txb_cost_y += token_stats.cost;
-      else
-        txb_cost_uv += token_stats.cost;
+      txb_coeff_cost[plane] += token_stats.cost;
 #else
       (void)token_stats;
 #endif
@@ -1916,14 +1912,11 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
     }
   }
 #if CONFIG_RD_DEBUG
-  if (m->mbmi.txb_cost_y != txb_cost_y) {
-    dump_mode_info(m);
-    assert(0);
-  }
-
-  if (m->mbmi.txb_cost_uv != txb_cost_uv) {
-    dump_mode_info(m);
-    assert(0);
+  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
+    if (m->mbmi.txb_coeff_cost[plane] != txb_coeff_cost[plane]) {
+      dump_mode_info(m);
+      assert(0);
+    }
   }
 #endif
 }