Module: Mesa
Branch: main
Commit: 4f1646d73fa8bac82ff2195f06a5f6011853f647
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f1646d73fa8bac82ff2195f06a5f6011853f647

Author: Sajeesh Sidharthan <[email protected]>
Date:   Wed Mar 15 10:12:58 2023 +0530

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 <[email protected]>
Reviewed-by: Boyuan Zhang <[email protected]>
Acked-by: Veerabadhran Gopalakrishnan <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21918>

---

 src/gallium/drivers/radeonsi/radeon_vcn_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c 
b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
index e498bc46c23..f25cf9cd0ca 100644
--- a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
+++ b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c
@@ -3120,7 +3120,7 @@ struct pipe_video_codec *radeon_create_decoder(struct 
pipe_context *context,
          dec->h264_valid_poc_num[i] = (unsigned) -1;
    }
 
-   bs_buf_size = width * height * (512 / (16 * 16));
+   bs_buf_size = width * height / 32;
    for (i = 0; i < NUM_BUFFERS; ++i) {
       unsigned msg_fb_it_probs_size = FB_BUFFER_OFFSET + FB_BUFFER_SIZE;
       if (have_it(dec))

Reply via email to