d3d12: max_frame_poc workaround for infinite GOPs
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
This commit is contained in:
@@ -718,6 +718,8 @@ d3d12_video_encoder_update_h264_gop_configuration(struct d3d12_video_encoder *pD
|
||||
// So in that case, derive an artificial log2_max_pic_order_cnt_lsb_minus4
|
||||
// to avoid unexpected wrapping
|
||||
if (picture->seq.pic_order_cnt_type == 2u) {
|
||||
if (GOPLength == 0) // Use max frame num to wrap on infinite GOPs
|
||||
GOPLength = 1 << (picture->seq.log2_max_frame_num_minus4 + 4);
|
||||
const uint32_t max_pic_order_cnt_lsb = 2 * GOPLength;
|
||||
picture->seq.log2_max_pic_order_cnt_lsb_minus4 = std::max(0.0, std::ceil(std::log2(max_pic_order_cnt_lsb)) - 4);
|
||||
assert(picture->seq.log2_max_pic_order_cnt_lsb_minus4 < UCHAR_MAX);
|
||||
|
Reference in New Issue
Block a user