Commit a3f7d2ef authored by Angie Chiang's avatar Angie Chiang

Reset txk_type to DCT_DCT whenever eob is zero

Change-Id: I2212609532783849ac5d8c91aec6e34af48f01f7
parent 5b5f4df7
......@@ -37,6 +37,7 @@
#include "av1/common/daala_inv_txfm.h"
#endif
#include "av1/encoder/rd.h"
#include "av1/encoder/rdopt.h"
#if CONFIG_CFL
#include "av1/common/cfl.h"
......@@ -661,6 +662,19 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
pd->dst.stride, p->eobs[block],
cm->reduced_tx_set_used);
}
#if CONFIG_TXK_SEL
if (plane == 0 && p->eobs[block] == 0) {
#if DISABLE_TRELLISQ_SEARCH
xd->mi[0]->mbmi.txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col] =
DCT_DCT;
#else
assert(xd->mi[0]->mbmi.txk_type[blk_row << MAX_MIB_SIZE_LOG2 + blk_col] ==
DCT_DCT);
#endif
}
#endif // CONFIG_TXK_SEL
#if CONFIG_MISMATCH_DEBUG
if (dry_run == OUTPUT_ENABLED) {
int pixel_c, pixel_r;
......@@ -934,6 +948,18 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
AV1_XFORM_QUANT_FP);
av1_optimize_b(cm, x, plane, blk_row, blk_col, block, plane_bsize, tx_size,
a, l, CONFIG_LV_MAP);
#if CONFIG_TXK_SEL
if (plane == 0 && p->eobs[block] == 0) {
#if DISABLE_TRELLISQ_SEARCH
xd->mi[0]->mbmi.txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col] =
DCT_DCT;
#else
assert(xd->mi[0]->mbmi.txk_type[blk_row << MAX_MIB_SIZE_LOG2 + blk_col] ==
DCT_DCT);
#endif
}
#endif // CONFIG_TXK_SEL
} else {
av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
AV1_XFORM_QUANT_B);
......
......@@ -340,6 +340,9 @@ void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
(void)blk_col;
aom_write_bin(w, eob == 0,
ec_ctx->txb_skip_cdf[txs_ctx][txb_ctx->txb_skip_ctx], 2);
if (plane == 0 && eob == 0) {
assert(tx_type == DCT_DCT);
}
if (eob == 0) return;
av1_txb_init_levels(tcoeff, width, height, levels);
......@@ -2575,7 +2578,7 @@ int64_t av1_search_txk_type(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
av1_merge_rd_stats(rd_stats, &best_rd_stats);
if (best_eob == 0 && is_inter_block(mbmi)) best_tx_type = DCT_DCT;
if (best_eob == 0) best_tx_type = DCT_DCT;
if (plane == 0)
mbmi->txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col] = best_tx_type;
......
......@@ -71,19 +71,19 @@ int av1_count_colors_highbd(const uint8_t *src8, int stride, int rows, int cols,
int bit_depth, int *val_count);
#endif // CONFIG_HIGHBITDEPTH
void av1_dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
void av1_dist_block(const struct AV1_COMP *cpi, MACROBLOCK *x, int plane,
BLOCK_SIZE plane_bsize, int block, int blk_row, int blk_col,
TX_SIZE tx_size, int64_t *out_dist, int64_t *out_sse,
OUTPUT_STATUS output_status);
#if CONFIG_DIST_8X8
int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x,
int64_t av1_dist_8x8(const struct AV1_COMP *const cpi, const MACROBLOCK *x,
const uint8_t *src, int src_stride, const uint8_t *dst,
int dst_stride, const BLOCK_SIZE tx_bsize, int bsw,
int bsh, int visible_w, int visible_h, int qindex);
#endif
int av1_cost_coeffs(const AV1_COMP *const cpi, MACROBLOCK *x, int plane,
int av1_cost_coeffs(const struct AV1_COMP *const cpi, MACROBLOCK *x, int plane,
int blk_row, int blk_col, int block, TX_SIZE tx_size,
const SCAN_ORDER *scan_order, const ENTROPY_CONTEXT *a,
const ENTROPY_CONTEXT *l, int use_fast_coef_costing);
......@@ -92,11 +92,11 @@ void av1_rd_pick_intra_mode_sb(const struct AV1_COMP *cpi, struct macroblock *x,
struct RD_STATS *rd_cost, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx, int64_t best_rd);
unsigned int av1_get_sby_perpixel_variance(const AV1_COMP *cpi,
unsigned int av1_get_sby_perpixel_variance(const struct AV1_COMP *cpi,
const struct buf_2d *ref,
BLOCK_SIZE bs);
#if CONFIG_HIGHBITDEPTH
unsigned int av1_high_get_sby_perpixel_variance(const AV1_COMP *cpi,
unsigned int av1_high_get_sby_perpixel_variance(const struct AV1_COMP *cpi,
const struct buf_2d *ref,
BLOCK_SIZE bs, int bd);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment