]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Original Commit: r55 | ods15 | 2006-09-24 13:54:43 +0300 (Sun, 24 Sep 2006) | 2 lines
authorods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:07:38 +0000 (06:07 +0000)
committerods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:07:38 +0000 (06:07 +0000)
bug fixes for residue with no books in all passes

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

libavcodec/vorbis_enc.c

index 2c55d9e344e2188f7617146f0fcdb13e889965da..9fc5fa8737ef6fab36adfe219f78586b3da379a2 100644 (file)
@@ -480,7 +480,7 @@ static void put_residue_header(PutBitContext * pb, residue_t * rc) {
     for (i = 0; i < rc->classifications; i++) {
         int j;
         for (j = 0; j < 8; j++)
-            if (rc->books[i][j])
+            if (rc->books[i][j] != -1)
                 put_bits(pb, 8, rc->books[i][j]);
     }
 }
@@ -708,6 +708,7 @@ static void residue_encode(venc_context_t * venc, residue_t * rc, PutBitContext
                     int nbook = rc->books[classes[j][p]][pass];
                     codebook_t * book = &venc->codebooks[nbook];
                     float * buf = coeffs + samples*j + rc->begin + p*psize;
+                    if (nbook == -1) continue;
 
                     assert(rc->type == 0);
                     assert(book->ndimentions == 1);