diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-12 00:52:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-12 01:10:32 +0100 |
commit | 794006f8fe403ccd2993513a8e4fbe885ef7f9fb (patch) | |
tree | 42edca40fc6f5ba24543f611086891ae4c6b6f68 /libavcodec | |
parent | 4093d130d1934edcd098014d306492173527f1f6 (diff) | |
parent | e7d02b04dcfb65d1873b81bd3281442ac5ddec1d (diff) | |
download | ffmpeg-794006f8fe403ccd2993513a8e4fbe885ef7f9fb.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
fft: init functions with INIT_XMM/YMM.
pcmenc: set frame_size to 0.
gsm demuxer: use generic seeking instead of a gsm-specific function.
gsm demuxer: return packets with only 1 gsm block at a time.
avcodec: add GSM parser
doc: Replace ffmpeg references in avserver config file by avconv.
doc: Fix names of av_log color environment variables.
Fix a bunch of platform name and other typos.
Add some missing changelog entries and release 0.8_beta2
No longer build libpostproc by default
wtv: fix memleaks during normal operation
threads: add CODEC_CAP_AUTO_THREADS for libvpx and xavs
Conflicts:
Changelog
RELEASE
cmdutils.c
configure
doc/ffserver.conf
doc/platform.texi
ffplay.c
libavcodec/Makefile
libavcodec/version.h
libavformat/wtv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/allcodecs.c | 1 | ||||
-rw-r--r-- | libavcodec/error_resilience.c | 2 | ||||
-rw-r--r-- | libavcodec/gsm.h | 31 | ||||
-rw-r--r-- | libavcodec/gsm_parser.c | 79 | ||||
-rw-r--r-- | libavcodec/gsmdec_data.h | 5 | ||||
-rw-r--r-- | libavcodec/gsmdec_template.c | 1 | ||||
-rw-r--r-- | libavcodec/libgsm.c | 7 | ||||
-rw-r--r-- | libavcodec/libvpxdec.c | 3 | ||||
-rw-r--r-- | libavcodec/libvpxenc.c | 2 | ||||
-rw-r--r-- | libavcodec/libxavs.c | 2 | ||||
-rw-r--r-- | libavcodec/msgsmdec.c | 1 | ||||
-rw-r--r-- | libavcodec/msrle.c | 4 | ||||
-rw-r--r-- | libavcodec/pcm.c | 2 | ||||
-rw-r--r-- | libavcodec/version.h | 2 | ||||
-rw-r--r-- | libavcodec/x86/fft_mmx.asm | 3 |
16 files changed, 128 insertions, 18 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 81bac89da6..f094d16a88 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -655,6 +655,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \ vorbis_data.o +OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o OBJS-$(CONFIG_H261_PARSER) += h261_parser.o OBJS-$(CONFIG_H263_PARSER) += h263_parser.o OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \ diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index a15d56262e..1e36235f3a 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -432,6 +432,7 @@ void avcodec_register_all(void) REGISTER_PARSER (DVBSUB, dvbsub); REGISTER_PARSER (DVDSUB, dvdsub); REGISTER_PARSER (FLAC, flac); + REGISTER_PARSER (GSM, gsm); REGISTER_PARSER (H261, h261); REGISTER_PARSER (H263, h263); REGISTER_PARSER (H264, h264); diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index d296a78148..a3075e18da 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -50,7 +50,7 @@ static void decode_mb(MpegEncContext *s, int ref){ h->mb_xy= s->mb_x + s->mb_y*s->mb_stride; memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache)); assert(ref>=0); - /* FIXME: It is posible albeit uncommon that slice references + /* FIXME: It is possible albeit uncommon that slice references * differ between slices. We take the easy approach and ignore * it for now. If this turns out to have any relevance in * practice then correct remapping should be added. */ diff --git a/libavcodec/gsm.h b/libavcodec/gsm.h new file mode 100644 index 0000000000..c7c3e22bde --- /dev/null +++ b/libavcodec/gsm.h @@ -0,0 +1,31 @@ +/* + * GSM common header + * + * This file is part of Libav. + * + * 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. + * + * 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 Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_GSM_H +#define AVCODEC_GSM_H + +/* bytes per block */ +#define GSM_BLOCK_SIZE 33 +#define GSM_MS_BLOCK_SIZE 65 + +/* samples per block */ +#define GSM_FRAME_SIZE 160 + +#endif /* AVCODEC_GSM_H */ diff --git a/libavcodec/gsm_parser.c b/libavcodec/gsm_parser.c new file mode 100644 index 0000000000..a2965d3fb5 --- /dev/null +++ b/libavcodec/gsm_parser.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2012 Justin Ruggles + * + * This file is part of Libav. + * + * 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. + * + * 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 Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * GSM audio parser + * + * Splits packets into individual blocks. + */ + +#include "parser.h" +#include "gsm.h" + +typedef struct GSMParseContext { + ParseContext pc; + int block_size; + int remaining; +} GSMParseContext; + +static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + GSMParseContext *s = s1->priv_data; + ParseContext *pc = &s->pc; + int next; + + if (!s->block_size) { + switch (avctx->codec_id) { + case CODEC_ID_GSM: s->block_size = GSM_BLOCK_SIZE; break; + case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break; + default: + return AVERROR(EINVAL); + } + } + + if (!s->remaining) + s->remaining = s->block_size; + if (s->remaining <= buf_size) { + next = s->remaining; + s->remaining = 0; + } else { + next = END_NOT_FOUND; + s->remaining -= buf_size; + } + + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + *poutbuf = buf; + *poutbuf_size = buf_size; + return next; +} + +AVCodecParser ff_gsm_parser = { + .codec_ids = { CODEC_ID_GSM, CODEC_ID_GSM_MS }, + .priv_data_size = sizeof(GSMParseContext), + .parser_parse = gsm_parse, + .parser_close = ff_parse_close, +}; diff --git a/libavcodec/gsmdec_data.h b/libavcodec/gsmdec_data.h index 4e2c7e6846..3eb30b84b7 100644 --- a/libavcodec/gsmdec_data.h +++ b/libavcodec/gsmdec_data.h @@ -25,11 +25,6 @@ #include <stdint.h> #include "avcodec.h" -// input and output sizes in byte -#define GSM_BLOCK_SIZE 33 -#define GSM_MS_BLOCK_SIZE 65 -#define GSM_FRAME_SIZE 160 - typedef struct { AVFrame frame; // Contains first 120 elements from the previous frame diff --git a/libavcodec/gsmdec_template.c b/libavcodec/gsmdec_template.c index b63ec9ed27..0f559530ec 100644 --- a/libavcodec/gsmdec_template.c +++ b/libavcodec/gsmdec_template.c @@ -25,6 +25,7 @@ */ #include "get_bits.h" +#include "gsm.h" #include "gsmdec_data.h" static void apcm_dequant_add(GetBitContext *gb, int16_t *dst) diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index ed4962a3b2..23950c0c21 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -27,13 +27,10 @@ // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html -#include "avcodec.h" #include <gsm/gsm.h> -// gsm.h misses some essential constants -#define GSM_BLOCK_SIZE 33 -#define GSM_MS_BLOCK_SIZE 65 -#define GSM_FRAME_SIZE 160 +#include "avcodec.h" +#include "gsm.h" static av_cold int libgsm_encode_init(AVCodecContext *avctx) { if (avctx->channels > 1) { diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 15329f3f31..84e5ac8e65 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -119,5 +119,6 @@ AVCodec ff_libvpx_decoder = { .init = vp8_init, .close = vp8_free, .decode = vp8_decode, - .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), + .capabilities = CODEC_CAP_AUTO_THREADS, + .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), }; diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 044ea32636..621f818c9f 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -622,7 +622,7 @@ AVCodec ff_libvpx_encoder = { .init = vp8_init, .encode = vp8_encode, .close = vp8_free, - .capabilities = CODEC_CAP_DELAY, + .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), .priv_class = &class, diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 4d9bec03e6..aa93b555f9 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -414,7 +414,7 @@ AVCodec ff_libxavs_encoder = { .init = XAVS_init, .encode = XAVS_frame, .close = XAVS_close, - .capabilities = CODEC_CAP_DELAY, + .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"), .priv_class = &class, diff --git a/libavcodec/msgsmdec.c b/libavcodec/msgsmdec.c index 2ec553b2fe..90e83ae7ac 100644 --- a/libavcodec/msgsmdec.c +++ b/libavcodec/msgsmdec.c @@ -22,6 +22,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "msgsmdec.h" +#include "gsm.h" #include "gsmdec_template.c" int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples, diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 30159bb006..2f3f876b15 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -1,5 +1,5 @@ /* - * Micrsoft RLE Video Decoder + * Microsoft RLE video decoder * Copyright (C) 2003 the ffmpeg project * * This file is part of FFmpeg. @@ -21,7 +21,7 @@ /** * @file - * MS RLE Video Decoder by Mike Melanson (melanson@pcisys.net) + * MS RLE video decoder by Mike Melanson (melanson@pcisys.net) * For more information about the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 66b095370c..3609c3b0d9 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -33,7 +33,7 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx) { - avctx->frame_size = 1; + avctx->frame_size = 0; switch(avctx->codec->id) { case CODEC_ID_PCM_ALAW: pcm_alaw_tableinit(); diff --git a/libavcodec/version.h b/libavcodec/version.h index ce4259f99b..938e53306c 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -21,7 +21,7 @@ #define AVCODEC_VERSION_H #define LIBAVCODEC_VERSION_MAJOR 53 -#define LIBAVCODEC_VERSION_MINOR 54 +#define LIBAVCODEC_VERSION_MINOR 55 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm index 8e5436770e..648ba07133 100644 --- a/libavcodec/x86/fft_mmx.asm +++ b/libavcodec/x86/fft_mmx.asm @@ -640,11 +640,14 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits %endmacro ; DECL_FFT %ifdef HAVE_AVX +INIT_YMM DECL_FFT 6, _avx DECL_FFT 6, _avx, _interleave %endif +INIT_XMM DECL_FFT 5, _sse DECL_FFT 5, _sse, _interleave +INIT_MMX DECL_FFT 4, _3dn DECL_FFT 4, _3dn, _interleave DECL_FFT 4, _3dn2 |