RTC: Account for missing comp_ref_type_cost
Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR | SSIM | SPD |
|---------|----------|----------|----------|---------|-------|
| 7 | rtc | -0.120% | -0.184% | -0.067% | -0.1% |
| 7 | rtc_derf | +0.090% | +0.083% | +0.166% | -0.1% |
|---------|----------|----------|----------|---------|-------|
| 8 | rtc | -0.077% | -0.095% | -0.076% | -0.1% |
| 8 | rtc_derf | -0.047% | -0.023% | -0.041% | -0.2% |
|---------|----------|----------|----------|---------|-------|
| 9 | rtc | -0.085% | -0.067% | -0.012% | -0.2% |
| 9 | rtc_derf | +0.000% | +0.000% | +0.000% | -0.0% |
|---------|----------|----------|----------|---------|-------|
| 10 | rtc | -0.001% | +0.000% | -0.037% | -0.2% |
| 10 | rtc_derf | +0.000% | +0.000% | +0.000% | -0.0% |
STATS_CHANGED
Change-Id: I34a859486f569820cdb7faad6a13869d6bc4d799
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index 2b5fac6..8ac3b5c 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -431,7 +431,7 @@
static void estimate_single_ref_frame_costs(const AV1_COMMON *cm,
const MACROBLOCKD *xd,
const ModeCosts *mode_costs,
- int segment_id,
+ int segment_id, BLOCK_SIZE bsize,
unsigned int *ref_costs_single) {
int seg_ref_active =
segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
@@ -442,6 +442,11 @@
ref_costs_single[INTRA_FRAME] =
mode_costs->intra_inter_cost[intra_inter_ctx][0];
unsigned int base_cost = mode_costs->intra_inter_cost[intra_inter_ctx][1];
+ if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT &&
+ is_comp_ref_allowed(bsize)) {
+ const int comp_ref_type_ctx = av1_get_comp_reference_type_context(xd);
+ base_cost += mode_costs->comp_ref_type_cost[comp_ref_type_ctx][1];
+ }
ref_costs_single[LAST_FRAME] = base_cost;
ref_costs_single[GOLDEN_FRAME] = base_cost;
ref_costs_single[ALTREF_FRAME] = base_cost;
@@ -2756,7 +2761,7 @@
const ModeCosts *mode_costs = &x->mode_costs;
- estimate_single_ref_frame_costs(cm, xd, mode_costs, segment_id,
+ estimate_single_ref_frame_costs(cm, xd, mode_costs, segment_id, bsize,
ref_costs_single);
memset(&mode_checked[0][0], 0, MB_MODE_COUNT * REF_FRAMES);