radeonsi/vcn: remove extra zero bytes from bitstream
authorRuijing Dong <ruijing.dong@amd.com>
Wed, 19 Apr 2023 01:19:35 +0000 (21:19 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 15:11:35 +0000 (15:11 +0000)
commitb13f87031fd45e5ef57db4bcf3e79ce5b89370f1
treedc7a50eec277c966f3c528258424f646169b1226
parentbb08f061d962406769a6cbd045e458a07b2e7796
radeonsi/vcn: remove extra zero bytes from bitstream

reason:
   extra bytes are not needed and not necessary
   in h264/h265 bitstreams, because they are in
   between NALs, the only problem is they consumed
   extra bits. And for av1 streams, that could be
   explained to something else, especially in
   multi-layer cases, that can cause syntax errors.

   ptr[6] represents the bitstream size,
   ptr[8] represents the extra zero bytes.

   The total number of bytes of the output
   should be ptr[6] - ptr[8]

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22585>
src/gallium/drivers/radeonsi/radeon_vcn_enc.c