[FFmpeg-devel] Make Vorbis encoder not invert samples

Måns Rullgård mans
Fri May 21 12:07:43 CEST 2010


Frank Barchard <fbarchard at google.com> writes:

> Vorbis encoder is inverting samples, which makes no sense.
> Removing it makes it easier to look at the samples and try to figure out why
> quality is low.
>
> Index: libavcodec/vorbis_enc.c
> ===================================================================
> --- libavcodec/vorbis_enc.c     (revision 23202)
> +++ libavcodec/vorbis_enc.c     (working copy)
> @@ -915,7 +915,7 @@
>              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. / n * win[window_len - i -
> 1]; //FIXME find out why the sign has to be fliped
> +                offset[i] = audio[j] / 32768. / n * win[window_len - i -
> 1];
>          }
>      } else {
>          for (channel = 0; channel < venc->channels; channel++)
> @@ -932,7 +932,7 @@
>              float *offset = venc->saved + channel * window_len;
>              j = channel;
>              for (i = 0; i < samples; i++, j += venc->channels)
> -                offset[i] = -audio[j] / 32768. / n * win[i]; //FIXME find
> out why the sign has to be fliped
> +                offset[i] = audio[j] / 32768. / n * win[i];
>          }
>          venc->have_saved = 1;
>      } else {
>

This was done in r7873.  I have no idea why.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list