frontends/va: preparing to disable h264 extension flag in vaapi dec path
In frame reference frame, the top/bottom field reference flag also needs to be set, so does the long term reference flag. Signed-off-by: Ruijing Dong <ruijing.dong@amd.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14484>
This commit is contained in:
@@ -45,6 +45,7 @@ void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context,
|
||||
{
|
||||
VAPictureParameterBufferH264 *h264 = buf->data;
|
||||
unsigned int top_or_bottom_field;
|
||||
bool is_ref;
|
||||
unsigned i;
|
||||
|
||||
assert(buf->size >= sizeof(VAPictureParameterBufferH264) && buf->num_elements == 1);
|
||||
@@ -126,16 +127,16 @@ void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context,
|
||||
|
||||
top_or_bottom_field = h264->ReferenceFrames[i].flags &
|
||||
(VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD);
|
||||
context->desc.h264.is_long_term[i] = (h264->ReferenceFrames[i].flags &
|
||||
(VA_PICTURE_H264_SHORT_TERM_REFERENCE |
|
||||
VA_PICTURE_H264_LONG_TERM_REFERENCE)) !=
|
||||
VA_PICTURE_H264_SHORT_TERM_REFERENCE;
|
||||
is_ref = !!(h264->ReferenceFrames[i].flags &
|
||||
(VA_PICTURE_H264_SHORT_TERM_REFERENCE | VA_PICTURE_H264_LONG_TERM_REFERENCE));
|
||||
context->desc.h264.is_long_term[i] = !!(h264->ReferenceFrames[i].flags &
|
||||
VA_PICTURE_H264_LONG_TERM_REFERENCE);
|
||||
context->desc.h264.top_is_reference[i] =
|
||||
!context->desc.h264.is_long_term[i] ||
|
||||
!!(h264->ReferenceFrames[i].flags & VA_PICTURE_H264_TOP_FIELD);
|
||||
!!(h264->ReferenceFrames[i].flags & VA_PICTURE_H264_TOP_FIELD) ||
|
||||
((!top_or_bottom_field) && is_ref);
|
||||
context->desc.h264.bottom_is_reference[i] =
|
||||
!context->desc.h264.is_long_term[i] ||
|
||||
!!(h264->ReferenceFrames[i].flags & VA_PICTURE_H264_BOTTOM_FIELD);
|
||||
!!(h264->ReferenceFrames[i].flags & VA_PICTURE_H264_BOTTOM_FIELD) ||
|
||||
((!top_or_bottom_field) && is_ref);
|
||||
context->desc.h264.field_order_cnt_list[i][0] =
|
||||
top_or_bottom_field != VA_PICTURE_H264_BOTTOM_FIELD ?
|
||||
h264->ReferenceFrames[i].TopFieldOrderCnt: INT_MAX;
|
||||
|
||||
Reference in New Issue
Block a user