Module: Mesa Branch: main Commit: b13f87031fd45e5ef57db4bcf3e79ce5b89370f1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b13f87031fd45e5ef57db4bcf3e79ce5b89370f1
Author: Ruijing Dong <[email protected]> Date: Tue Apr 18 21:19:35 2023 -0400 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 <[email protected]> Signed-off-by: Ruijing Dong <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22585> --- src/gallium/drivers/radeonsi/radeon_vcn_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_enc.c b/src/gallium/drivers/radeonsi/radeon_vcn_enc.c index 63af54a4f4f..95c936405f9 100644 --- a/src/gallium/drivers/radeonsi/radeon_vcn_enc.c +++ b/src/gallium/drivers/radeonsi/radeon_vcn_enc.c @@ -734,7 +734,7 @@ static void radeon_enc_get_feedback(struct pipe_video_codec *encoder, void *feed uint32_t *ptr = enc->ws->buffer_map(enc->ws, fb->res->buf, &enc->cs, PIPE_MAP_READ_WRITE | RADEON_MAP_TEMPORARY); if (ptr[1]) - *size = ptr[6]; + *size = ptr[6] - ptr[8]; else *size = 0; enc->ws->buffer_unmap(enc->ws, fb->res->buf);
