X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fnellymoserenc.c;h=cf73ea4a22901de58b2292f1dd5eee1f78c5263b;hb=26f548bb59177cfc8c45ff633dd37b60cfd23edf;hp=85e01736a26f126be28e45e46e1eda77babe495a;hpb=edac49daf5f703aa4e742ecdd747658e82d91b33;p=ffmpeg diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 85e01736a26..cf73ea4a229 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -4,20 +4,20 @@ * * Copyright (c) 2008 Bartlomiej Wolowiec * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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.1 of the License, or (at your option) any later version. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -113,16 +113,16 @@ static const uint8_t quant_lut_offset[8] = { 0, 0, 1, 4, 11, 32, 81, 230 }; static void apply_mdct(NellyMoserEncodeContext *s) { - memcpy(s->in_buff, s->buf[s->bufsel], NELLY_BUF_LEN * sizeof(float)); - s->dsp.vector_fmul(s->in_buff, ff_sine_128, NELLY_BUF_LEN); + s->dsp.vector_fmul(s->in_buff, s->buf[s->bufsel], ff_sine_128, NELLY_BUF_LEN); s->dsp.vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN, ff_sine_128, NELLY_BUF_LEN); - ff_mdct_calc(&s->mdct_ctx, s->mdct_out, s->in_buff); + s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out, s->in_buff); - s->dsp.vector_fmul(s->buf[s->bufsel] + NELLY_BUF_LEN, ff_sine_128, NELLY_BUF_LEN); + s->dsp.vector_fmul(s->buf[s->bufsel] + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN, + ff_sine_128, NELLY_BUF_LEN); s->dsp.vector_fmul_reverse(s->buf[s->bufsel] + 2 * NELLY_BUF_LEN, s->buf[1 - s->bufsel], ff_sine_128, NELLY_BUF_LEN); - ff_mdct_calc(&s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN); + s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN); } static av_cold int encode_init(AVCodecContext *avctx) @@ -382,7 +382,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, voi return 0; } -AVCodec nellymoser_encoder = { +AVCodec ff_nellymoser_encoder = { .name = "nellymoser", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_NELLYMOSER, @@ -392,4 +392,5 @@ AVCodec nellymoser_encoder = { .close = encode_end, .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, };