1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-06 05:47:18 +02:00

avcodec/apv_entropy: use av_zero_extend()

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-09-29 22:33:38 -03:00
parent 776ee07990
commit 7ce3a14496

View File

@@ -288,7 +288,7 @@ int ff_apv_entropy_decode_block(int16_t *restrict coeff,
// Extract the low bits.
low_bit_count = leading_zeroes;
low_bit_shift = 16 - (1 + 2 * leading_zeroes);
low_bits = (bits >> low_bit_shift) & ((1 << low_bit_count) - 1);
low_bits = av_zero_extend(bits >> low_bit_shift, low_bit_count);
// Construct run code.
run = 2 + ((1 << leading_zeroes) - 1) + low_bits;
// Skip over the bits just used.
@@ -460,7 +460,7 @@ int ff_apv_entropy_decode_block(int16_t *restrict coeff,
// Extract the low bits.
low_bit_count = leading_zeroes + k_run;
low_bit_shift = 16 - (1 + 2 * leading_zeroes + k_run);
low_bits = (bits >> low_bit_shift) & ((1 << low_bit_count) - 1);
low_bits = av_zero_extend(bits >> low_bit_shift, low_bit_count);
// Construct run code.
run = (2 << k_run) +
((1 << leading_zeroes) - 1) * (1 << k_run) +