radeonsi/vcn: set bitstream buffer size to encoded bitstream size
authorSajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Wed, 15 Mar 2023 04:24:58 +0000 (09:54 +0530)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 22:55:59 +0000 (22:55 +0000)
commit4f1646d73fa8bac82ff2195f06a5f6011853f647
treedd2fe2ea0d2c66d19d8d9e0d42bc9d9783dac717
parenta3e5e6ceaa0ae9d44ab3219b0ac52599e2246976
radeonsi/vcn: set bitstream buffer size to encoded bitstream size

initial bitstream size was set to width * height * 2 which is
larger than yuv size. set initial bitstream size to encoded
bitstream size approximately to optimize memory consumption.
This is just an initial size setting, it will get resized later
if it's not big enough. As a result of this change, we don't need to
allocate super big size at the every beginning. Only allocate
big size when needed in order to save some memory

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21918>
src/gallium/drivers/radeonsi/radeon_vcn_dec.c