X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fg729dec.c;h=979b87fd27450917ab15a9495ada944b7c0ba1e5;hb=921715edffbba5db8deb26b7ad3cb583ba963d03;hp=c1cdb5dcc40a035bbbf225a5a9de82e097eea9dc;hpb=fd7cbc7f9c385dee88548862f87d4f6cf76aa0a9;p=ffmpeg diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index c1cdb5dcc40..979b87fd274 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -2,20 +2,20 @@ * G.729 decoder * Copyright (c) 2008 Vladimir Voroshilov * - * 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 */ #include @@ -30,7 +30,6 @@ #include "libavutil/avutil.h" #include "get_bits.h" -#include "g729.h" #include "lsp.h" #include "celp_math.h" #include "acelp_filters.h" @@ -71,6 +70,12 @@ */ #define SHARP_MAX 13017 +/** + * subframe size + */ +#define SUBFRAME_SIZE 40 + + typedef struct { uint8_t ac_index_bits[2]; ///< adaptive codebook index for second subframe (size in bits) uint8_t parity_bit; ///< parity bit for pitch delay @@ -224,7 +229,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, av_log(avctx, AV_LOG_DEBUG, "Packet type: %s\n", "G.729D @ 6.4kbit/s"); } else { av_log(avctx, AV_LOG_ERROR, "Packet size %d is unknown.\n", buf_size); - return (AVERROR_NOFMT); + return AVERROR_INVALIDDATA; } for (i=0; i < buf_size; i++) @@ -312,10 +317,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, return buf_size; } -AVCodec g729_decoder = +AVCodec ff_g729_decoder = { "g729", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_G729, sizeof(G729Context), decoder_init,