mirror of https://git.ffmpeg.org/ffmpeg.git
vulkan_h264: fix long-term ref handling
h->long_ref isn't guaranteed to be contiguously filled. Use the approach from both vaapi_h264 and vdpau_h264 which goes through the 16 frames in h->long_ref to find the LTR entries. Fixes MR2_MW_A.264 from JVT-AVC_V1.
This commit is contained in:
parent
1e63e24c76
commit
4536de3769
|
@ -406,10 +406,14 @@ static int vk_h264_start_frame(AVCodecContext *avctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill in long-term refs */
|
/* Fill in long-term refs */
|
||||||
for (int r = 0, i = h->short_ref_count; i < h->short_ref_count + h->long_ref_count; i++, r++) {
|
for (int r = 0, i = h->short_ref_count; r < H264_MAX_DPB_FRAMES &&
|
||||||
|
i < h->short_ref_count + h->long_ref_count; r++) {
|
||||||
|
if (!h->long_ref[r])
|
||||||
|
continue;
|
||||||
|
|
||||||
dpb_slot_index = 0;
|
dpb_slot_index = 0;
|
||||||
for (unsigned slot = 0; slot < H264_MAX_PICTURE_COUNT; slot++) {
|
for (unsigned slot = 0; slot < 16; slot++) {
|
||||||
if (h->long_ref[i] == &h->DPB[slot]) {
|
if (h->long_ref[r] == &h->DPB[slot]) {
|
||||||
dpb_slot_index = slot;
|
dpb_slot_index = slot;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -422,6 +426,7 @@ static int vk_h264_start_frame(AVCodecContext *avctx,
|
||||||
dpb_slot_index);
|
dpb_slot_index);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
hp->h264pic = (StdVideoDecodeH264PictureInfo) {
|
hp->h264pic = (StdVideoDecodeH264PictureInfo) {
|
||||||
|
|
Loading…
Reference in New Issue