Browse Source

wavpack: Clip samples after shifting

It doesn't make much sense to clip pre-shift,
nor is it correct for proper decoding.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n0.10
Derek Buitenhuis Anton Khirnov 13 years ago
parent
commit
365e1ec26d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/wavpack.c

+ 2
- 2
libavcodec/wavpack.c View File

@@ -405,12 +405,12 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, in
}

bit = (S & s->and) | s->or;
bit = (((S + bit) << s->shift) - bit);
bit = (((S + bit) << s->shift) - bit) << s->post_shift;

if(s->hybrid)
bit = av_clip(bit, -s->hybrid_maxclip, s->hybrid_maxclip - 1);

return bit << s->post_shift;
return bit;
}

static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)


Loading…
Cancel
Save