Skip to content

Commit

Permalink
[Decode]Enhance VPL AV1 to handle no enough surfaces but app still
Browse files Browse the repository at this point in the history
submit frames
  • Loading branch information
huangli2018 authored and gfxVPLsdm committed Jan 9, 2025
1 parent 355905f commit 5ab5b23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions _studio/shared/umc/codec/av1_dec/include/umc_av1_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ namespace UMC_AV1_DECODER
DPBType frame_dpb;
UMC::FrameMemID m_index;
UMC::FrameMemID m_anchorFrameIdx; // application to specify anchor frame index used by current frame
bool mark_Added; //mark this frame has beed added into output_frames or not

protected:
virtual void Free()
Expand Down
21 changes: 6 additions & 15 deletions _studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,20 +1197,13 @@ namespace UMC_AV1_DECODER
if ((lastest_submitted_frame) && (!last_frame_header.show_existing_frame))
{
FrameHeader const& FH_OutTemp = lastest_submitted_frame->GetFrameHeader();
if (FH_OutTemp.show_frame) //display frame
if (FH_OutTemp.show_frame)//display frame
{
bool bAdded = false;
for(std::vector<AV1DecoderFrame*>::iterator iter=outputed_frames.begin(); iter!=outputed_frames.end(); iter++)
if (!lastest_submitted_frame->mark_Added)
{
AV1DecoderFrame* temp = *iter;
if (lastest_submitted_frame->UID == temp->UID)
{
bAdded = true;
break;
}
}
if (!bAdded)
outputed_frames.push_back(lastest_submitted_frame);
lastest_submitted_frame->mark_Added = true;
}
}
else
{
Expand All @@ -1237,10 +1230,8 @@ namespace UMC_AV1_DECODER
iter++;
}

// When no available buffer, don't update Curr buffer to avoid update DPB duplicated.
if(pCurrFrame!= NULL)
lastest_submitted_frame = pCurrFrame;

//update lateset_submitted_frame even pCurrFrame is nullptr(not enough frame)
lastest_submitted_frame = pCurrFrame;
last_frame_header = fh; //store latest frame header
}

Expand Down
1 change: 1 addition & 0 deletions _studio/shared/umc/codec/av1_dec/src/umc_av1_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ namespace UMC_AV1_DECODER
film_grain_disabled = false;

UID = -1;
mark_Added = false;

frame_time = -1;
frame_order = 0;
Expand Down

0 comments on commit 5ab5b23

Please sign in to comment.