Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2011-04-14 01:08:22 +0400
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2011-04-14 01:15:55 +0400
commitfdd867534a8f53ddb3f2845fc1dd48d13e734125 (patch)
treeeb02f0296152307a4216a9e3e17c8ebaab5a215a
parentd25dd2bff9f111fcc8d2de802c1cca337db27873 (diff)
Stop adjusting the VBR drift during silent frames, this prevents overshoot after silent spans. This also results in undershoot on files with lots of silence, but this is desirable in terms of increasing quality consistency. It will be even better if we later include some open-loop correction of the targets.
-rw-r--r--libcelt/celt.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libcelt/celt.c b/libcelt/celt.c
index 6331553..d6c2b4d 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -1425,17 +1425,23 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes);
nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes;
+ /* By how much did we "miss" the target on that frame */
+ delta = target - vbr_rate;
+
+ target=nbAvailableBytes<<(BITRES+3);
+
+ /*If the frame is silent we don't adjust our drift, otherwise
+ the encoder will shoot to very high rates after hitting a
+ span of silence, but we do allow the bitres to refill.
+ This means that we'll undershoot our target in CVBR/VBR modes
+ on files with lots of silence. */
if(silence)
{
nbAvailableBytes = 2;
target = 2*8<<BITRES;
+ delta = 0;
}
- /* By how much did we "miss" the target on that frame */
- delta = target - vbr_rate;
-
- target=nbAvailableBytes<<(BITRES+3);
-
if (st->vbr_count < 970)
{
st->vbr_count++;