]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Original Commit: r86 | ods15 | 2006-09-29 21:08:42 +0300 (Fri, 29 Sep 2006) | 2 lines
authorods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:08:48 +0000 (06:08 +0000)
committerods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:08:48 +0000 (06:08 +0000)
make put_vector ignore unused codebook entries

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6491 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/vorbis_enc.c

index 396ca4b829e21cb60bb71c5fe1e7edae194ad472..0cc974e3c8d6e59a2a605651c60625cf427fb8ed 100644 (file)
@@ -915,6 +915,7 @@ static float * put_vector(codebook_t * book, PutBitContext * pb, float * num) {
     for (i = 0; i < book->nentries; i++) {
         float d = 0.;
         int j;
+        if (!book->entries[i].len) continue;
         for (j = 0; j < book->ndimentions; j++) {
             float a = (book->dimentions[i * book->ndimentions + j] - num[j]);
             d += a*a;