You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
vulkan_decode: only create sequence params in end_frame
We tried to create sequence params in both start_frame and end_frame. This was redundant. Just always create them in end_frame.
This commit is contained in:
@ -254,7 +254,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx,
|
|||||||
AV1DecContext *s = avctx->priv_data;
|
AV1DecContext *s = avctx->priv_data;
|
||||||
const AV1Frame *pic = &s->cur_frame;
|
const AV1Frame *pic = &s->cur_frame;
|
||||||
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
|
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
|
||||||
FFVulkanDecodeShared *ctx = dec->shared_ctx;
|
|
||||||
|
|
||||||
AV1VulkanDecodePicture *ap = pic->hwaccel_picture_private;
|
AV1VulkanDecodePicture *ap = pic->hwaccel_picture_private;
|
||||||
FFVulkanDecodePicture *vp = &ap->vp;
|
FFVulkanDecodePicture *vp = &ap->vp;
|
||||||
@ -269,13 +268,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx,
|
|||||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER,
|
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER,
|
||||||
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ };
|
STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ };
|
||||||
|
|
||||||
if (!dec->session_params &&
|
|
||||||
!(ctx->s.extensions & FF_VK_EXT_VIDEO_MAINTENANCE_2)) {
|
|
||||||
err = vk_av1_create_params(avctx, &dec->session_params, ap);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ap->frame_id_set) {
|
if (!ap->frame_id_set) {
|
||||||
unsigned slot_idx = 0;
|
unsigned slot_idx = 0;
|
||||||
for (unsigned i = 0; i < 32; i++) {
|
for (unsigned i = 0; i < 32; i++) {
|
||||||
|
@ -366,20 +366,11 @@ static int vk_h264_start_frame(AVCodecContext *avctx,
|
|||||||
int err;
|
int err;
|
||||||
int dpb_slot_index = 0;
|
int dpb_slot_index = 0;
|
||||||
H264Context *h = avctx->priv_data;
|
H264Context *h = avctx->priv_data;
|
||||||
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
|
|
||||||
FFVulkanDecodeShared *ctx = dec->shared_ctx;
|
|
||||||
|
|
||||||
H264Picture *pic = h->cur_pic_ptr;
|
H264Picture *pic = h->cur_pic_ptr;
|
||||||
H264VulkanDecodePicture *hp = pic->hwaccel_picture_private;
|
H264VulkanDecodePicture *hp = pic->hwaccel_picture_private;
|
||||||
FFVulkanDecodePicture *vp = &hp->vp;
|
FFVulkanDecodePicture *vp = &hp->vp;
|
||||||
|
|
||||||
if (!dec->session_params &&
|
|
||||||
!(ctx->s.extensions & FF_VK_EXT_VIDEO_MAINTENANCE_2)) {
|
|
||||||
err = vk_h264_create_params(avctx, &dec->session_params);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill in main slot */
|
/* Fill in main slot */
|
||||||
dpb_slot_index = 0;
|
dpb_slot_index = 0;
|
||||||
for (unsigned slot = 0; slot < H264_MAX_PICTURE_COUNT; slot++) {
|
for (unsigned slot = 0; slot < H264_MAX_PICTURE_COUNT; slot++) {
|
||||||
|
@ -716,8 +716,6 @@ static int vk_hevc_start_frame(AVCodecContext *avctx,
|
|||||||
int err;
|
int err;
|
||||||
HEVCContext *h = avctx->priv_data;
|
HEVCContext *h = avctx->priv_data;
|
||||||
HEVCLayerContext *l = &h->layers[h->cur_layer];
|
HEVCLayerContext *l = &h->layers[h->cur_layer];
|
||||||
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
|
|
||||||
FFVulkanDecodeShared *ctx = dec->shared_ctx;
|
|
||||||
|
|
||||||
HEVCFrame *pic = h->cur_frame;
|
HEVCFrame *pic = h->cur_frame;
|
||||||
HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
|
HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
|
||||||
@ -726,13 +724,6 @@ static int vk_hevc_start_frame(AVCodecContext *avctx,
|
|||||||
const HEVCSPS *sps = pps->sps;
|
const HEVCSPS *sps = pps->sps;
|
||||||
int nb_refs = 0;
|
int nb_refs = 0;
|
||||||
|
|
||||||
if (!dec->session_params &&
|
|
||||||
!(ctx->s.extensions & FF_VK_EXT_VIDEO_MAINTENANCE_2)) {
|
|
||||||
err = vk_hevc_create_params(avctx, &dec->session_params);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
hp->h265pic = (StdVideoDecodeH265PictureInfo) {
|
hp->h265pic = (StdVideoDecodeH265PictureInfo) {
|
||||||
.flags = (StdVideoDecodeH265PictureInfoFlags) {
|
.flags = (StdVideoDecodeH265PictureInfoFlags) {
|
||||||
.IrapPicFlag = IS_IRAP(h),
|
.IrapPicFlag = IS_IRAP(h),
|
||||||
|
Reference in New Issue
Block a user