frontends/va: partially updating RefPicList depends on slice type
problem casused by one frame with multiple slices and different slices type. Invalid referenced values came from slice P/I would overwrite previous update. Signed-off-by: Jasber Chen <yipeng.chen@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19943>
This commit is contained in:
@@ -228,9 +228,19 @@ void vlVaHandleSliceParameterBufferHEVC(vlVaContext *context, vlVaBuffer *buf)
|
||||
VASliceParameterBufferHEVC *h265 = buf->data;
|
||||
|
||||
assert(buf->size >= sizeof(VASliceParameterBufferHEVC) && buf->num_elements == 1);
|
||||
for (int i = 0 ; i < 2 ; i++) {
|
||||
|
||||
switch(h265->LongSliceFlags.fields.slice_type) {
|
||||
/* Depending on slice_type, only update relevant reference */
|
||||
case 0: /* HEVC_SLICE_B */
|
||||
for (int j = 0 ; j < 15 ; j++)
|
||||
context->desc.h265.RefPicList[i][j] = h265->RefPicList[i][j];
|
||||
context->desc.h265.RefPicList[1][j] = h265->RefPicList[1][j];
|
||||
FALLTHROUGH;
|
||||
case 1: /* HEVC_SLICE_P */
|
||||
for (int j = 0 ; j < 15 ; j++)
|
||||
context->desc.h265.RefPicList[0][j] = h265->RefPicList[0][j];
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
context->desc.h265.UseRefPicList = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user