Commit e30a47ca authored by Yushin Cho's avatar Yushin Cho

cdef-dist and daala-dist is runtime switchable

Use --tune=[cdef-dist|daala-dist] to enable them.

Also, this commit set the use_activity_masking of PVQ as 0 by deafult,
which means that PVQ assumes daala-dist is not used by default.

Since we're currently not signaling which metric the encoder did use
in the bitstream, the compile flag AV1_PVQ_ENABLE_ACTIVITY_MASKING will tell PVQ
whether daala-dist is used or not.

This commit is the last part of prep-work to remove DIST_8X8, CDEF_DIST,
and DAALA_DIST experimental flags.

Change-Id: Ia465b4d6fe64aac7f04852c8f9f4bac3409d2435
parent 50e5d4ad
......@@ -19,11 +19,7 @@
extern const uint16_t EXP_CDF_TABLE[][16];
extern const uint16_t LAPLACE_OFFSET[];
#if CONFIG_DAALA_DIST
#define AV1_PVQ_ENABLE_ACTIVITY_MASKING (1)
#else
#define AV1_PVQ_ENABLE_ACTIVITY_MASKING (0)
#endif
# define PVQ_MAX_PARTITIONS (1 + 3*(OD_TXSIZES-1))
......
......@@ -14044,7 +14044,7 @@ static uint16_t wt_matrix_ref[NUM_QM_LEVELS][2][QM_TOTAL_SIZE] = {
};
#endif
#if CONFIG_PVQ || CONFIG_DAALA_DIST
#if CONFIG_PVQ
/* Quantization matrices for 8x8. For other block sizes, we currently just do
resampling. */
/* Flat quantization, i.e. optimize for PSNR. */
......
......@@ -99,7 +99,7 @@ static INLINE int get_dq_profile_from_ctx(int qindex, int q_ctx, int is_inter,
}
#endif // CONFIG_NEW_QUANT
#if CONFIG_PVQ || CONFIG_DAALA_DIST
#if CONFIG_PVQ
extern const int OD_QM8_Q4_FLAT[];
extern const int OD_QM8_Q4_HVS[];
#endif
......
......@@ -3659,10 +3659,6 @@ static void daala_dec_init(AV1_COMMON *const cm, daala_dec_ctx *daala_dec,
// TODO(yushin) : activity masking info needs be signaled by a bitstream
daala_dec->use_activity_masking = AV1_PVQ_ENABLE_ACTIVITY_MASKING;
#if !CONFIG_DAALA_DIST
daala_dec->use_activity_masking = 0;
#endif
if (daala_dec->use_activity_masking)
daala_dec->qm = OD_HVS_QM;
else
......
......@@ -3754,7 +3754,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
decoded_8x8 = (uint8_t *)x->decoded_8x8;
dist_8x8 =
av1_dist_8x8(cpi, xd, x->plane[0].src.buf - 4 * src_stride - 4,
av1_dist_8x8(cpi, x, x->plane[0].src.buf - 4 * src_stride - 4,
src_stride, decoded_8x8, 8, BLOCK_8X8, 8, 8, 8, 8,
x->qindex)
<< 4;
......@@ -3939,7 +3939,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
#endif
decoded_8x8 = (uint8_t *)x->decoded_8x8;
dist_8x8 = av1_dist_8x8(cpi, xd, x->plane[0].src.buf - 4 * src_stride,
dist_8x8 = av1_dist_8x8(cpi, x, x->plane[0].src.buf - 4 * src_stride,
src_stride, decoded_8x8, 8, BLOCK_8X8, 8, 8, 8,
8, x->qindex)
<< 4;
......@@ -4121,7 +4121,7 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
decoded_8x8 = (uint8_t *)x->decoded_8x8;
dist_8x8 =
av1_dist_8x8(cpi, xd, x->plane[0].src.buf - 4, src_stride,
av1_dist_8x8(cpi, x, x->plane[0].src.buf - 4, src_stride,
decoded_8x8, 8, BLOCK_8X8, 8, 8, 8, 8, x->qindex)
<< 4;
sum_rdc.dist = sum_rdc.dist - sum_rdc.dist_y + dist_8x8;
......
This diff is collapsed.
......@@ -71,7 +71,7 @@ void av1_dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
OUTPUT_STATUS output_status);
#if CONFIG_DIST_8X8
int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCKD *xd,
int64_t av1_dist_8x8(const 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);
......
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