From 52dc66b88777f5617e6ecf5838e81c48348aaa84 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 6 Dec 2010 21:31:15 -0500 Subject: [PATCH] Take into accound the 32-bit limit in the VQ This reduces waste at high bit-rate --- libcelt/rate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcelt/rate.c b/libcelt/rate.c index 8d587cda..bd5eb36e 100644 --- a/libcelt/rate.c +++ b/libcelt/rate.c @@ -166,6 +166,9 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int for (j=start;j>ALLOC_STEPS); + /* Don't allocate more than we can actually use */ + if (tmp > 64*C<= thresh[j]) psum += tmp; else if (tmp >= 1< 64*C<