mlpenc: fix lossless check error in number_sbits

we need two bits instead of one bit to represent -1 in bitstream

Signed-off-by: Jai Luthra <me@jailuthra.in>
pull/343/head
Jai Luthra 5 years ago committed by Paul B Mahol
parent efee86fafa
commit c1c3916cec
  1. 2
      libavcodec/mlpenc.c

@ -466,7 +466,7 @@ static void default_decoding_params(MLPEncodeContext *ctx,
*/
static int inline number_sbits(int number)
{
if (number < 0)
if (number < -1)
number++;
return av_log2(FFABS(number)) + 1 + !!number;

Loading…
Cancel
Save