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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1595>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-09-24 12:36:26 +02:00
parent 755d769045
commit 00b73cfddd

View file

@ -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;
}