Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAAPI VVC decoder #714

Closed
wants to merge 7 commits into from
Closed

Conversation

feiwan1
Copy link
Collaborator

@feiwan1 feiwan1 commented Mar 1, 2024

No description provided.

pic->param_allocated,
sizeof(*pic->param_buffers));
if (!pic->param_buffers)
return AVERROR(ENOMEM);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two issues if av_realloc_array failed

  1. pic->param_buffers is not released.
  2. you have updated pic->param_allocated, next "if (pic->nb_param_buffers == pic->param_allocated)" check is wrong

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If realloc fail, ff_vaapi_decode_cancel() will be called to destory all va buffer and release param_buffers handle.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved 2.

@@ -138,6 +140,10 @@ static VVCFrame *alloc_frame(VVCContext *s, VVCFrameContext *fc)
if (!frame->progress)
goto fail;

ret = ff_hwaccel_frame_priv_alloc(s->avctx, &frame->hwaccel_picture_private);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all software buffer allocation can be skipped, like rpl to progress
also all software delay frames can be removed. we do not need a delay for hw. we can output it immediately after vaEndPicture.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to keep software buffers there which can help check illegal syntax. And RPL may insert new ref frame to DPB in some special case, if skipped it, maybe cause unexpected error to HW. I will check how to remove defay frames.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delay logic in vvc native decoder may provide sync_depth function to HW like VAAPI encoder/vpp. And there is option that can turn OFF the delay. So I think it will be better to keep delay for HW too.

typedef struct VAAPIDecodePicture {
VASurfaceID output_surface;

int nb_param_buffers;
VABufferID param_buffers[MAX_PARAM_BUFFERS];
VABufferID *param_buffers;
int param_allocated;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/param_allocated/nb_allocated_buffers ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer param_allocated which is samilar with slices_allocated.

@feiwan1
Copy link
Collaborator Author

feiwan1 commented Mar 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants