Skip to content

Commit

Permalink
[AV1e/lib] Refine AV1 DPB refresh (#6346)
Browse files Browse the repository at this point in the history
If DPB size is smaller than 8, the location beyond valid DPB slots will only be refreshed by Key frame.
This will make key frame always cached in decoder, and this commit refines it by refreshing all these untouched slots for each ref frame.

Co-authored-by: Xue, Maxim <[email protected]>
  • Loading branch information
gfxVPLsdm and MaximIntel authored Jan 4, 2024
1 parent 8a21ec6 commit 85615c6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2251,7 +2251,7 @@ inline void SetTaskDPBRefresh(
auto& refreshRefFrames = task.RefreshFrameFlags;

if (IsI(task.FrameType))
std::fill(refreshRefFrames.begin(), refreshRefFrames.end(), static_cast<mfxU8>(1));
std::fill(refreshRefFrames.begin(), refreshRefFrames.end(), mfxU8(1));
else if (IsRef(task.FrameType))
{
// At first find all rejected LTRs to refresh them with current frame
Expand Down Expand Up @@ -2286,6 +2286,10 @@ inline void SetTaskDPBRefresh(
// If this frame is not put into DPB, it will not be ref-frame
if (std::find(refreshRefFrames.begin(), refreshRefFrames.end(), 1) == refreshRefFrames.end())
task.FrameType &= ~MFX_FRAMETYPE_REF;
else
{
std::fill(refreshRefFrames.begin() + task.DPB.size(), refreshRefFrames.end(), mfxU8(1));
}
}

}
Expand Down

0 comments on commit 85615c6

Please sign in to comment.