From 00b73cfddd53bb8735fb71747ff14a60b4196132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 24 Sep 2020 12:36:26 +0200 Subject: [PATCH] va: h264dec: allocate output buffers according DPB size Instead of allocating the maximal number of references for output buffers, this patch reduces the memory foot print in many cases by just allocating the output buffers required for the DPB. Part-of: --- sys/va/gstvah264dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c index 3051e9db3a..f1482147c7 100644 --- a/sys/va/gstvah264dec.c +++ b/sys/va/gstvah264dec.c @@ -1233,7 +1233,7 @@ gst_va_h264_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) } } - min = MAX (16 + 4, min); /* max num pic references + scratch surfaces */ + min += self->dpb_size + 4; /* min + dbp size + scratch surfaces */ size = MAX (size, GST_VIDEO_INFO_SIZE (&info)); update_pool = TRUE; @@ -1255,7 +1255,7 @@ gst_va_h264_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) gst_clear_object (&other_allocator); } - min = 16 + 4; /* max num pic references + scratch surfaces */ + min = self->dpb_size + 4; /* dpb size + scratch surfaces */ max = 0; }