History

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

Michael Niedermayer committed 14 years ago

Commit 794006f2 parents 4093d13 e7d02b024 files · +144 −59Browse files

Unified · Split

24 files
  1. Changelog +3 −0
  2. RELEASE +1 −0
  3. cmdutils.c +4 −0
  4. configure +1 −1
  5. doc/avtools-common-opts.texi +2 −2
  6. libavcodec/Makefile +1 −0
  7. libavcodec/allcodecs.c +1 −0
  8. libavcodec/error_resilience.c +1 −1
  9. libavcodec/gsm.h +31 −0
  10. libavcodec/gsm_parser.c +79 −0
  11. libavcodec/gsmdec_data.h +0 −5
  12. libavcodec/gsmdec_template.c +1 −0
  13. libavcodec/libgsm.c +2 −5
  14. libavcodec/libvpxdec.c +2 −1
  15. libavcodec/libvpxenc.c +1 −1
  16. libavcodec/libxavs.c +1 −1
  17. libavcodec/msgsmdec.c +1 −0
  18. libavcodec/msrle.c +2 −2
  19. libavcodec/pcm.c +1 −1
  20. libavcodec/version.h +1 −1
  21. libavcodec/x86/fft_mmx.asm +3 −0
  22. libavformat/gsmdec.c +3 −37
  23. libavformat/wtvdec.c +1 −0
  24. tools/patcheck +1 −1
