Long term references are not kept long term.
@alexismt reported here https://github.com/AOMediaCodec/av2-spec-internal/issues/742#issuecomment-3965063438 that the design intention of long term references was:
that the OLK process should not reset any slots with long term reference frames.
However, the code does not implement this:
static void reset_buffer_other_than_OLK(AV2Decoder *pbi) {
AV2_COMMON *const cm = &pbi->common;
const SequenceHeader *const seq_params = &cm->seq_params;
BufferPool *const pool = cm->buffer_pool;
int ref_flags_to_keep = 0;
for (int layer = 0; layer <= seq_params->max_mlayer_id; layer++) {
if (cm->olk_refresh_frame_flags[layer] == -1) continue;
ref_flags_to_keep |= cm->olk_refresh_frame_flags[layer];
}
for (int ref_index = 0; ref_index < seq_params->ref_frames; ref_index++) {
if (!((ref_flags_to_keep >> ref_index) & 1u)) {
decrease_ref_count(cm->ref_frame_map[ref_index], pool);
cm->ref_frame_map[ref_index] = NULL;
if (pbi->random_accessed) pbi->valid_for_referencing[ref_index] = 1;
}
}
}
Note that there is no code to keep long term references around.