[Ffmpeg-cvslog] r6476 - trunk/libavcodec/vorbis_enc.c

ods15 subversion
Mon Oct 2 08:08:12 CEST 2006


Author: ods15
Date: Mon Oct  2 08:08:11 2006
New Revision: 6476

Modified:
   trunk/libavcodec/vorbis_enc.c

Log:
Original Commit: r71 | ods15 | 2006-09-28 21:00:24 +0300 (Thu, 28 Sep 2006) | 2 lines

residue type 2

Modified: trunk/libavcodec/vorbis_enc.c
==============================================================================
--- trunk/libavcodec/vorbis_enc.c	(original)
+++ trunk/libavcodec/vorbis_enc.c	Mon Oct  2 08:08:11 2006
@@ -807,6 +807,9 @@
     int partitions = (rc->end - rc->begin) / psize;
     int classes[channels][partitions];
     int classwords = venc->codebooks[rc->classbook].ndimentions;
+    int real_ch = channels;
+
+    if (rc->type == 2) channels = 1;
 
     for (pass = 0; pass < 8; pass++) {
         p = 0;
@@ -827,14 +830,26 @@
                     float * buf = coeffs + samples*j + rc->begin + p*psize;
                     if (nbook == -1) continue;
 
-                    assert(rc->type == 0);
+                    assert(rc->type == 0 || rc->type == 2);
                     assert(!(psize % book->ndimentions));
 
+                    if (rc->type == 0) {
                     for (k = 0; k < psize; k += book->ndimentions) {
                         float * a = put_vector(book, pb, &buf[k]);
                         int l;
                         for (l = 0; l < book->ndimentions; l++) buf[k + l] -= a[l];
                     }
+                    } else {
+                        for (k = 0; k < psize; k += book->ndimentions) {
+                            int dim = book->ndimentions, s = rc->begin + p * psize, l;
+                            float vec[dim], * pvec = vec, * a;
+                            for (l = s + k; l < s + k + dim; l++)
+                                *pvec++ = coeffs[(l % real_ch) * samples + l / real_ch];
+                            a = put_vector(book, pb, vec);
+                            for (l = s + k; l < s + k + dim; l++)
+                                coeffs[(l % real_ch) * samples + l / real_ch] -= *a++;
+                        }
+                    }
                 }
             }
         }




More information about the ffmpeg-cvslog mailing list