frontends/va: reset roi number

reason:
   roi number is an indication to do qp_map in vcn encoder.
   if not resetting this number, the previous roi style
   will be used if not changed, or not used. In the case
   non roi case mixed with roi, the behavior will not be
   expected.

reset roi_num at the beginning of each frame, if application
doesn't send roi map, then roi will be stopped.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30665>
This commit is contained in:
Ruijing Dong 2024-08-14 13:57:07 -04:00 committed by Marge Bot
parent 8485067541
commit ac45948136
2 changed files with 4 additions and 1 deletions

View file

@ -290,7 +290,7 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
value = VA_ENC_PACKED_HEADER_NONE;
if ((u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_MPEG4_AVC))
value |= ENC_PACKED_HEADERS_H264;
if ((u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_HEVC))
else if ((u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_HEVC))
value |= ENC_PACKED_HEADERS_HEVC;
else if (u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_AV1)
value |= ENC_PACKED_HEADERS_AV1;

View file

@ -146,12 +146,15 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende
switch (u_reduce_video_profile(context->templat.profile)) {
case PIPE_VIDEO_FORMAT_AV1:
context->desc.av1enc.metadata_flags.value = 0;
context->desc.av1enc.roi.num = 0;
break;
case PIPE_VIDEO_FORMAT_HEVC:
context->desc.h265enc.header_flags.value = 0;
context->desc.h265enc.roi.num = 0;
break;
case PIPE_VIDEO_FORMAT_MPEG4_AVC:
context->desc.h264enc.header_flags.value = 0;
context->desc.h264enc.roi.num = 0;
break;
default:
break;