diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:07:55 +0000 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:07:55 +0000 |
commit | 63fc901ec951efb1ebd0a403a5d33ef06a9395b6 (patch) | |
tree | 7d0eef00a057eff0b15de8536cd658f6b56e0b94 /libavcodec | |
parent | 09a0d8b3c9196c1c3418d6794e5df1e8d7fc8ed3 (diff) | |
download | ffmpeg-63fc901ec951efb1ebd0a403a5d33ef06a9395b6.tar.gz |
Original Commit: r64 | ods15 | 2006-09-25 18:39:30 +0300 (Mon, 25 Sep 2006) | 2 lines
some fixes to floor
Originally committed as revision 6469 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vorbis_enc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 43e0a18e0c..cedaec9a16 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -717,13 +717,16 @@ static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb if (predicted == posts[i]) { coded[i] = 0; // must be used later as flag! continue; + } else { + if (!coded[fc->list[i].low]) coded[fc->list[i].low] = -1; + if (!coded[fc->list[i].high]) coded[fc->list[i].high] = -1; } if (posts[i] > predicted) { if (posts[i] - predicted > room) coded[i] = posts[i] - predicted + lowroom; else coded[i] = (posts[i] - predicted) << 1; } else { if (predicted - posts[i] > room) coded[i] = predicted - posts[i] + highroom - 1; - else coded[i] = ((predicted - posts[i]) << 1) + 1; + else coded[i] = ((predicted - posts[i]) << 1) - 1; } } @@ -735,7 +738,7 @@ static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb assert(!c->subclass); for (k = 0; k < c->dim; k++) { int entry = coded[counter++]; - if (entry >= book->nentries || entry < 0) av_log(NULL, AV_LOG_ERROR, "%d %d %d %d \n", entry, book->nentries, counter, fc->values); + if (entry == -1) entry = 0; assert(entry < book->nentries); assert(entry >= 0); put_bits(pb, book->entries[entry].len, book->entries[entry].codeword); |