radeonsi/vcn: Fix radeon_enc_code_ue with values over 2^16
Values over 2^16 as ue(v) are encoded with more than 32 bits, but radeon_enc_code_fixed_bits can only handle 32 bits at max. Change radeon_enc_code_ue to code the leading zeros separately. Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30672>
This commit is contained in:
@@ -1914,7 +1914,7 @@ void radeon_enc_flush_headers(struct radeon_encoder *enc)
|
|||||||
|
|
||||||
void radeon_enc_code_ue(struct radeon_encoder *enc, unsigned int value)
|
void radeon_enc_code_ue(struct radeon_encoder *enc, unsigned int value)
|
||||||
{
|
{
|
||||||
int x = -1;
|
unsigned int x = 0;
|
||||||
unsigned int ue_code = value + 1;
|
unsigned int ue_code = value + 1;
|
||||||
value += 1;
|
value += 1;
|
||||||
|
|
||||||
@@ -1923,8 +1923,9 @@ void radeon_enc_code_ue(struct radeon_encoder *enc, unsigned int value)
|
|||||||
x += 1;
|
x += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int ue_length = (x << 1) + 1;
|
if (x > 1)
|
||||||
radeon_enc_code_fixed_bits(enc, ue_code, ue_length);
|
radeon_enc_code_fixed_bits(enc, 0, x - 1);
|
||||||
|
radeon_enc_code_fixed_bits(enc, ue_code, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void radeon_enc_code_se(struct radeon_encoder *enc, int value)
|
void radeon_enc_code_se(struct radeon_encoder *enc, int value)
|
||||||
|
|||||||
Reference in New Issue
Block a user