Make ducky encode fully comply with the max ref frame Make the ducky encode fully comply with the max reference frame constraint and follow the decisions from rc library. BUG=b/240412144 Change-Id: I7d7f4545e74729a9fe886221ee4f6c5b15b012f5
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c index f3bbc71..82f55c7 100644 --- a/av1/encoder/encode_strategy.c +++ b/av1/encoder/encode_strategy.c
@@ -996,14 +996,20 @@ #if !CONFIG_REALTIME_ONLY if (cpi->use_ducky_encode && cpi->ducky_encode_info.frame_info.gop_mode == DUCKY_ENCODE_GOP_MODE_RCL) { - for (int i = 0; i < REF_FRAMES; ++i) remapped_ref_idx[i] = 0; + int valid_rf_idx = 0; for (int rf = LAST_FRAME; rf < REF_FRAMES; ++rf) { if (cpi->ppi->gf_group.ref_frame_list[gf_index][rf] != INVALID_IDX) { remapped_ref_idx[rf - LAST_FRAME] = cpi->ppi->gf_group.ref_frame_list[gf_index][rf]; + valid_rf_idx = remapped_ref_idx[rf - LAST_FRAME]; } } + for (int i = 0; i < REF_FRAMES; ++i) { + if (remapped_ref_idx[i] == INVALID_IDX) + remapped_ref_idx[i] = valid_rf_idx; + } + return; } #endif // !CONFIG_REALTIME_ONLY