} FILTER_INTRA_MODE_INFO;
#endif // CONFIG_FILTER_INTRA
+#if CONFIG_VAR_TX
+#define TXB_COEFF_COST_MAP_SIZE (2 * MAX_MIB_SIZE)
+
+// TODO(angiebird): Merge RD_COST and RD_STATS
+typedef struct RD_STATS {
+ int rate;
+ int64_t dist;
+ int64_t sse;
+ int skip;
+#if CONFIG_RD_DEBUG
+ int txb_coeff_cost[MAX_MB_PLANE];
+ int txb_coeff_cost_map[MAX_MB_PLANE][TXB_COEFF_COST_MAP_SIZE]
+ [TXB_COEFF_COST_MAP_SIZE];
+#endif
+} RD_STATS;
+#endif // CONFIG_VAR_TX
+
// This structure now relates to 8x8 block regions.
typedef struct {
// Common for both INTER and INTRA blocks
int current_q_index;
#endif
#if CONFIG_RD_DEBUG
- int64_t txb_coeff_cost[MAX_MB_PLANE];
+ RD_STATS rd_stats;
int mi_row;
int mi_col;
#endif
}
#if CONFIG_RD_DEBUG
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
- if (m->mbmi.txb_coeff_cost[plane] != txb_coeff_cost[plane]) {
+ if (m->mbmi.rd_stats.txb_coeff_cost[plane] != txb_coeff_cost[plane]) {
dump_mode_info(m);
assert(0);
}
mbmi->tx_size = best_tx;
#if CONFIG_RD_DEBUG
// record plane y's transform block coefficient cost
- mbmi->txb_coeff_cost[0] = rd_stats->txb_coeff_cost[0];
+ mbmi->rd_stats = *rd_stats;
#endif
memcpy(x->blk_skip[0], best_blk_skip, sizeof(best_blk_skip[0]) * n4);
}
inter_block_uvrd(cpi, x, &rd_stats_uv, bsize, ref_best_rd - rdcosty);
#if CONFIG_RD_DEBUG
// record uv planes' transform block coefficient cost
- mbmi->txb_coeff_cost[1] = rd_stats_uv.txb_coeff_cost[1];
- mbmi->txb_coeff_cost[2] = rd_stats_uv.txb_coeff_cost[2];
+ av1_merge_rd_stats(&mbmi->rd_stats, &rd_stats_uv);
#endif
*rate_uv = rd_stats_uv.rate;
distortion_uv = rd_stats_uv.dist;
struct RD_COST;
#if CONFIG_VAR_TX
-#define TXB_COEFF_COST_MAP_SIZE (2 * MAX_MIB_SIZE)
-
-// TODO(angiebird): Merge RD_COST and RD_STATS
-typedef struct RD_STATS {
- int rate;
- int64_t dist;
- int64_t sse;
- int skip;
-#if CONFIG_RD_DEBUG
- int txb_coeff_cost[MAX_MB_PLANE];
- int txb_coeff_cost_map[MAX_MB_PLANE][TXB_COEFF_COST_MAP_SIZE]
- [TXB_COEFF_COST_MAP_SIZE];
-#endif
-} RD_STATS;
-
static INLINE void av1_init_rd_stats(RD_STATS *rd_stats) {
#if CONFIG_RD_DEBUG
int plane;