1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avcodec/mlpenc: fix regression in encoding only zeroes

Previously it would use more bits than neccessary.
This commit is contained in:
Paul B Mahol 2023-10-10 10:23:06 +02:00
parent 9c1294eadd
commit 394106a138

View File

@ -452,7 +452,7 @@ static void default_decoding_params(MLPEncodeContext *ctx, DecodingParams *decod
*/
static int inline number_sbits(int32_t n)
{
return 33 - ff_clz(FFABS(n)|1);
return 33 - ff_clz(FFABS(n)|1) - !n;
}
enum InputBitDepth {