* Simple free lossless/lossy audio codec
* Copyright (c) 2004 Alex Beregszaszi
*
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avcodec.h"
#include "bitstream.h"
return x;
}
+#ifdef CONFIG_ENCODERS
// Heavily modified Levinson-Durbin algorithm which
// copes better with quantization, and calculates the
// actual whitened result as it goes.
av_free(state);
}
+#endif /* CONFIG_ENCODERS */
static int samplerate_table[] =
{ 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
avctx->coded_frame = avcodec_alloc_frame();
if (!avctx->coded_frame)
- return -ENOMEM;
+ return AVERROR(ENOMEM);
avctx->coded_frame->key_frame = 1;
avctx->frame_size = s->block_align*s->downsampling;
}
#endif //CONFIG_ENCODERS
+#ifdef CONFIG_DECODERS
static int sonic_decode_init(AVCodecContext *avctx)
{
SonicContext *s = avctx->priv_data;
return (get_bits_count(&gb)+7)/8;
}
+#endif
#ifdef CONFIG_ENCODERS
AVCodec sonic_encoder = {