avcodec/mlpenc: fix regression in encoding only zeroes

Previously it would use more bits than neccessary.
pull/390/head
Paul B Mahol 1 year ago
parent 9c1294eadd
commit 394106a138
  1. 2
      libavcodec/mlpenc.c

@ -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 {

Loading…
Cancel
Save