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
1 changed files with 1 additions and 1 deletions

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 {