Commit f094fe90 authored by Hui Su's avatar Hui Su

q-adapt-probs: add support for lv-map

Coding gain on keyframes
lowres 0.32%
midres 0.18%
hdres  0.05%

Change-Id: Ibc25f7b9acfc41e8e896e18765a5b0304e7434e6
parent b3db2069
......@@ -556,10 +556,34 @@ void av1_coef_pareto_cdfs(FRAME_CONTEXT *fc) {
fc->coef_head_cdfs[t][i][j][k][l], k == 0);
}
#if CONFIG_Q_ADAPT_PROBS
static int get_q_ctx(int q) {
if (q <= 20) return 0;
if (q <= 60) return 1;
if (q <= 120) return 2;
return 3;
}
#endif // CONFIG_Q_ADAPT_PROBS
void av1_default_coef_probs(AV1_COMMON *cm) {
const int index = AOMMIN(TOKEN_CDF_Q_CTXS - 1, cm->base_qindex / 64);
#if CONFIG_LV_MAP
(void)index;
#if CONFIG_Q_ADAPT_PROBS
const int index = get_q_ctx(cm->base_qindex);
av1_copy(cm->fc->txb_skip_cdf, av1_default_txb_skip_cdfs[index]);
av1_copy(cm->fc->eob_extra_cdf, av1_default_eob_extra_cdfs[index]);
av1_copy(cm->fc->dc_sign_cdf, av1_default_dc_sign_cdfs[index]);
av1_copy(cm->fc->coeff_br_cdf, av1_default_coeff_lps_multi_cdfs[index]);
av1_copy(cm->fc->coeff_base_cdf, av1_default_coeff_base_multi_cdfs[index]);
av1_copy(cm->fc->coeff_base_eob_cdf,
av1_default_coeff_base_eob_multi_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf16, av1_default_eob_multi16_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf32, av1_default_eob_multi32_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf64, av1_default_eob_multi64_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf128, av1_default_eob_multi128_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf256, av1_default_eob_multi256_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf512, av1_default_eob_multi512_cdfs[index]);
av1_copy(cm->fc->eob_flag_cdf1024, av1_default_eob_multi1024_cdfs[index]);
#else
av1_copy(cm->fc->txb_skip_cdf, av1_default_txb_skip_cdf);
av1_copy(cm->fc->eob_extra_cdf, av1_default_eob_extra_cdf);
av1_copy(cm->fc->dc_sign_cdf, av1_default_dc_sign_cdf);
......@@ -573,7 +597,9 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
av1_copy(cm->fc->eob_flag_cdf256, av1_default_eob_multi256);
av1_copy(cm->fc->eob_flag_cdf512, av1_default_eob_multi512);
av1_copy(cm->fc->eob_flag_cdf1024, av1_default_eob_multi1024);
#endif // CONFIG_Q_ADAPT_PROBS
#else
const int index = AOMMIN(TOKEN_CDF_Q_CTXS - 1, cm->base_qindex / 64);
av1_copy(cm->fc->coef_head_cdfs[TX_4X4],
(*av1_default_qctx_coef_cdfs[index])[TX_4X4]);
av1_copy(cm->fc->coef_head_cdfs[TX_8X8],
......@@ -587,7 +613,7 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
(*av1_default_qctx_coef_cdfs[index])[TX_32X32]);
#endif // CONFIG_TX64X64
av1_coef_pareto_cdfs(cm->fc);
#endif
#endif // CONFIG_LV_MAP
}
static void av1_average_cdf(aom_cdf_prob *cdf_ptr[], aom_cdf_prob *fc_cdf_ptr,
......
This diff is collapsed.
......@@ -142,6 +142,7 @@ set(CONFIG_OBU_SIZING 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OPT_REF_MV 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_PALETTE_THROUGHPUT 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_PARALLEL_DEBLOCKING 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_Q_ADAPT_PROBS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_RD_DEBUG 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_RECT_TX_EXT 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_RECT_TX_EXT_INTRA 1 CACHE NUMBER "AV1 experiment flag.")
......
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