/*
* copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
*
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
int maxval = 1;
if (c->books[l] != -1)
maxval = venc->codebooks[c->books[l]].nentries;
- // coded could be -1, but this still works, cause thats 0
+ // coded could be -1, but this still works, cause that is 0
if (coded[counter + k] < maxval) break;
}
assert(l != csub);
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];
+ offset[i] = -audio[j] / 32768. / n * win[window_len - i - 1]; //FIXME find out why the sign has to be fliped
}
} else {
for (channel = 0; channel < venc->channels; channel++) {
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];
+ offset[i] = -audio[j] / 32768. / n * win[i]; //FIXME find out why the sign has to be fliped
}
venc->have_saved = 1;
} else {
return 1;
}
-static int vorbis_encode_init(AVCodecContext * avccontext)
+static av_cold int vorbis_encode_init(AVCodecContext * avccontext)
{
venc_context_t * venc = avccontext->priv_data;
}
-static int vorbis_encode_close(AVCodecContext * avccontext)
+static av_cold int vorbis_encode_close(AVCodecContext * avccontext)
{
venc_context_t * venc = avccontext->priv_data;
int i;
av_freep(&venc->mappings[i].mux);
av_freep(&venc->mappings[i].floor);
av_freep(&venc->mappings[i].residue);
+ av_freep(&venc->mappings[i].magnitude);
+ av_freep(&venc->mappings[i].angle);
}
av_freep(&venc->mappings);
vorbis_encode_frame,
vorbis_encode_close,
.capabilities= CODEC_CAP_DELAY,
+ .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
};