Changelog+3−0
@@ -13,6 +13,7 @@ version next: · 12 unmodified lines
1313 - tinterlace video filter
1414 - astreamsync audio filter
1515 - amerge audio filter
16+- GSM audio parser
1617 - Automatic thread count based on detection number of (available) CPU cores
1718 - y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
1819 - ffprobe -show_error option
@@ -22,6 +23,8 @@ version next: · 3 unmodified lines
2223 - ffprobe -show_frames option
2324 - silencedetect audio filter
2425 - ffprobe -show_program_version, -show_library_versions, -show_versions options
26+- rv34: frame-level multi-threading
27+- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
2528
2629
2730 version 0.9:
RELEASE+1−0
@@ -1 +1,2 @@
11 0.9.1.git
2+
cmdutils.c+4−0
@@ -34,7 +34,9 @@ · 33 unmodified lines
3434 #include "libavdevice/avdevice.h"
3535 #include "libswscale/swscale.h"
3636 #include "libswresample/swresample.h"
37+#if CONFIG_POSTPROC
3738 #include "libpostproc/postprocess.h"
39+#endif
3840 #include "libavutil/avstring.h"
3941 #include "libavutil/mathematics.h"
4042 #include "libavutil/parseutils.h"
@@ -607,7 +609,9 @@ static void print_all_libs_info(int flags, int level) · 566 unmodified lines
607609 PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
608610 PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
609611 PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);
612+#if CONFIG_POSTPROC
610613 PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
614+#endif
611615 }
612616
613617 static void print_program_info(int flags, int level)
configure+1−1
@@ -253,7 +253,7 @@ Advanced options (experts only): · 252 unmodified lines
253253 --disable-armvfp disable ARM VFP optimizations
254254 --disable-iwmmxt disable iwmmxt optimizations
255255 --disable-mmi disable MMI optimizations
256− --disable-neon disable neon optimizations
256+ --disable-neon disable NEON optimizations
257257 --disable-vis disable VIS optimizations
258258 --disable-yasm disable use of yasm assembler
259259 --enable-pic build position-independent code
doc/avtools-common-opts.texi+2−2
@@ -119,8 +119,8 @@ Set the logging level used by the library. · 118 unmodified lines
119119 By default the program logs to stderr, if coloring is supported by the
120120 terminal, colors are used to mark errors and warnings. Log coloring
121121 can be disabled setting the environment variable
122−@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
123−the environment variable @env{FFMPEG_FORCE_COLOR}.
122+@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
123+the environment variable @env{AV_LOG_FORCE_COLOR}.
124124 The use of the environment variable @env{NO_COLOR} is deprecated and
125125 will be dropped in a following FFmpeg version.
126126
libavcodec/Makefile+1−0
@@ -655,6 +655,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o · 654 unmodified lines
655655 OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
656656 OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
657657 vorbis_data.o
658+OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
658659 OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
659660 OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
660661 OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
libavcodec/allcodecs.c+1−0
@@ -432,6 +432,7 @@ void avcodec_register_all(void) · 431 unmodified lines
432432 REGISTER_PARSER (DVBSUB, dvbsub);
433433 REGISTER_PARSER (DVDSUB, dvdsub);
434434 REGISTER_PARSER (FLAC, flac);
435+ REGISTER_PARSER (GSM, gsm);
435436 REGISTER_PARSER (H261, h261);
436437 REGISTER_PARSER (H263, h263);
437438 REGISTER_PARSER (H264, h264);
libavcodec/error_resilience.c+1−1
@@ -50,7 +50,7 @@ static void decode_mb(MpegEncContext *s, int ref){ · 49 unmodified lines
5050 h->mb_xy= s->mb_x + s->mb_y*s->mb_stride;
5151 memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache));
5252 assert(ref>=0);
53− /* FIXME: It is posible albeit uncommon that slice references
53+ /* FIXME: It is possible albeit uncommon that slice references
5454 * differ between slices. We take the easy approach and ignore
5555 * it for now. If this turns out to have any relevance in
5656 * practice then correct remapping should be added. */
libavcodec/gsm.h+31−0
@@ -0,0 +1,31 @@
1+/*
2+ * GSM common header
3+ *
4+ * This file is part of Libav.
5+ *
6+ * Libav is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * Libav is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with Libav; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+#ifndef AVCODEC_GSM_H
22+#define AVCODEC_GSM_H
23+
24+/* bytes per block */
25+#define GSM_BLOCK_SIZE 33
26+#define GSM_MS_BLOCK_SIZE 65
27+
28+/* samples per block */
29+#define GSM_FRAME_SIZE 160
30+
31+#endif /* AVCODEC_GSM_H */
libavcodec/gsm_parser.c+79−0
@@ -0,0 +1,79 @@
1+/*
2+ * Copyright (c) 2012 Justin Ruggles
3+ *
4+ * This file is part of Libav.
5+ *
6+ * Libav is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * Libav is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with Libav; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+/**
22+ * @file
23+ * GSM audio parser
24+ *
25+ * Splits packets into individual blocks.
26+ */
27+
28+#include "parser.h"
29+#include "gsm.h"
30+
31+typedef struct GSMParseContext {
32+ ParseContext pc;
33+ int block_size;
34+ int remaining;
35+} GSMParseContext;
36+
37+static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
38+ const uint8_t **poutbuf, int *poutbuf_size,
39+ const uint8_t *buf, int buf_size)
40+{
41+ GSMParseContext *s = s1->priv_data;
42+ ParseContext *pc = &s->pc;
43+ int next;
44+
45+ if (!s->block_size) {
46+ switch (avctx->codec_id) {
47+ case CODEC_ID_GSM: s->block_size = GSM_BLOCK_SIZE; break;
48+ case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break;
49+ default:
50+ return AVERROR(EINVAL);
51+ }
52+ }
53+
54+ if (!s->remaining)
55+ s->remaining = s->block_size;
56+ if (s->remaining <= buf_size) {
57+ next = s->remaining;
58+ s->remaining = 0;
59+ } else {
60+ next = END_NOT_FOUND;
61+ s->remaining -= buf_size;
62+ }
63+
64+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
65+ *poutbuf = NULL;
66+ *poutbuf_size = 0;
67+ return buf_size;
68+ }
69+ *poutbuf = buf;
70+ *poutbuf_size = buf_size;
71+ return next;
72+}
73+
74+AVCodecParser ff_gsm_parser = {
75+ .codec_ids = { CODEC_ID_GSM, CODEC_ID_GSM_MS },
76+ .priv_data_size = sizeof(GSMParseContext),
77+ .parser_parse = gsm_parse,
78+ .parser_close = ff_parse_close,
79+};
libavcodec/gsmdec_data.h+0−5
@@ -25,11 +25,6 @@ · 24 unmodified lines
2525 #include <stdint.h>
2626 #include "avcodec.h"
2727
28−// input and output sizes in byte
29−#define GSM_BLOCK_SIZE 33
30−#define GSM_MS_BLOCK_SIZE 65
31−#define GSM_FRAME_SIZE 160
32−
3328 typedef struct {
3429 AVFrame frame;
3530 // Contains first 120 elements from the previous frame
libavcodec/gsmdec_template.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 */
2626
2727 #include "get_bits.h"
28+#include "gsm.h"
2829 #include "gsmdec_data.h"
2930
3031 static void apcm_dequant_add(GetBitContext *gb, int16_t *dst)
libavcodec/libgsm.c+2−5
@@ -27,13 +27,10 @@ · 26 unmodified lines
2727
2828 // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
2929
30−#include "avcodec.h"
3130 #include <gsm/gsm.h>
3231
33−// gsm.h misses some essential constants
34−#define GSM_BLOCK_SIZE 33
35−#define GSM_MS_BLOCK_SIZE 65
36−#define GSM_FRAME_SIZE 160
32+#include "avcodec.h"
33+#include "gsm.h"
3734
3835 static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
3936 if (avctx->channels > 1) {
libavcodec/libvpxdec.c+2−1
@@ -119,5 +119,6 @@ AVCodec ff_libvpx_decoder = { · 118 unmodified lines
119119 .init = vp8_init,
120120 .close = vp8_free,
121121 .decode = vp8_decode,
122− .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
122+ .capabilities = CODEC_CAP_AUTO_THREADS,
123+ .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
123124 };
libavcodec/libvpxenc.c+1−1
@@ -622,7 +622,7 @@ AVCodec ff_libvpx_encoder = { · 621 unmodified lines
622622 .init = vp8_init,
623623 .encode = vp8_encode,
624624 .close = vp8_free,
625− .capabilities = CODEC_CAP_DELAY,
625+ .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
626626 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
627627 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
628628 .priv_class = &class,
libavcodec/libxavs.c+1−1
@@ -414,7 +414,7 @@ AVCodec ff_libxavs_encoder = { · 413 unmodified lines
414414 .init = XAVS_init,
415415 .encode = XAVS_frame,
416416 .close = XAVS_close,
417− .capabilities = CODEC_CAP_DELAY,
417+ .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
418418 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },
419419 .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"),
420420 .priv_class = &class,
libavcodec/msgsmdec.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #define BITSTREAM_READER_LE
2323 #include "avcodec.h"
2424 #include "msgsmdec.h"
25+#include "gsm.h"
2526 #include "gsmdec_template.c"
2627
2728 int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples,
libavcodec/msrle.c+2−2
@@ -1,5 +1,5 @@
11 /*
2− * Micrsoft RLE Video Decoder
2+ * Microsoft RLE video decoder
33 * Copyright (C) 2003 the ffmpeg project
44 *
55 * This file is part of FFmpeg.
@@ -21,7 +21,7 @@ · 15 unmodified lines
2121
2222 /**
2323 * @file
24− * MS RLE Video Decoder by Mike Melanson (melanson@pcisys.net)
24+ * MS RLE video decoder by Mike Melanson (melanson@pcisys.net)
2525 * For more information about the MS RLE format, visit:
2626 * http://www.pcisys.net/~melanson/codecs/
2727 *
libavcodec/pcm.c+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333
3434 static av_cold int pcm_encode_init(AVCodecContext *avctx)
3535 {
36− avctx->frame_size = 1;
36+ avctx->frame_size = 0;
3737 switch(avctx->codec->id) {
3838 case CODEC_ID_PCM_ALAW:
3939 pcm_alaw_tableinit();
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AVCODEC_VERSION_H
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 53
24−#define LIBAVCODEC_VERSION_MINOR 54
24+#define LIBAVCODEC_VERSION_MINOR 55
2525 #define LIBAVCODEC_VERSION_MICRO 100
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavcodec/x86/fft_mmx.asm+3−0
@@ -640,11 +640,14 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits · 639 unmodified lines
640640 %endmacro ; DECL_FFT
641641
642642 %ifdef HAVE_AVX
643+INIT_YMM
643644 DECL_FFT 6, _avx
644645 DECL_FFT 6, _avx, _interleave
645646 %endif
647+INIT_XMM
646648 DECL_FFT 5, _sse
647649 DECL_FFT 5, _sse, _interleave
650+INIT_MMX
648651 DECL_FFT 4, _3dn
649652 DECL_FFT 4, _3dn, _interleave
650653 DECL_FFT 4, _3dn2
libavformat/gsmdec.c+3−37
@@ -37,7 +37,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) · 36 unmodified lines
3737 {
3838 int ret, size;
3939
40− size = GSM_BLOCK_SIZE * 32;
40+ size = GSM_BLOCK_SIZE;
4141
4242 pkt->pos = avio_tell(s->pb);
4343 pkt->stream_index = 0;
@@ -48,7 +48,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) · 4 unmodified lines
4848 return ret < 0 ? ret : AVERROR(EIO);
4949 }
5050 pkt->size = ret;
51− pkt->duration = ret / GSM_BLOCK_SIZE;
51+ pkt->duration = 1;
5252 pkt->pts = pkt->pos / GSM_BLOCK_SIZE;
5353
5454 return 0;
@@ -65,7 +65,6 @@ static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 10 unmodified lines
6565 st->codec->codec_id = s->iformat->value;
6666 st->codec->channels = 1;
6767 st->codec->sample_rate = c->sample_rate;
68− st->codec->block_align = GSM_BLOCK_SIZE;
6968 st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
7069
7170 avpriv_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);
@@ -73,39 +72,6 @@ static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 1 unmodified line
7372 return 0;
7473 }
7574
76−static int gsm_read_seek2(AVFormatContext *s, int stream_index, int64_t min_ts,
77− int64_t ts, int64_t max_ts, int flags)
78−{
79− GSMDemuxerContext *c = s->priv_data;
80−
81− /* convert timestamps to file positions */
82− if (!(flags & AVSEEK_FLAG_BYTE)) {
83− if (stream_index < 0) {
84− AVRational bitrate_q = { GSM_BLOCK_SAMPLES, c->sample_rate * GSM_BLOCK_SIZE };
85− ts = av_rescale_q(ts, AV_TIME_BASE_Q, bitrate_q);
86− min_ts = av_rescale_q(min_ts, AV_TIME_BASE_Q, bitrate_q);
87− max_ts = av_rescale_q(max_ts, AV_TIME_BASE_Q, bitrate_q);
88− } else {
89− ts *= GSM_BLOCK_SIZE;
90− min_ts *= GSM_BLOCK_SIZE;
91− max_ts *= GSM_BLOCK_SIZE;
92− }
93− }
94− /* round to nearest block boundary */
95− ts = (ts + GSM_BLOCK_SIZE / 2) / GSM_BLOCK_SIZE * GSM_BLOCK_SIZE;
96− ts = FFMAX(0, ts);
97−
98− /* handle min/max */
99− while (ts < min_ts)
100− ts += GSM_BLOCK_SIZE;
101− while (ts > max_ts)
102− ts -= GSM_BLOCK_SIZE;
103− if (ts < min_ts || ts > max_ts)
104− return -1;
105−
106− return avio_seek(s->pb, ts, SEEK_SET);
107−}
108−
10975 static const AVOption options[] = {
11076 { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),
11177 AV_OPT_TYPE_INT, {.dbl = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
@@ -126,7 +92,7 @@ AVInputFormat ff_gsm_demuxer = { · 14 unmodified lines
12692 .priv_data_size = sizeof(GSMDemuxerContext),
12793 .read_header = gsm_read_header,
12894 .read_packet = gsm_read_packet,
129− .read_seek2 = gsm_read_seek2,
95+ .flags = AVFMT_GENERIC_INDEX,
13096 .extensions = "gsm",
13197 .value = CODEC_ID_GSM,
13298 .priv_class = &class,
libavformat/wtvdec.c+1−0
@@ -1022,6 +1022,7 @@ static int read_seek(AVFormatContext *s, int stream_index, · 1021 unmodified lines
10221022 static int read_close(AVFormatContext *s)
10231023 {
10241024 WtvContext *wtv = s->priv_data;
1025+ av_freep(&wtv->index_entries);
10251026 wtvfile_close(wtv->pb);
10261027 return 0;
10271028 }
tools/patcheck+1−1
@@ -67,7 +67,7 @@ $EGREP $OPT '^\+ *(const *|)static' $*| $EGREP --color=always '[^=]= *(0|NULL)[^ · 66 unmodified lines
6767 cat $TMP
6868 hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*
6969
70−hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed|upto|paket)\b' 'common typos' $*
70+hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed|upto|paket|posible)\b' 'common typos' $*
7171
7272 hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*
7373 hiegrep '[^sn]printf' 'Please use av_log' $*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t