nvdecoder: Reduce DPB size

Decoder will copy decoded picture to downstream buffer or output CUDA
memory even in case of zero-copy mode. Additional margin should be unnecessary
unless baseclass passed wrong max DPB size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4841>
This commit is contained in:
Seungha Yang 2023-06-13 03:05:48 +09:00 committed by GStreamer Marge Bot
parent 11f69464bd
commit 19ee5f6dc4

View file

@ -260,8 +260,9 @@ gst_nv_decoder_configure (GstNvDecoder * decoder, cudaVideoCodec codec,
if (decoder->info.finfo)
prev_format = GST_VIDEO_INFO_FORMAT (&decoder->info);
/* Additional 2 frame margin */
pool_size += 2;
/* h264 may require additional 1 frame because of its bumping process */
if (codec == cudaVideoCodec_H264)
pool_size += 1;
/* Need pool size * 2 for decode-only (used for reference) frame
* and output frame, AV1 film grain case for example */