[SCM] libav/experimental: Original Commit: r46 | ods15 | 2006-09-23 11:36:32 +0300 (Sat, 23 Sep 2006) | 2 lines

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:51:27 UTC 2013


The following commit has been merged in the experimental branch:
commit 227878354730ce79d76408db8e97145bea4d5b89
Author: Oded Shimon <ods15 at ods15.dyndns.org>
Date:   Mon Oct 2 05:56:40 2006 +0000

    Original Commit: r46 | ods15 | 2006-09-23 11:36:32 +0300 (Sat, 23 Sep 2006) | 2 lines
    
    fix normalization, output is (roughly?) same volume as input
    
    Originally committed as revision 6453 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c
index 7f918e6..bbf4d08 100644
--- a/libavcodec/vorbis_enc.c
+++ b/libavcodec/vorbis_enc.c
@@ -617,6 +617,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) {
     int i, j, channel;
     const float * win = venc->win[0];
     int window_len = 1 << (venc->blocksize[0] - 1);
+    float n = (float)(1 << venc->blocksize[0]) / 4.;
     // FIXME use dsp
 
     if (!venc->have_saved && !samples) return 0;
@@ -636,7 +637,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) {
             float * offset = venc->samples + channel*window_len*2 + window_len;
             j = channel;
             for (i = 0; i < samples; i++, j += venc->channels)
-                offset[i] = audio[j] / 32768. * win[window_len - i];
+                offset[i] = audio[j] / 32768. * win[window_len - i] / n;
         }
     } else {
         for (channel = 0; channel < venc->channels; channel++) {
@@ -653,7 +654,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) {
             float * offset = venc->saved + channel*window_len;
             j = channel;
             for (i = 0; i < samples; i++, j += venc->channels)
-                offset[i] = audio[j] / 32768. * win[i];
+                offset[i] = audio[j] / 32768. * win[i] / n;
         }
         venc->have_saved = 1;
     } else {
@@ -759,7 +760,7 @@ static int vorbis_encode_frame(AVCodecContext * avccontext, unsigned char * pack
         }
 
         for (j = 0; j < samples; j++) {
-            venc->floor[i * samples + j] = floor1_inverse_db_table[220];
+            venc->floor[i * samples + j] = floor1_inverse_db_table[113];
         }
     }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list