radeonsi/vcn: AV1 skip the redundant bs resize
authorLeo Liu <leo.liu@amd.com>
Tue, 18 Apr 2023 15:49:49 +0000 (11:49 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 20 Apr 2023 14:43:55 +0000 (14:43 +0000)
For AV1, the begin bitstream buffer have included all the tile data,
and extra bitstream buffer is useless and causing the bad performance
by bs buffer resize/map/copy.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22557>

src/gallium/drivers/radeonsi/radeon_vcn_dec.c

index 21ff1c6..6088c12 100644 (file)
@@ -2865,6 +2865,9 @@ static void radeon_dec_decode_bitstream(struct pipe_video_codec *decoder,
    if (!dec->bs_ptr)
       return;
 
+   if (dec->bs_size && dec->stream_type == RDECODE_CODEC_AV1)
+      return;
+
    unsigned long total_bs_size = dec->bs_size;
    for (i = 0; i < num_buffers; ++i)
       total_bs_size += sizes[i];