Compare commits

..

162 Commits

Author SHA1 Message Date
Michael Niedermayer
61f55565fb rtpdec_asf: fix memleak
Based on a suggestion by Ronald S. Bultje
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a2b66a366d)
2011-09-07 16:57:15 +02:00
Michael Niedermayer
b6b46db9e4 Update for 0.7.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 15:18:29 +02:00
Michael Niedermayer
21d99be9dc Merge branch 'release/0.8' into release/0.7
* release/0.8: (21 commits)
  rtp: Fix integer underflow that could allow remote code execution.
  cavsdec: avoid possible crash with crafted input
  vf_scale: apply the same transform to the aspect during init that is applied per frame
  Fix memory corruption in case of memory allocation failure in av_probe_input_buffer()
  Make all option parsing functions match the function pointer type through which they are called.
  mjpegdec; even better RSTn skiping Fixes Ticket426
  jpegdec: better rst skiping Fixes Ticket426
  mpeg4: fix another packed divx issue. Fixes getting_stuck.avi
  mpeg4: adjust dummy frame threashold for packed divx. Fixes Ticket427
  configure: add missing CFLAGS to fix building on the HURD
  cavs: fix some crashes with invalid bitstreams
  jpegdec: actually search for and parse RSTn
  Fix compilation with --disable-avfilter. (cherry picked from commit 67a8251690)
  libavfilter: fix --enable-small
  0.8.2
  cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
  Fix possible crash when decoding mpeg streams.
  Bink: clip AC coefficients during dequantization.
  ffmpeg: fix passlogfile regression
  Fix several security issues in matroskadec.c (MSVR-11-0080).
  ...

Conflicts:
	Doxyfile
	RELEASE
	VERSION

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 15:04:56 +02:00
Michael Niedermayer
c2a2ad133e rtp: Fix integer underflow that could allow remote code execution.
Fixes MSVR-11-0088
Credit:  Jeong Wook Oh of Microsoft and Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba9a7e0d71)
2011-09-07 15:01:30 +02:00
Michael Niedermayer
b6187e48db cavsdec: avoid possible crash with crafted input
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f06c1c61e)
2011-09-07 14:59:29 +02:00
Michael Niedermayer
8af11e51f2 vf_scale: apply the same transform to the aspect during init that is applied per frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c8868f28e3)
2011-09-07 14:20:53 +02:00
Michael Niedermayer
f597825052 Fix memory corruption in case of memory allocation failure in av_probe_input_buffer()
Reported-by: Tanami Ohad
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 941bb552c6)
2011-09-07 14:20:53 +02:00
Jeff Downs
7d704f5127 Make all option parsing functions match the function pointer type through which they are called.
All option parsing functions now match the function pointer signature through
which they are called (int f(const char *, const char *), thereby working
reliably on all platforms.
Prefix all option processing functions with opt_
2011-09-07 08:56:04 +02:00
Jeff Downs
7b6b9be861 Make all option parsing functions match the function pointer type through which they are called.
All option parsing functions now match the function pointer signature through
which they are called (int f(const char *, const char *), thereby working
reliably on all platforms.
Prefix all option processing functions with opt_
2011-09-07 08:48:38 +02:00
Michael Niedermayer
374409eb1a mjpegdec; even better RSTn skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be7eed72c8)
2011-09-07 01:07:37 +02:00
Michael Niedermayer
a352fedb24 jpegdec: better rst skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 01:06:58 +02:00
Michael Niedermayer
c92068430d mpeg4: fix another packed divx issue.
Fixes getting_stuck.avi

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dbac85f8d)
2011-09-07 00:48:28 +02:00
Michael Niedermayer
274a5b7cdb mpeg4: adjust dummy frame threashold for packed divx.
Fixes Ticket427

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e7e1f1509)
2011-09-07 00:48:27 +02:00
Michael Niedermayer
eb975b1c8b mjpegdec; even better RSTn skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be7eed72c8)
2011-09-07 00:31:14 +02:00
Michael Niedermayer
84648d33ba jpegdec: better rst skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 94c2478d90)
2011-09-07 00:31:14 +02:00
Michael Niedermayer
4b8a0b058d mpeg4: fix another packed divx issue.
Fixes getting_stuck.avi

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dbac85f8d)
2011-09-07 00:29:02 +02:00
Michael Niedermayer
1de90fd375 mpeg4: adjust dummy frame threashold for packed divx.
Fixes Ticket427

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e7e1f1509)
2011-09-07 00:29:02 +02:00
Michael Niedermayer
c8b37fd03d Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  configure: add missing CFLAGS to fix building on the HURD

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-26 01:55:20 +02:00
Pino Toscano
b37131f798 configure: add missing CFLAGS to fix building on the HURD
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f60d136637)
2011-08-25 22:47:06 +02:00
Reimar Döffinger
95345e942c Avoid crash due to ic being NULL if avformat_open_input fails.
This updates the code to match current master.
Should fix trac issue #410.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-08-23 19:47:19 +02:00
Michael Niedermayer
878a7d1573 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  cavs: fix some crashes with invalid bitstreams
  jpegdec: actually search for and parse RSTn

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-21 22:44:58 +02:00
Mans Rullgard
bd968d260a cavs: fix some crashes with invalid bitstreams
This removes all valgrind-reported invalid writes with one
specific test file.

Fixes http://www.ocert.org/advisories/ocert-2011-002.html

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 4a71da0f3a)
2011-08-21 11:23:56 +02:00
Michael Niedermayer
00c5cf4beb jpegdec: actually search for and parse RSTn
Fixes decoding of MJPEG files produced by some UVC Logitec web cameras,
such as "Notebook Pro" and "HD C910".

References:
http://trac.videolan.org/vlc/ticket/4215
http://ffmpeg.org/trac/ffmpeg/ticket/267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Reviewed-by: Kostya <kostya.shishkov@gmail.com>
(cherry picked from commit 8c0fa61a97)
2011-08-21 11:08:27 +02:00
Carl Eugen Hoyos
87757508ab Fix compilation with --disable-avfilter.
(cherry picked from commit 67a8251690)
2011-08-16 23:33:20 +02:00
Carl Eugen Hoyos
6a57021cf9 Fix compilation with --disable-avfilter.
(cherry picked from commit 67a8251690)
2011-08-16 23:32:06 +02:00
Michael Niedermayer
f66418afba libavfilter: fix --enable-small
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 633aa01f72)
2011-08-15 19:49:24 +02:00
Michael Niedermayer
f20f79307b libavfilter: fix --enable-small
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 633aa01f72)
2011-08-15 19:49:17 +02:00
Michael Niedermayer
7371b0ca6f 0.7.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:59:49 +02:00
Michael Niedermayer
c5cbda5079 cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:59:15 +02:00
Michael Niedermayer
d1bc77d86c 0.8.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:48:30 +02:00
Michael Niedermayer
91d5da9321 cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:46:22 +02:00
Carl Eugen Hoyos
08ddfb77a1 Fix possible crash when decoding mpeg streams.
This reverts 2cf8355f98,
fixes ticket 329.
2011-08-04 11:49:52 +02:00
Reimar Döffinger
a0352d01e9 Bink: clip AC coefficients during dequantization.
Fixes artefacts with Neverwinter Nights WOTCLogo.bik
(http://drmccoy.de/zeugs/WOTCLogo.bik).
Fixes trac ticket #352.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 47b71eea09)
2011-08-04 11:45:28 +02:00
Carl Eugen Hoyos
8893f7d815 Fix possible crash when decoding mpeg streams.
This reverts 2cf8355f98,
fixes ticket 329.
2011-08-04 11:43:34 +02:00
Reimar Döffinger
7c772ccd27 Bink: clip AC coefficients during dequantization.
Fixes artefacts with Neverwinter Nights WOTCLogo.bik
(http://drmccoy.de/zeugs/WOTCLogo.bik).
Fixes trac ticket #352.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 47b71eea09)
2011-08-04 11:42:33 +02:00
Michael Niedermayer
cf82c5cd5b ffmpeg: fix passlogfile regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2ff36ef521)
2011-07-28 18:33:07 +02:00
Michael Niedermayer
2ff36ef521 ffmpeg: fix passlogfile regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-28 18:32:26 +02:00
Michael Niedermayer
cb8577a4da Fix several security issues in matroskadec.c (MSVR-11-0080).
Whitespace of the patch cleaned up by Aurel
Some of the issues have been reported by Steve Manzuik / Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 956c901c68)
2011-07-28 15:35:38 +02:00
Michael Niedermayer
7e33a66c0e Fix several security issues in matroskadec.c (MSVR-11-0080).
Whitespace of the patch cleaned up by Aurel
Some of the issues have been reported by Steve Manzuik / Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 956c901c68)
2011-07-28 15:29:43 +02:00
Baptiste Coudurier
b55b34f862 ffmpeg: fix prototypes of functions after the removal of OPT_FUNC2.
(cherry picked from commit 90a40b226a)
2011-07-27 23:54:34 +02:00
Baptiste Coudurier
893cf1b1ae ffmpeg: fix prototypes of functions after the removal of OPT_FUNC2.
(cherry picked from commit 90a40b226a)
2011-07-27 22:52:36 +02:00
Michael Niedermayer
609d299ed0 update version for 0.7.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-27 12:51:28 +02:00
Michael Niedermayer
01a0612c70 Merge branch 'release/0.8' into release/0.7
* release/0.8: (82 commits)
  Fix version numbers
  rtp: disable udp fifos, the rtp code cannot work with the fifos in its current form as rtp bypasses the public API.
  udp: allow fifo size to be tuned seperately
  riff: Add mpgv MPEG-2 fourcc
  Update Changelog
  matroskadec: fix integer underflow if header length < probe length.
  ffmpeg: fix operation with --disable-avfilter
  vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h
  build: Create mlib optimization directories during out-of-tree builds.
  changelog: misc typo and wording fixes (cherry picked from commit b047941d7d)
  doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support. (cherry picked from commit 5ccbf80963)
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  Update RELEASE file
  update Changelog
  mt: proper locking around release_buffer calls.
  vp8/mt: flush worker thread, not application thread context, on seek.
  docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue
  docs: Use proper markup for a literal command line option
  docs: Don't recommend adding --enable-memalign-hack
  docs: Remove needless configure options
  ...

Conflicts:
	VERSION
	libavcodec/opt.h
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-27 11:20:13 +02:00
Reimar Döffinger
dcf1830a15 For FFmpeg 0.7 branch: Treat AV_SAMPLE_FMT_NONE as S16 for encoders.
This fixes compatibility with e.g. pcm_a52 ALSA plugin which in
previous versions never set sample_fmt.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-07-26 21:58:10 +02:00
Michael Niedermayer
a8d89df367 Fix version numbers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-26 01:01:06 +02:00
Michael Niedermayer
095946afa7 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (65 commits)
  riff: Add mpgv MPEG-2 fourcc
  Update Changelog
  matroskadec: fix integer underflow if header length < probe length.
  ffmpeg: fix operation with --disable-avfilter
  vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h
  build: Create mlib optimization directories during out-of-tree builds.
  changelog: misc typo and wording fixes (cherry picked from commit b047941d7d)
  doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support. (cherry picked from commit 5ccbf80963)
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  Update RELEASE file
  update Changelog
  mt: proper locking around release_buffer calls.
  vp8/mt: flush worker thread, not application thread context, on seek.
  docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue
  docs: Use proper markup for a literal command line option
  docs: Don't recommend adding --enable-memalign-hack
  docs: Remove needless configure options
  oggdec: prevent heap corruption.
  oggdec: Abort Ogg header parsing when encountering a data packet.
  Add LGPL license boilerplate to files lacking it.
  ...

Conflicts:
	Changelog
	configure
	doc/developer.texi
	libavcodec/libvpxenc.c
	libavcodec/rawdec.c
	libavfilter/x86/gradfun.c
	libavformat/Makefile
	libavformat/isom.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-26 00:14:04 +02:00
Michael Niedermayer
6d75dbebc0 rtp: disable udp fifos, the rtp code cannot work with the fifos in its current form as rtp bypasses the public API.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 158eb8599a)
2011-07-25 17:08:48 +02:00
Michael Niedermayer
f54b8f8482 udp: allow fifo size to be tuned seperately
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bd652ff66e)
2011-07-25 17:08:45 +02:00
Alex Converse
a05219d801 riff: Add mpgv MPEG-2 fourcc
Supported by mplayer and seen in the wild.
(cherry picked from commit 505345ed5d)
2011-07-23 10:29:43 +02:00
Reinhard Tartler
c02b02d725 Update Changelog 2011-07-21 09:27:23 +02:00
Chris Evans
5fab0ccd81 matroskadec: fix integer underflow if header length < probe length.
This fixes a crash with specifically crafted files.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 69619a13c3)
2011-07-21 09:09:03 +02:00
Mans Rullgard
20829cf8a2 ffmpeg: fix operation with --disable-avfilter
The width and height must be copied from the input before
being used.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit e9f98c9022)
2011-07-21 09:08:00 +02:00
Stefano Sabatini
0b4840af0c vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h
cxtypes.h works with version 2.1 and older, cxcore.h works with 2.2 and older.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 9bc8bcddbd)
2011-07-18 12:37:22 +02:00
Diego Biurrun
896f80f82c build: Create mlib optimization directories during out-of-tree builds. 2011-07-16 15:20:18 +02:00
Diego Biurrun
b57c6d1a4c changelog: misc typo and wording fixes
(cherry picked from commit b047941d7d)
2011-07-16 15:15:59 +02:00
Diego Biurrun
3749066dd8 doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support.
(cherry picked from commit 5ccbf80963)
2011-07-16 15:15:59 +02:00
John Stebbins
c29c609e0f matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
EBML_STOP leaves matroska->current_id set. Then matroska_read_seek changes
the stream position without resetting current_id.  The next
matroska_parse_cluster  fails due to calculation of incorrect pos.  So clear
current_id when avio_seek happens in matroska_read_seek.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit cdc2c1c576)
2011-07-16 13:49:34 +02:00
Reinhard Tartler
9459390f29 Update RELEASE file 2011-07-12 18:31:28 +02:00
Reinhard Tartler
2bbd81fba3 update Changelog 2011-07-12 18:13:35 +02:00
Ronald S. Bultje
5e3578893a mt: proper locking around release_buffer calls.
This fixes a crash when seeking in some webm files with many
threads (e.g. 8).
(cherry picked from commit 5eafc8b466)
2011-07-12 18:13:35 +02:00
Ronald S. Bultje
dc1b670a2c vp8/mt: flush worker thread, not application thread context, on seek.
This prevents a crash when seeking.
(cherry picked from commit d1cf459119)
2011-07-12 18:13:35 +02:00
Martin Storsjö
0156f4f9da docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b369f327d5)
2011-07-12 18:13:35 +02:00
Martin Storsjö
a52c615a42 docs: Use proper markup for a literal command line option
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a3a94e1498)
2011-07-12 18:13:35 +02:00
Reinhard Tartler
5c2d7c4dc8 docs: Don't recommend adding --enable-memalign-hack
It is enabled automatically when required nowadays.

Signed-off-by: Martin Storsj <martin@martin.st>
(cherry picked from commit 9d36139231)
2011-07-12 18:13:35 +02:00
Martin Storsjö
004194f465 docs: Remove needless configure options
Specifying --enable-static --disable-shared isn't necessary, these
are the defaults.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-07-12 18:13:35 +02:00
Chris Evans
cd63c32ff6 oggdec: prevent heap corruption.
Specifically crafted samples can reinit ogg->streams[] while
reading samples, and thus we should not cache old pointers since
these may no longer be valid.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 4cc3467e7a)
2011-07-12 18:13:35 +02:00
Reimar Döffinger
5a33a29a91 oggdec: Abort Ogg header parsing when encountering a data packet.
Fixes Bugzilla #11.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 0a94020b5b)
2011-07-12 18:13:35 +02:00
Diego Biurrun
683df9bf54 Add LGPL license boilerplate to files lacking it.
(cherry picked from commit e3759c567d)
2011-07-12 18:13:35 +02:00
Diego Biurrun
64e2656f7c doxygen: Fix documentation for some VP8 functions.
(cherry picked from commit 3c432e1186)
2011-07-12 18:13:35 +02:00
Christian Schmidt
8e3d264fb2 libxvid: add missing include of libavutil/mathematics.h
Signed-off-by: Mans Rullgard <mans@mansr.com>

(cherry picked from commit 6c374bc0b4)
2011-07-12 18:05:55 +02:00
Robert Swain
46a2dc9175 vorbis: vpxenc: Add missing include for av_rescale*
Signed-off-by: Mans Rullgard <mans@mansr.com>

(cherry picked from commit 954a653216)
2011-07-12 18:05:55 +02:00
Carl Eugen Hoyos
b9e126fbe2 ffmpeg: Fix VDPAU decoding for some H264 samples.
(cherry picked from commit a4ab70f92e)
2011-07-12 18:05:55 +02:00
Diego Biurrun
07dc4a79c7 RTSP: Doxygen comment cleanup
Do not use Doxygen for comments that apply to specific implementation
details; merge some duplicated Doxygen comment blocks.

(cherry picked from commit f75e3da535)
2011-07-12 18:05:55 +02:00
Diego Biurrun
43de5c034f doxygen: Escape '\' in Doxygen documentation.
(cherry picked from commit c81a2b9b4f)
2011-07-12 18:05:55 +02:00
Loren Merritt
2f0a10174e vf_gradfun: relicense x86 asm to LGPL
Actually I gave permission for LGPL long ago, but the original import
failed to update the license header.
(cherry picked from commit 082768f0b1)
2011-07-07 16:51:47 +02:00
Reimar Döffinger
0a48a67e57 Fix av_open_input_stream with uninitialized context pointer.
Code would allocate a new context but forget to assign it
to the pointer actually passed to avformat_open_input,
potentially causing a crash.
Even if it was initialized it would cause a memleak.
This caused crashes with e.g. mpd, see also
http://bugs.gentoo.org/show_bug.cgi?id=373423

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 4e59c8ecf1)
2011-07-06 20:19:48 +02:00
Reimar Döffinger
e8baa8eb7f Fix av_open_input_stream with uninitialized context pointer.
Code would allocate a new context but forget to assign it
to the pointer actually passed to avformat_open_input,
potentially causing a crash.
Even if it was initialized it would cause a memleak.
This caused crashes with e.g. mpd, see also
http://bugs.gentoo.org/show_bug.cgi?id=373423

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-07-05 23:26:16 +02:00
Reinhard Tartler
d32b2d4de1 update Changelog 2011-07-03 20:01:08 +02:00
Reinhard Tartler
924b2ee8f2 Add version number to doxygen config 2011-07-03 20:01:08 +02:00
Reinhard Tartler
f95e5225fe doxygen: Drop array size declarations from Doxygen parameter names.
Adding [] to a Doxygen parameter name clashes with Doxygen syntax.
(cherry picked from commit ff993cd7fc)
2011-07-03 19:58:33 +02:00
Diego Biurrun
8f536408d1 doxygen: Remove spurious documentation for non-existing function parameters.
(cherry picked from commit 01c17c88ed)
2011-07-03 19:58:33 +02:00
Reinhard Tartler
093f0f13e6 doxygen: fix usage of @file directive in libavutil/{dict,file}.h
(cherry picked from commit 134557f3a4)
2011-07-03 19:58:29 +02:00
Gavin Kinsey
c172eb7925 Fix segmentation fault in ffprobe
(cherry picked from commit c558122e4e)
2011-07-03 19:49:54 +02:00
Reinhard Tartler
154ea553f6 Update Doxyfile to the format preferred by Doxygen 1.7.1 (via 'doxygen -u').
This is the version available in Debian stable, so it should be a reasonable
baseline that can be expected to be present on all developer machines.

Moreover, this is the version that is used by the nightly cronjob that
generates the online html version.
(cherry picked from commit 10dde477c7)
2011-07-03 19:49:54 +02:00
Stefano Sabatini
d734d4ce6a suggest to use av_get_bytes_per_sample() in av_get_bits_per_sample_format() doxy
The previously suggested replacement - av_get_bits_per_sample_fmt() -
was also deprecated.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ccfa626db8)
2011-07-03 19:49:53 +02:00
Stefano Sabatini
c445e9dc62 ffmpeg: use av_get_bytes_per_sample() in place of av_get_bits_per_sample_fmt()
av_get_bits_per_sample_fmt() was deprecated.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit f6d6783a4d)
2011-07-03 19:49:53 +02:00
Reinhard Tartler
c5c2654351 libavformat: Add an example how to use the metadata API
Also include it into the doxygen documentation
(cherry picked from commit 12489443de)
2011-07-03 19:49:53 +02:00
Reinhard Tartler
2fe47b21c8 doxygen: Prefer member groups over grouping into modules
Before this, almost all module groups have been used for grouping functions
and fields in structures semantically. This causes them to not appear
properly in the file documentation and needlessly clutters up the "Modules"
index.

Additionally, this commit streamlines some spelling and appearances.
(cherry picked from commit 21a19b7912)
2011-07-03 19:49:53 +02:00
Reinhard Tartler
b91ebb60d8 doxygen: be more permissive when searching for API examples
(cherry picked from commit 7655cfb1b8)
2011-07-03 19:49:53 +02:00
Reinhard Tartler
f1d1ef810a avformat: doxify the Metadata API
convert the comment that documents the metadata API to use
the doxygen markup
(cherry picked from commit 1a53a438dc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-07-03 19:49:53 +02:00
Anton Khirnov
b263e94f77 lavf: restore old behavior for custom AVIOContex with an AVFMT_NOFILE format.
av_open_input_stream used to allow this, even though it makes no sense.
Make it just print a warning instead of failing, thus restoring
compatibility.

Note that avformat_open_input() will still reject this combination.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 4f731c4429)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-07-03 19:49:53 +02:00
Anton Khirnov
9da3063e1c lavf: use the correct pointer in av_open_input_stream().
(cherry picked from commit 5001d6ef4a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-07-03 19:49:49 +02:00
Reimar Döffinger
b6fe44b9db Add operand size to add instructions.
In these cases it can't be guessed from the operands (at least
not necessarily), and it seems some clang versions refuse to
compile it.
Fixes ticket #303.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 5c13b5bb39)
2011-07-01 19:24:38 +02:00
Reimar Döffinger
72ac64544f Add operand size to add instructions.
In these cases it can't be guessed from the operands (at least
not necessarily), and it seems some clang versions refuse to
compile it.
Fixes ticket #303.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 5c13b5bb39)
2011-07-01 19:23:58 +02:00
Ronald S. Bultje
8f7f3f0453 ogg: fix double free when finding length of small chained oggs.
ogg_save() copies streams[], but doesn't keep track of free()'ed
struct members. Thus, if in between a call to ogg_save() and
ogg_restore(), streams[].private was free()'ed, this would result
in a double free -> crash, which happened when e.g. playing small
chained ogg fragments.
(cherry picked from commit 9ed6cbc3ee)
2011-07-01 02:41:30 +02:00
Carl Eugen Hoyos
376dfd07ab Fix possible double free when encoding using xvid.
(cherry picked from commit 315f0e3fd8)
2011-07-01 02:41:25 +02:00
Ronald S. Bultje
b62c0c0bce ogg: fix double free when finding length of small chained oggs.
ogg_save() copies streams[], but doesn't keep track of free()'ed
struct members. Thus, if in between a call to ogg_save() and
ogg_restore(), streams[].private was free()'ed, this would result
in a double free -> crash, which happened when e.g. playing small
chained ogg fragments.
(cherry picked from commit 9ed6cbc3ee)
2011-07-01 02:40:47 +02:00
Carl Eugen Hoyos
00498a7e59 Fix possible double free when encoding using xvid.
(cherry picked from commit 315f0e3fd8)
2011-07-01 02:39:57 +02:00
Ronald S. Bultje
cb66b55270 ogg: fix double free when finding length of small chained oggs.
ogg_save() copies streams[], but doesn't keep track of free()'ed
struct members. Thus, if in between a call to ogg_save() and
ogg_restore(), streams[].private was free()'ed, this would result
in a double free -> crash, which happened when e.g. playing small
chained ogg fragments.
(cherry picked from commit 9ed6cbc3ee)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-29 20:12:32 +02:00
Kostya Shishkov
9482dd0d17 wavpack: skip blocks with no samples
These blocks don't report audio stream parameters and they are not needed
for decoding.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit cb7b55b096)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-29 19:47:12 +02:00
Jason Garrett-Glaser
87eedf6943 Add new yuv444 pixfmts to avcodec_align_dimensions2
Fixes draw_edges crashes with high-bit-depth 4:4:4 decoding.
(cherry picked from commit da55ee6ccc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-29 19:46:14 +02:00
Carl Eugen Hoyos
f239b91596 Fix VDPAU decoding for some H264 samples.
(cherry picked from commit e747b091cb)
2011-06-29 10:10:13 +02:00
Carl Eugen Hoyos
06107e9605 Fix VDPAU decoding for some H264 samples.
(cherry picked from commit e747b091cb)
2011-06-29 10:09:00 +02:00
Martin Matuska
d052370c1e pict_type: add a value for unknown/none.
In commit bebe72f4a0, the enum AV_PICTURE_TYPE_* was introduced. There are still places in the code where pict_type is used as an integer and there is a case where "pict_type = 0" with the explanation "let ffmpeg decide what to do". The new enum does not know a value of 0 and C++ will fail if compiling such programs anyway as it is refered as an int (and you cannot patch them properly).
(cherry picked from commit 5129336714)
2011-06-28 13:42:02 +02:00
Martin Matuska
ce993ce791 pict_type: add a value for unknown/none.
In commit bebe72f4a0, the enum AV_PICTURE_TYPE_* was introduced. There are still places in the code where pict_type is used as an integer and there is a case where "pict_type = 0" with the explanation "let ffmpeg decide what to do". The new enum does not know a value of 0 and C++ will fail if compiling such programs anyway as it is refered as an int (and you cannot patch them properly).
(cherry picked from commit 5129336714)
2011-06-28 13:41:49 +02:00
Jason Garrett-Glaser
e54fd33848 H.264: disable 2tap qpel with CODEC_FLAG2_FAST and >8-bit
2tap qpel isn't implemented yet for high bit depth, so it just breaks decoding.
(cherry picked from commit 9a0dda8b3a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-27 08:39:30 +02:00
Mans Rullgard
9b69efc02b ARM: silence some annoying armcc warnings
This silences warnings about pointer target sign mismatches as
already done for gcc with -Wno-pointer-sign.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d0ce090ec5)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-27 08:38:42 +02:00
Stefano Sabatini
1bf80a9a14 configure: select buffersink_filter when ffmpeg is enabled
buffersink_filter is a strong requirement for compiling ffmpeg.
Fixes ffmpeg compilation with --disable-everything.
(cherry picked from commit e65d6e22e3)
2011-06-25 15:27:37 +02:00
Stefano Sabatini
c0b90d4088 configure: select buffersink_filter when ffmpeg is enabled
buffersink_filter is a strong requirement for compiling ffmpeg.
Fixes ffmpeg compilation with --disable-everything.
(cherry picked from commit e65d6e22e3)
2011-06-25 15:27:30 +02:00
Reinhard Tartler
9c709f0534 add changelog entries for added fourcc codecs and H.264 fixes 2011-06-24 07:42:57 +02:00
Diego Biurrun
4ad56612f9 build: Remove dependency and editor backup files also in the doc/ subdirectory. 2011-06-24 07:42:56 +02:00
Carl Eugen Hoyos
acb62e998f alsa: support unsigned variants of already supported signed formats.
(cherry picked from commit 2359aeb52d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:50:52 +02:00
Jason Garrett-Glaser
180faac637 H.264: fix 4:4:4 + deblocking + 8x8dct + cavlc + MBAFF
(cherry picked from commit 2702a6f114)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:14:55 +02:00
Jason Garrett-Glaser
13c943ffb1 H.264: fix 4:4:4 + deblocking + MBAFF
(cherry picked from commit 7c9079ab4c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:14:53 +02:00
Jason Garrett-Glaser
18052f1df9 H.264: fix 4:4:4 cropping warning
(cherry picked from commit 932db25024)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:14:51 +02:00
Jason Garrett-Glaser
4c8b14c37f H.264: reference the correct SPS in decode_scaling_matrices
(cherry picked from commit 85a88f9c0c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:14:48 +02:00
Jason Garrett-Glaser
e4071fa04c H.264: fix bug in lossless 4:4:4 decoding
Coefficient test for i16x16 add_pixels4 assumed luma plane.
(cherry picked from commit 3b79f2e2e9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:13:55 +02:00
Carl Eugen Hoyos
bf5ed476ba alsa: add support for more formats.
Specifically, f32, f64, s32, s24, a-law and mu-law.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 921715edff)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 09:13:55 +02:00
ami_stuff
fcd26ebc8f rawdec: Fix decoding of QT WRAW files.
From some tests it results that:
1. All of the AVI/MOV WRAW files need to be flipped.
2. MOV WRAW files need to use AVI color modes.
3. Assigning PAL8 mode by default to WRAW codec is not correct.
(cherry picked from commit 67e7dc5404)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
Mans Rullgard
6a34f5d447 configure: report optimization for size separately
This removes an unsightly override of the 'optimizations' setting
only to make the configure report print 'small' when --enable-small
is used.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit f082a0fb42)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
Carl Eugen Hoyos
26f48752fb mov: Support Digital Voodoo SD 8 Bit and DTS codec identifiers.
(cherry picked from commit 53d5cd2c82)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
ami_stuff
1aef8de6d7 mov: Support R10g codec identifier.
(cherry picked from commit 7ac639654f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
Kamil Nowosad
9ac3e32b29 riff/img2: Add JPEG 2000 codec IDs.
(cherry picked from commit a304a83362)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
ami_stuff
5254285636 riff: Add DAVC fourcc.
This fourcc is used by the "mpegable AVC" codec and files encoded with
this codec decode correctly with our H.264 decoder.
(cherry picked from commit 2ea1ca1714)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:37 +02:00
Carl Eugen Hoyos
137838945f riff: Add M263, XVIX, MMJP, CDV5 fourccs.
(cherry picked from commit 682a20114e)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:36 +02:00
ami_stuff
6cef3ddbdc rawvideo: Support auv2 fourcc.
(cherry picked from commit d352df0931)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:50:36 +02:00
Diego Biurrun
403eee165c h264: Fix assert that failed to compile with -DDEBUG.
The assert referenced a variable that no longer exists since 4:4:4 support.
(cherry picked from commit 6371ce4b0f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-06-23 08:49:22 +02:00
Jason Garrett-Glaser
523b57b331 H.264: fix 4:4:4 + deblocking + 8x8dct + cavlc + MBAFF
(cherry picked from commit 2702a6f114)
2011-06-23 00:39:44 +02:00
Jason Garrett-Glaser
a3589cce81 H.264: fix 4:4:4 + deblocking + MBAFF
(cherry picked from commit 7c9079ab4c)
2011-06-23 00:39:44 +02:00
Jason Garrett-Glaser
0820593e64 H.264: fix 4:4:4 cropping warning
(cherry picked from commit 932db25024)
2011-06-23 00:39:44 +02:00
Jason Garrett-Glaser
4db2b966be H.264: reference the correct SPS in decode_scaling_matrices
(cherry picked from commit 85a88f9c0c)
2011-06-23 00:39:44 +02:00
Jason Garrett-Glaser
b7b61ff6a3 H.264: fix 4:4:4 + deblocking + 8x8dct + cavlc + MBAFF
(cherry picked from commit 2702a6f114)
2011-06-23 00:17:03 +02:00
Jason Garrett-Glaser
7a6e47b99d H.264: fix 4:4:4 + deblocking + MBAFF
(cherry picked from commit 7c9079ab4c)
2011-06-23 00:17:03 +02:00
Jason Garrett-Glaser
f84c349b3b H.264: fix 4:4:4 cropping warning
(cherry picked from commit 932db25024)
2011-06-23 00:17:03 +02:00
Jason Garrett-Glaser
26f732e21d H.264: reference the correct SPS in decode_scaling_matrices
(cherry picked from commit 85a88f9c0c)
2011-06-23 00:17:03 +02:00
Michael Niedermayer
82b2dd5ee4 release_notes: update for 0.7.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-22 23:21:19 +02:00
Michael Niedermayer
e82ddde05a set VERSION for 0.7.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-22 23:19:34 +02:00
Clément Bœsch
07f5da6128 vf_mp: do not add duplicated pixel formats.
This avoid a crash with in avfilter_merge_formats() in case one of the
filter formats list has multiple time the same entry.

Thanks to Mina Nagy Zaki for helping figuring out the issue.
(cherry picked from commit 680e473643)
2011-06-22 22:55:39 +02:00
Anton Khirnov
e845455225 ffplay: use new avformat_open_* API.
(cherry picked from commit 44e83d0c97)
2011-06-22 22:55:31 +02:00
Reimar Döffinger
3fedb3e65c Revert needless API change in 05e84c95.
When providing a custom AVIOContex for a AVFMT_NOFILE format
only print a warning instead of erroring out.
This allows the code to work with older MPlayer versions that
just always set pb out of laziness.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-06-22 21:20:24 +02:00
Michael Niedermayer
0b5c261212 set for next release of 0.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-22 20:24:02 +02:00
Clément Bœsch
680e473643 vf_mp: do not add duplicated pixel formats.
This avoid a crash with in avfilter_merge_formats() in case one of the
filter formats list has multiple time the same entry.

Thanks to Mina Nagy Zaki for helping figuring out the issue.
2011-06-22 20:21:54 +02:00
Anton Khirnov
44e83d0c97 ffplay: use new avformat_open_* API. 2011-06-22 20:20:41 +02:00
Michael Niedermayer
1986380df2 Merge branch 'master' into oldabi
* master:
  ffplay: do not init SDL audio if -an is specified.
  Fix zero-length gnu_printf format string warning.
  A cmp instruction with two constants is invalid, thus "g" constraint is not correct but must be "rm" instead.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 21:55:55 +02:00
Michael Niedermayer
df3850db49 Merge branch 'master' into oldabi
* master:
  release_notes: document not fully understood mingw-sdl issue
  release_notes: some updates
  presets: forgotten libvpx presets
  release_notes: fix version
  release_notes: mention more codecs Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  release_notes: there will be 2 releases each for one ABI/API.
  release_notes: suggest git log instead of the poorly maintained APIChanges
  release_notes: we do support releases
  build system: disable memalign on haiku, its not reliable there.
  ffprobe: remove duplicate avformat_alloc_context()
  Fix segmentation fault in ffprobe
  wma: fix infinite loop
  Fix H.264 4:4:4 lossless decoding.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 21:14:36 +02:00
Michael Niedermayer
082b4f8348 swscale: undo version upgrade that git merged in and that i missed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 06:26:38 +02:00
Michael Niedermayer
788c313b50 swscale: revert ABI breaking long->int chnage that touch public ABI
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 05:47:44 +02:00
Michael Niedermayer
779d7610c7 Merge branch 'master' into oldabi
* master: (109 commits)
  libx264: fix open gop default. Please use -x264opts to force open gop This fixes Ticket268
  avfilter picture pool: double free hotfix
  mpegaudio_parser: be less picky on the start position
  ppc32: Fix movrel
  Replace usages of av_get_bits_per_sample_fmt() with av_get_bytes_per_sample().
  x86: cabac: fix register constraints for 32-bit mode
  cabac: move x86 asm to libavcodec/x86/cabac.h
  x86: h264: cast pointers to intptr_t rather than int
  x86: h264: remove hardcoded edi in decode_significance_8x8_x86()
  x86: h264: remove hardcoded esi in decode_significance[_8x8]_x86()
  x86: h264: remove hardcoded edx in decode_significance[_8x8]_x86()
  x86: h264: remove hardcoded eax in decode_significance[_8x8]_x86()
  x86: cabac: change 'a' constraint to 'r' in get_cabac_inline()
  x86: cabac: remove hardcoded esi in get_cabac_inline()
  x86: cabac: remove hardcoded edx in get_cabac_inline()
  x86: cabac: remove unused macro parameter
  x86: cabac: remove hardcoded ebx in inline asm
  x86: cabac: remove hardcoded struct offsets from inline asm
  cabac: remove inline asm under #if 0
  cabac: remove BRANCHLESS_CABAC_DECODER switch
  ...

Conflicts:
	cmdutils.c
	ffserver.c
	libavfilter/avfilter.h
	libavformat/avformat.h
	libavformat/utils.c
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 05:27:44 +02:00
Michael Niedermayer
56629aa012 Merge branch 'master' into oldabi
* master:
  mmsh: fixed printf injection bug in mmsh request
  ac3enc: use correct alignment and length in channel coupling dsp functions.
  ffmpeg: don't abuse a global for passing framerate from input to output
  ffmpeg: don't abuse a global for passing channels from input to output
  ffmpeg: don't abuse a global for passing samplerate from input to output
  Make buffer size check consistent and avoid a possible overflow.
  Fix spelling.
  Full support for sending H.264 in RTP
  ARM: update ff_h264_idct8_add4_neon for 4:4:4 changes
  swscale: use SwsContext for av_log when available
  Support reading chan atoms with empty channel descriptions.
  Reindent after last commit.
  Fix multi-channel AAC encoding.
  Fix "redundant redeclaration" warning.
  Fix compilation with --disable-everything --enable-encoder=ac3/ac3_fixed.
  vf_mp: Fix large memleak.
  swscale: Remove HAVE_MMX from files that are only compiled with MMX enabled.
  swscale: Fix compilation with --disable-mmx2.
  mjpegenc: Fix JFIF version
  swscale: remove misplaced comment.
  ffmpeg: fix streaming to ffserver.
  swscale: split out RGB48 output functions from yuv2packed[12X]_c().
  build: move vpath directives to main Makefile
  swscale: fix JPEG-range YUV scaling artifacts.
  build: move ALLFFLIBS to a more logical place
  ARM: factor some repetitive code into macros
  CrystalHD: Use mp4toannexb bitstream filter.
  CrystalHD: Keep mp4toannexb filter around for entire decoder lifetime.
  Fix SVQ3 after adding 4:4:4 H.264 support
  H.264: fix CODEC_FLAG_GRAY
  4:4:4 H.264 decoding support
  matroskadec: properly decode color space in an endian neutral way
  matroskadec: use a temporary fourcc variable
  matroskaenc: ensure the written colorspace don't depend on host endianness
  ac3enc: fix allocation of floating point samples.
  utils: Drop pointless '#if 1' preprocessor directive.
  ac3enc: remove empty ac3_float function that is never called
  ac3enc: split templated float vs. fixed functions into a separate file.
  ac3enc: dynamically allocate AC3EncodeContext fields windowed_samples and mdct
  ac3enc: use function pointer to choose between AC-3 and E-AC-3 header output functions.
  Roll back 4:4:4 H.264 for now Needs some ARM/PPC asm modifications.
  Fix SVQ3 after adding 4:4:4 H.264 support
  H.264: fix CODEC_FLAG_GRAY
  4:4:4 H.264 decoding support
  h264_parser: Fix whitespace after previous change.
  h264_parser: Fix behaviour when PARSER_FLAG_COMPLETE_FRAMES is set.
  wav: remove an invalid free().
  lavf: initialise reference_dts in av_estimate_timings_from_pts.
  h264: don't be so picky on decoding pps in extradata.
  avcodec.h: add or elaborate on some documentation comments.
  h264: change a few comments into error messages
  ac3dec: fix doxy-style for comment ("///>" should be "///<" instead).
  img2: add .dpx to the list of supported file extensions.
  ffv1: fix undefined behavior with insane widths.
  replace remaining usage of deprecated av_metadata_set2() by av_dict_set()
  matroskaenc: write colourspace element for rawvideo tracks
  nsv: simplify probe function
  nsv: return error code instead of discarding it in read_header()
  ARM: jrevdct_arm: simplify stack usage
  ARM: jrevdct_arm: use push/pop mnemonics
  ARM: jrevdct_arm: misc cleanup
  ARM: optimised mpadsp_apply_window_fixed
  Add some (important) changelog entries
  H264: Reduce pointless diffs to qatar
  Revert "H264: Split out hl_motion and template it, this seems a bit faster"
  libavfilter: implement avfilter_fill_frame_from_video_buffer_ref()
  avfiltergraph: make the AVFilterInOut alloc/free API public
  avfiltergraph: change the syntax of avfilter_graph_parse()
  graphparser: prefer void * over AVClass * for log contexts
  h264: Complexify frame num gap shortening code
  Update todo
  mpeg12: replace 2 asserts by av_assert0
  cmdutils: add missing NULL check in parse_options()
  x11grab: remove a memory allocation and the associated memcpy.
  Fix --disable-everything
  build: fix "make install" with documentation disabled
  build: simplify some conditional targets
  resample: clarify supported resampling.
  lavfi: fix signature for avfilter_graph_parse() and avfilter_graph_config()
  avfiltergraph: use meaningful error codes
  Revert "ac3: there was no libav in 2010 thus this code cannot be from  libav."
  Fix -t option for formats which holds dts and no pts
  dnxhd: Renama tables
  Extract rotation in MOV metadata
  bitstream: Properly promote av_reverse values before shifting.
  pixfmt: Replace 9/10bit deprecation by a technical explanation.
  libavutil/swscale: YUV444P10/YUV444P9 support.
  H.264: Fix high bit depth explicit biweight
  h264: Fix 10-bit H.264 x86 chroma v loopfilter asm.
  Replace DEBUG_SEEK/DEBUG_SI + av_log combinations by av_dlog.
  Update copyright year for ac3enc_opts_template.c.
  adts: Adjust frame size mask to follow the specification.
  APIchanges: fill hash for the avfilter_get_audio_buffer_ref_from_arrays addition
  lavfi: avfilter_merge_formats: handle case where inputs are same
  lavfi: use avfilter_get_audio_buffer_ref_from_arrays() in defaults.c
  lavfi: implement avfilter_get_audio_buffer_ref_from_arrays()
  APIchanges: remove duplicated entry
  APIchanges: fill in dates and numbers
  APIchanges: remove duplicated entry
  APIchanges: correctly interleave entries
  APIchanges: add entry for av_force_cpu_flags() addition
  lavf: bump minor after the addition of fps_probe_size to AVFormatContext
  lavc: bump minor after the addition of AVCodecContext.request_sample_fmt
  movenc: Add RTP muxer/hinter options
  movenc: Pass the RTP AVFormatContext to the SDP generation
  rtspenc: Add RTP muxer options
  rtspenc: Add an AVClass for setting muxer specific options
  rtpenc_chain: Pass the rtpflags options through to the chained muxer
  rtpenc: Declare the rtp flags private AVOptions in rtpenc.h
  sdp: Reindent after the previous commit
  rtpenc: MP4A-LATM payload support
  avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
  sdp: Allow passing an AVFormatContext to the SDP generation
  mov: Fix wrong timestamp generation for fragmented movies that have time offset caused by the first edit list entry.
  mpeg12: more advanced ffmpeg mpeg2 aspect guessing code.
  ac3: there was no libav in 2010 thus this code cannot be from  libav.
  swscale: split YUYV output out of yuv2packed[12X]_c().
  dict: This code was developed in ffmpeg and not libav, nor by libav developers. Correct copyright notices.
  lavf: make compute_pkt_fields2() return meaningful error values
  matroskadec: set timestamps for RealAudio packets.
  intelh263dec: aspect ratio processing fix.
  intelh263dec: fix "Strict H.263 compliance"  file playback
  oss,sndio: simplify by using FFMIN.
  swscale: extract monowhite/black output from yuv2packed[12X]_c().
  swscale: de-macro'ify RGB15/16/32 input functions.
  swscale: rearrange code.
  movdec: Add support for the 'wfex' atom.
  ffmpeg.c: Add a necessary const qualifier
  riff: Fix potential memleak.
  swscale: change 48bit RGB input macros to inline functions.
  swscale: change 9/10bit YUV input macros to inline functions.
  swscale: extract gray16 output functions from yuv2packed[12X]().
  swscale: use standard clipping functions.
  swscale: merge macros that are used only once.
  swscale: fix function declarations in swscale.c.
  swscale: fix function declaration keywords in x86/swscale_template.c.
  jpegdec: actually search for and parse RSTn
  crypto: Use av_freep instead of av_free
  Revert "crypto: fix potential double free"
  Revert "build: remove empty $(OBJS) target"
  crypto: Use av_freep instead of av_free
  aac: fix adts frame size mask, fix demuxer probing for some files.
  lavf: don't try to free private options if priv_data is NULL.
  lavfi: handle NULL lists in avfilter_make_format_list
  swscale: fix types of assembly arguments.
  swscale: move two macros that are only used once into caller.
  swscale: remove unused function.
  Fix "mixed declarations and code" warnings.
  options: Add missing braces around struct initializer.
  mov: Remove leftover crufty debug statement with references to a local file.
  dvbsubdec: Fix compilation of debug code.
  Remove all uses of now deprecated metadata functions.
  Move metadata API from lavf to lavu.
  crypto: fix potential double free
  libx264: fix double free
  ffplay: remove -debug option
  ffplay: remove -vismv option
  mpegvideo: use av_get_picture_type_char() in ff_print_debug_info()
  Remove some non-compiling debug messages.
  ffplay: Fix non-compiling debug printf and replace it by av_dlog.
  H264: x86 predict init cosmetics.
  ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
  Move E-AC-3 encoder functions to a separate eac3enc.c file.
  ac3enc: remove convenience macro, #define DEBUG
  ac3enc: remove unused #define
  vc1: re-initialize tables after width/height change.
  APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition
  samplefmt: add av_get_bytes_per_sample()
  libvpxenc: add forgotten AVClass.
  iirfilter: fix biquad filter coefficients.
  swscale: remove duplicate conversion routine in swScale().
  swscale: add yuv2planar/packed function typedefs.
  swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
  swscale: reindent x86 init code.
  swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
  swscale: cosmetics.
  swscale: remove alp/chr/lumSrcOffset.
  swscale: un-special-case yuv2yuvX16_c().
  shorten: Remove stray DEBUG #define and corresponding av_dlog statement.
  vorbisdec: Restore mistakenly removed debug output.
  v4l2: set default standard to NULL
  sws: make dither_scale const
  configure: Document --enable-vdpau.
  Replace some av_log/printf + #ifdef combinations by av_dlog.
  Replace some nonstandard DEBUG_* preprocessor directives by plain DEBUG.
  svq1dec: Fix debug statements that referenced non-existing context.
  Replace some printf instances in debug code by av_log.
  showfiltfmts: use av_get_pix_fmt_name()
  inverse.c: Replace unnecessary intmath.h header by necessary stdint.h.
  Drop unnecessary directory prefixes from #include directives.
  Makefile: critical build fix after the merge. make fate passed locally due to ffmpeg/ffmpeg_g being there from before
  ffplay: Fix -vismv
  mem: Trying to workaround posix_memalign() bug on OSX
  build: remove empty $(OBJS) target
  build: make rule for linking ff* apply only to these targets
  eval: add support for pow() function
  build: rearrange some lines in a more logical way
  s302m: fix resampling for 16 and 24bits.
  ARM: remove MUL64 and MAC64 inline asm
  build: clean up .PHONY lists
  build: move all (un)install* target aliases to toplevel Makefile
  flvenc: propagate error properly
  build: remove stale dependency
  build: do not add CFLAGS-yes to CFLAGS
  utils.c: fix crash with threading enabled.
  configure: simplify source_path setup
  configure: remove --source-path option
  pixdesc: remove duplicated header inclusion
  lavfi: use av_samples_alloc() in avfilter_default_get_audio_buffer()
  lavfi: prefer nb_samples over size in AVFilterBufferRefAudioProps
  samplefmt: switch nb_channels/nb_samples params order in av_samples_alloc()
  samplefmt: change layout for arrays created by av_samples_alloc() and _fill_arrays()
  lavf: deprecate AVFormatParameters.time_base.
  img2: add framerate private option.
  img2: add video_size private option.
  img2: add pixel_format private option.
  tty: add framerate private option.
  Move code for "ffmpeg: fix massive leak occurring when seeking" / e4841a404b elsewhere
  lavf: remove reference to output-example in Makefile
  vsrc_buffer: add flags param to av_vsrc_buffer_add_video_buffer_ref
  Remove some unused scripts from tools/.
  Add x86 assembly for some 10-bit H.264 intra predict functions.
  v4l2: do not force NTSC as standard
  Add const to avfilter_get_video_buffer_ref_from_arrays arguments.
  Skip tableprint.h during 'make checkheaders'.
  Remove unnecessary LIBAVFORMAT_BUILD #ifdef.
  Drop explicit filenames from @file Doxygen tags.
  Skip generated table headers during 'make checkheaders'.
  lavf,lavc: free avoptions in a generic way.
  AVOptions: add av_opt_free convenience function.
  sdl: align option fields after last commit
  ffmpeg: fix massive leak occurring when seeking
  ffprobe: implement -i FILE option
  tableprint: Restore mistakenly deleted common.h #include for FF_ARRAY_ELEMS.
  ffplay.texi: document -i FILE option
  cmdutils: remove unnecessary OPT_DUMMY implementation
  cmdutils: change the signature of the function argument in parse_options()
  sdl: use the filename for defining the window title, if not specified
  tiff: print log in case of unknown / unsupported tag.
  tiff: fix linesize for mono-white/black formats.
  Fix build of eval-test program
  configure: Document --enable-vaapi
  swscale: override the lack of the accurate rounding flag when needed for dither.
  swscale: factor should_dither out
  ac3enc: extract all exponents for the frame at once
  ARM: remove MULL inline asm
  mathops: use MUL64 macro where it forms part of other ops
  tty: factorise returning error codes.
  rawdec: add framerate private option.
  x11grab: add framerate private option.
  fbdev,v4l2: remove some forgotten uses of AVFormatParameters.time_base.
  bktr: don't error when AVFormatParameters.time_base isn't set.
  cmdutils: add missing const qualifier
  Skip headers not designed to work standalone during 'make checkheaders'.
  Add missing #includes to make headers self-contained.
  musepack: remove unnecessary #include from mpcdata.h
  musepack: remove extraneous mpcdata.h inclusions
  Fix error check in av_file_map()
  udp: support old, crappy non pthread mode
  ffmpeg: use opt_acodec when setting audio codec in opt_target.
  ffmpeg: fix segfault with too many output files
  ffplay: error out with invalid sample rate or channels.
  oggdec: fix Ticket185
  build: simplify commands for clean target
  j2kdec: dont fail on non zero cblock style.
  makefile: fix j2k encoder dependancies
  udp: fix indention
  swscale: split swscale.c in unscaled and generic conversion routines.
  swscale: cosmetics.
  swscale: integrate (literally) swscale_template.c in swscale.c.
  swscale: split out x86/swscale_template.c from swscale.c.
  swscale: enable hScale_altivec_real.
  swscale: split out ppc _template.c files from main swscale.c.
  swscale: remove indirections in ppc/swscale_template.c.
  swscale: split out unscaled altivec YUV converters in their own file.
  mpegvideoenc: fix multislice fate tests with threading disabled.
  cmdutils: move "#undef main" from ffplay.c to cmdutils.h
  wav: update size check for ds64
  wav: fix skip size at end of ds64 chunk
  mpegts: Wrap #ifdef DEBUG and av_hex_dump_log() combination in a macro.
  build: Simplify texi2html invocation through the --output option.
  Mark some variables with av_unused
  Replace avcodec_get_pix_fmt_name() by av_get_pix_fmt_name().
  svq3: Check negative mb_type to fix potential crash.
  svq3: Move svq3-specific fields to their own context.
  rawdec: initialize return value to 0.
  Remove unused get_psnr() prototype
  rawdec: don't leak option strings.
  bktr: get default framerate from video standard.
  swscale: remove unused COMPILE_TEMPLATE_ALTIVEC.
  h264 fill_filter_caches: Dont init chroma nnz_cache.
  In print_report, print progression time in hours:mins:secs:us
  ffmpeg: In print_report, use int64_t for pts to check for 0 and avoid inf value for bitrate.
  In libswscale, use all lines when converting from 422p to rgb with mmx, improve quality.
  Replace custom DEBUG preprocessor trickery by the standard one.
  vorbis: Remove non-compiling debug statement.
  vorbis: Remove pointless DEBUG #ifdef around debug output macros.
  cook: Remove non-compiling debug output.
  Remove pointless #ifdefs around function declarations in a header.
  Replace #ifdef + av_log() combinations by av_dlog().
  Replace custom debug output functions by av_dlog().
  cook: Remove unused debug functions.
  lavfi: add avfilter_link_free() function
  swscale: reintroduce sws_format_name() symbol
  Remove stray extra arguments from av_dlog() invocations.
  targa: fix big-endian build
  v4l2: remove one forgotten use of AVFormatParameters.pix_fmt.
  vfwcap: add a framerate private option.
  v4l2: add a framerate private option.
  libdc1394: add a framerate private option.
  fbdev: add a framerate private option.
  bktr: add a framerate private option.
  oma: check avio_read() return value
  nutdec: remove unused variable
  Remove unused variables
  swscale: dither for planar yuv outputs
  swscale: Fix use of uninitialized values (bug probably introduced from a marge of libav)
  cpudetect: add av_force_cpu_flags()
  swscale: allocate larger buffer to handle altivec overreads.
  H264/MPEG frame-level multi-threading.
  vsrc_buffer: propagate error code in av_vsrc_buffer_add_frame()
  lavfi: reindent after the previous commit
  lavfi: add braces around the block of an if() expression in avfilter_default_get_video_buffer
  lavfi: clarify the context of a comment in avfilter_default_get_video_buffer()
  lavfi: apply misc style fixes
  Cosmetic changes to h264_idct_10bit.asm.
  2x faster h264_idct_add8_10.
  aacenc: Add stereo_mode option.
  h264: remove CONFIG_GPL from x86 intra prediction code.
  doc: cosmetics: libx264 typos
  postprocess: Remove test for impossible condition (was: Re: postprocess.c: replace check for p==NULL with *p==0)
  Fix various uninitialized variable warnings
  Port remove of get_sws_cpuflags from MPlayer's libmpcodecs.
  Replace "vector const" by "const vector" otherwise gcc 4.6.0 fails.
  Port recent changes to MPlayer libmpcodecs.
  Replace non-existent HAVE_SSE2 with HAVE_SSE.
  Simplify code and avoid compiler warning about incompatible types.
  Fix type of out[] variable, it should not be const.
  ARM: ac3dsp: optimised update_bap_counts()
  mpegaudiodec: Fix av_dlog() invocation.
  swscale: fix compilation of bfin due to missing pixdesc.h header
  lavf: tag dump_format() as @deprecated
  yuv4mpeg: complain and exit if a non-rawvideo stream is selected
  ffmpeg: handle copy of packets for AVFMT_RAWPICTURE output formats
  doc/examples: give meaningful names to the example files
  h264/10bit: add HAVE_ALIGNED_STACK checks.
  swscale: More accurate rounding in YSCALE_YUV_2_PACKEDX_FULL_C()
  Update 8-bit H.264 IDCT function names to reflect bit-depth.
  Add IDCT functions for 10-bit H.264.
  mpegaudioenc: Fix broken av_dlog statement.
  Employ correct printf format specifiers, mostly in debug output.
  ARM: fix MUL64 inline asm for pre-armv6
  doc: add libvpx encoder section
  vf_drawtext: Replace FFmpeg by Libav in license boilerplate.
  mpegaudiodec: remove unusued code and variables
  postprocess.c: filter name needs to be double 0 terminated
  improved 'edts' atom writing support
  mpegaudio: clean up compute_antialias() definition
  vp8: fix segmentation race during frame-threading.
  Port libmpcodec fixes from MPlayer.
  Merge remote-tracking branch 'ffmpeg-mt/master'
  swscale: Remove unused variable.
  ARM: simplify inline asm with 64-bit operands
  Add "const" to avoid "initialization discards qualifiers" warning.
  Add const to fix "cast discards qualifiers" warnings.
  Include pixdesc.h for av_get_pix_fmt_name.
  wav: Don't avio_seek() if we know we'll run into EOF
  api-example: uppercase first letter in "copyright"
  output-example: create @file doxy from text in the copyright header
  examples: move API examples to a dedicated dir in doc
  ffmpeg: simplify opt_*_codec() options
  v4l2: rewrite code iterating the supported standards
  v4l2: perform minor style fixes
  v4l2: replace memset() with explicit struct initialization
  rawdec: fail in case of unknow pixel format
  swscale: remove sws_format_name()
  error.c: fix compile flags
  TCP: change default timeout to 5sec
  Revert "Timeout TCP open() after 5 seconds."
  Fix various unused variable warnings
  Fix various bad printf format warnings
  ARM: enable UAL syntax in asm.S
  Remove now unused nb_istreams variable.
  Add const to vector types for input in altivec code.
  Remove unused variable, avoiding compiler warning.
  Cast pointers to uintptr_t rather than unsigned int.
  v4l2: don't leak video standard string on error.
  swscale: Remove disabled code.
  avfilter: Surround function only used in debug mode by appropriate #ifdef.
  vf_crop: Replace #ifdef DEBUG + av_log() by av_dlog().
  build: remove BUILD_ROOT variable
  vp8: use av_clip_uintp2() where possible
  swscale: Commits that could not be pulled earlier due to bugs #2
  Commits that could not be pulled earlier due to bugs.
  Revert 1a5e4fd8c5 for postproc. This broke the code
  doc: correct AC-3 option subsection placement
  ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
  ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
  swscale: use av_clip_uint8() in yuv2yuv1_c().
  swscale: replace formatConvBuffer[VOF] by allocated array.
  v4l2: create file @doxy from text in the copyright header
  v4l2: remove pointless empty lines
  v4l2: set default standard to NULL
  v4l2: use OFFSET macro when setting options
  ac3dsp: fix loop condition in ac3_update_bap_counts_c()
  ARM: unbreak build
  lavdev: add SDL output device
  ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
  ac3enc: split mantissa bit counting into a separate function.
  ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
  lavu: add av_get_pix_fmt_name() convenience function
  iff: remove duplicated file description
  cmdutils: remove OPT_FUNC2
  get_bits: add av_unused tag to cache variable
  sws: replace all long with int.
  ARM: aacdec: fix constraints on inline asm
  ARM: remove unnecessary volatile from inline asm
  ARM: add "cc" clobbers to inline asm where needed
  ARM: improve FASTDIV asm
  ac3enc: use LOCAL_ALIGNED macro
  APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
  lavu: add av_get_pix_fmt_name() convenience function
  cmdutils: remove OPT_FUNC2
  swscale: fix crash in bilinear scaling.
  vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
  webm: support stereo videos in matroska/webm muxer
  rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
  swscale: reindent h[cy]scale_fast() and updateDitherTables().
  swscale: reformat x86/swscale_template.c.
  swscale: remove duplicate mmx/mmx2 functions if they are identical.
  swscale: remove if (c->dstFormat) branch from yuv2packed[12X]().
  swscale: remove if(full_chr_int) from yuv2packed1().
  swscale: remove if(accurate_rnd) branch from functions.
  swscale: revive SWS_CPU_CAPS until next major bump.
  swscale: Remove commented-out printf cruft.
  Export PCR pid
  Export more transport stream information.
  Output MPEG-TS stream identifiers.
  lavf: deprecate AVFormatParameters.pix_fmt.
  rawdec: add a pixel_format private option.
  v4l2: add a pixel_format private option.
  libdc1394: add a pixel_format private option.
  cosmetics: indentation and alignment after previous commit
  ac3enc: add support for E-AC-3 encoding.
  ac3enc: Move AC-3 AVOptions array to a separate file to make it easier to use only selected options for the different AC-3 encoder types.
  ARM: disable ff_vector_fmul_vfp on VFPv3 systems
  ARM: check for VFPv3
  swscale: Remove unused variables in x86 code.
  doc: Drop DJGPP section, Libav now compiles out-of-the-box on FreeDOS.
  x86: Add appropriate ifdefs around certain AVX functions.
  cmdutils: use sws_freeContext() instead of av_freep().
  swscale: delay allocation of formatConvBuffer().
  swscale: fix build with --disable-swscale-alpha.
  movenc: Deprecate the global RTP hinting flag, use a private AVOption instead
  movenc: Add an AVClass for setting muxer specific options
  libdc1394: choose best video mode and rate based on camera capabilities.
  Remove support for libdc1394 < 2.0.
  avopt: fix segfault
  swscale: fix non-bitexact yuv2yuv[X2]() MMX/MMX2 functions.
  swscale: dont loose precission on RGB/BGR48 input, that is dont drop half the bits.
  patch checklist: suggest --disable-yasm test.
  lavdev: prefer the inclusion of avdevice.h over that of libavformat/avformat.h
  lavdev: include libavformat/avformat.h in avdevice.h
  fate.txt: replace FATE rsync command with a make command
  configure: report yasm/nasm presence properly
  tcp: make connect() timeout properly
  rawdec: factor video demuxer definitions into a macro.
  rtspdec: add initial_pause private option.
  lavf: deprecate AVFormatParameters.width/height.
  tty: add video_size private option.
  rawdec: add video_size private option.
  x11grab: add video_size private option.
  x11grab: factorize returning error codes.
  vfwcap: add video_size private option.
  v4l2: add video_size private option.
  v4l2: factorize returning error codes.
  libdc1394: add video_size private option.
  libdc1394: return meaninful error codes.
  bktr: add video_size private option.
  bktr: factorize returning error codes.
  Fix memleak
  Fix typo
  Remove specific note when not specific
  Minor cleanup in libx264.c
  Add metadata conversion table to the wav demuxer
  Fix 32bit rawvideo in avi on big-endian.
  id3v2: Check malloc result. ID3v2 tags can be very large.
  id3v2: Initialize tflags for version 2.2.
  webm: Additional options/presets for VP8 encodes under FFmpeg
  muxers: Add a flag to mark muxers that allow (non strict) monotone timestamps.
  swscale: Do not loose precission on yuv values after rgb->yuv.
  libx264: support aspect Ratio Switch
  ARM: add ARMv6 optimised av_clip_uintp2
  ARM: remove volatile from asm statements in libavutil/intmath
  ARM: fix av_clipl_int32_arm()
  v4l: include avdevice.h
  ffserver: move close_connection() call to avoid a temporary string and copy.
  lavf: initialize demuxer private options.
  AVOptions: set string default values.
  Fix compilation with YASM/NASM versions not supporting AVX.
  lavdevice: mark v4l for removal on next major bump.
  swscale: fix compile on ppc.
  swscale: fix compile on x86-32.
  build: Remove generated .version file on distclean.
  configure: Add -D_GNU_SOURCE to CPPFLAGS on OS/2.
  doc: Drop hint at --enable-memalign-hack for MinGW, it is now autodetected.
  ffplay: Remove disabled code.
  Mark parameterless function declarations as 'void'.
  swscale: use av_clip_uint8() in yuv2yuv1_c().
  swscale: remove VOF/VOFW.
  swscale: split chroma buffers into separate U/V planes.
  swscale: replace formatConvBuffer[VOF] by allocated array.
  rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
  swscale: reindent h[cy]scale_fast() and updateDitherTables().
  swscale: reformat x86/swscale_template.c.
  swscale: remove duplicate mmx/mmx2 functions if they are identical.
  swscale: remove if (c->dstFormat) branch from yuv2packed[12X]().
  swscale: remove if(full_chr_int) from yuv2packed1().
  swscale: remove if(accurate_rnd) branch from functions.
  ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.
  libdc1394: fix compilation.
  swscale: revive SWS_CPU_CAPS until next major bump.
  swscale: Remove commented-out printf cruft.
  ac3enc: initialize all coefficients to zero.
  ffv1: fix 16bits multithreading
  doc: create separate section for audio encoders
  swscale: Remove orphaned, commented-out function declaration.
  swscale: Eliminate rgb24toyv12_c() duplication.
  mpegvideo_enc: use AV_LOG_ERROR instead of AV_LOG_INFO for two error messages
  Fail when lowres value is lower than 0
  Remove h263_msmpeg4 from MpegEncContext.
  APIchanges: Fill in git hash for fps_probe_size (30315a8)
  avformat: Add fpsprobesize as an AVOption.
  swscale: document SWS_CPU_CAPS*
  Revert removial of SWS flags from e66149e714
  avoptions: Return explicitly NAN or {0,0} if the option isn't found
  rtmp: Reindent
  rtmp: Don't try to do av_malloc(0)
  swscale: remove duplicatiopn of rgb24toyv12_c()
  Return -1 on invalid input instead of crashing.
  vf_mp: fix name of the remove-logo filter referenced in filters.texi
  tty: replace AVFormatParameters.sample_rate abuse with a private option.
  Fix end time of last chapter in compute_chapters_end
  ffmpeg: get rid of useless AVInputStream.nb_streams.
  ffmpeg: simplify managing input files and streams
  ffmpeg: purge redundant AVInputStream.index.
  lavf: deprecate AVFormatParameters.channel.
  libdc1394: add a private option for channel.
  dv1394: add a private option for channel.
  v4l2: reindent.
  v4l2: add a private option for channel.
  lavf: deprecate AVFormatParameters.standard.
  v4l2: add a private option for video standard.
  v4l: add a private option for video standard.
  dv1394: add a private option for video standard.
  bktr: add a private option for video standard.
  lavf: deprecate AVFormatParameters.{channels,sample_rate}.
  rawdec: add sample_rate/channels private options.
  ALSA: add channels and sample_rate private options.
  oss: add channels and sample_rate private options.
  sndio: add channels and sample_rate private options.
  lavf: deprecate AVFormatParameters.mpeg2ts_raw.
  mpegts: add compute_pcr option.
  lavf: add priv_class field to AVInputFormat.
  lavfi: add select filter
  eval: implement not() expression
  vsrc_buffer: return an error code if no frames are available
  ffmpeg: handle the case when get_filtered_frame() fails
  indeo3: add out-of-buffer write check
  Add reading of disc number to mov.c
  Fix end time of last chapter in compute_chapters_end().
  Do not reset channel_layout to 0.
  vsrc_buffer: remove duplicated file description
  Merge swscale bloatup This will be cleaned up in the next merge
  swscale: MMX optim of hscale16()
  swscale: dont loose bits on planar >8bit yuv ind gray nput.
  swscale: Switch to ronalds yuv2yuvX16inC_template() its very similar to baptsites and supports alpha
  configure: enable memalign_hack automatically when needed
  rawdec: fix decoding of QT WRAW files
  matroska: improve declaration of video_stereo_* constant tables
  matroskadec: fix reverted condition to accept combine_plane operation
  Fix register types for LOAD_AB arguments, fixes compilation with NASM.
  swscale: unbreak the build on non-x86 systems.
  swscale: remove if(bitexact) branch from functions.
  swscale: remove if(canMMX2BeUsed) conditional.
  swscale: remove swScale_{c,MMX,MMX2} duplication.
  swscale: use emms_c().
  Move emms_c() from libavcodec to libavutil.
  tiff: set palette in the context when specified in TIFF_PAL tag
  rtsp: use strtoul to parse rtptime and seq values.
  pgssubdec: fix incorrect colors.
  dvdsubdec: fix incorrect colors.
  ape: Allow demuxing of files with metadata tags.
  swscale: remove dead macro WRITEBGR24OLD.
  swscale: remove AMD3DNOW "optimizations".
  swscale: remove duplicate code in ppc/ subdirectory.
  swscale: remove duplicated x86/ functions.
  swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*.
  vsrc_buffer.h: add file doxy
  vsrc_buffer: tweak error message in init()
  wav: fix various printf warnings related to wrong argument type
  wav: propagate ff_get_wav_header() error code in w64_read_header()
  msmpeg4: reindent.
  lavc: remove msmpeg4v1 encoder.
  Remove avconfig.h and INCINSTDIRs on uninstall.
  ac3enc: add channel coupling support
  partial revert of 01d3ebaf21
  fate: reenable frext-pph10i4_panasonic_a after the bitstream has been fixed
  avcodec_find_decoder: prefer non experimental decoders.
  j2kdec: mark as CODEC_CAP_EXPERIMENTAL
  j2k[c/h] j2kdec.c: Implement 2 code block styles
  j2k: Add void as the parameter of function ff_j2k_init_tier1_luts
  Add Kamil Nowosads j2k code.
  matroska: cleanup handling of video stereo mode
  oggdec: use av_dlog()
  mem: define the MAX_MALLOC_SIZE constant and use it in place of INT_MAX
  configure: Add -U__STRICT_ANSI__ to CPPFLAGS on Cygwin and DOS.
  muxers.texi changes for mkv/webm options
  aacdec: fix typo in scalefactor clipping check
  mpegaudio: Correct license header
  add 5.1 to stereo downmix to resample.c this is based on previous 6to2channel-resample.patch from ffmpeg2theora but updated to work with trunk and using av_clip_int16.
  fate: fix fate-h264-conformance-frext-pph10i4-panasonic-a crcs.
  fate: update 9/10bit refs.
  h264: Properly set coded_{width, height} when parsing H.264.
  x86 asm: Add SECTION_TEXT to dct32_sse.asm.
  Fix 9/10 bit in swscale.
  Do not ask for samples if a specific channel layout was requested.
  libx264: specify field for default union values in options
  movdec: dont divide by zero when stts_data[0].duration = 0.
  Fix ticket127
  dct32: Replacing libav by ffmpeg in the license header with the authors permission. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  ffmpeg: Don't trigger url_interrupt_cb on the first signal
  avoptions: Check the return value from av_get_number
  lavf: fix style for avformat_alloc_output_context2()
  lavf: deprecate avformat_alloc_output_context() in favor of avformat_alloc_output_context2()
  lavfi: make vsrc_buffer.h header public
  dct32_sse: eliminate some spills
  Fix compilation with --disable-yasm.
  Fix dct32() compilation with --disable-yasm
  mpeg2dec: Fix lowres 3
  lavfi: bump minor and add changelog entry after the split filter addition
  vf_split: add documentation to filters.texi
  vf_split: give more meaningful names to the output pads
  vf_split: define draw_slice() before end_frame()
  vf_split: add description
  vf_split: fix various nits
  wmadec: avoid infinit loop.
  DirectShow capture: Fix build
  ffmpeg: get rid of the -vglobal option.
  dct32: Add AVX implementation of 32-point DCT
  dct32: Change pass 6 permutation to allow for AVX implementation
  dct32: port SSE 32-point DCT to YASM
  matroska: switch stereo mode from int to string and add support in the demuxer too
  matroska: cosmetics
  Create a stereo_mode metadata tag to specify the stereo 3d video layout using the StereoMode tag in a matroska/webm video track.
  libavfilter: vf_split from soc.
  DirectShow capture support Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  multiple inclusion guard cleanup
  avio: document buffer must created with av_malloc() and friends
  avio: check AVIOContext malloc failure
  swscale: point out an alternative to sws_getContext
  svq3: Do initialization after parsing the extradata
  Fix channel_layout documentation.
  add changelog entries for 0.7_beta2
  ffserver: dont just crash
  fix ffserver's SIGSEGV
  avoptions: Support getting flag values using av_get_int
  preset dir for win32
  Merge remote-tracking branch 'ffmpeg-mt/master'
  Add a flag to disable side data merging.
  Merge/split side data.
  Encoding alac with more than two channels is not supported.
  mp3lame: add #include required for AV_RB32 macro.
  configure: make executable again
  LATM/AAC: Free previously initialized context on reinit.
  configure: Do not unconditionally add -Wall to host CFLAGS.
  configure: Set OS/2 objformat to a.out.
  Add support for a.out object format to assembler macros.
  fate: disable threading for encoding
  fate: add comment field
  fate: allow overriding default build and install dirs
  mpegtsenc: Add an AVClass pointer to the private data
  mpegaudio: clean up #includes
  mpegaudio: move all header parsing to mpegaudiodecheader.[ch]
  vf_libopencv: prefer opencv/cxcore.h over cxtypes.h
  decoders.texi: fix typos in rawvideo section
  cmdutils: use const AVClass * when senseful
  encoders.texi: add documentation for the libx264 encoder
  decoders.texi: add documentation for rawvideo decoder and options
  doc: add decoders.texi file
  encoders.texi: decrease level for audio encoders section
  ffprobe.texi: remove inclusion of muxers section
  indeo3: release buffer in indeo3_decode_end()
  indeo3: remove unnecessary includes
  indeo3: add @file doxy and a link to multimedia wiki documentation
  cmdutils: reset *picref_ptr to NULL in get_filtered_frame()
  ffmpeg: remove useless NULL-check on avfilter_unref_buffer
  libmp3lame: include "libavutil/intreadwrite.h" header
  qdm2: Use floating point synthesis filter.
  h264: correct border check.
  h264: fix loopfilter with threading at slice boundaries.
  Fix ff_mpa_synth_filter_fixed() prototype
  Reindent
  rtpenc_chain: Pass the MP4A_LATM flag to chained muxers
  rtpenc: MP4A-LATM payload support
  movenc: Pass AVFormatContext flags to the SDP generation
  sdp: Allow passing AVFormatContext flags to the SDP generation
  vsrc_buffer: document av_vsrc_buffer_add_video_buffer_ref()
  vsrc_buffer: add av_vsrc_buffer_add_frame()
  vsrc_buffer: fix example in docs, add mandatory parameters
  vsrc_buffer: make the source accept sws_param in init
  vsrc_buffer: propagate avfilter_open() error code
  vsrc_buffer: fix style
  lavfi: add avfilter_get_video_buffer_ref_from_frame to avcodec.h
  vsrc_buffer: remove dependency on AVFrame
  Rename costablegen.c ---> cos_tablegen.c.
  Collapse tableprint.c into tableprint.h.
  Simplify trig table rules
  Remove potentially unstable filenames from comments in generated files.
  Ignore generated tables and generated table generator programs.
  Simplify CLEANFILES make variable by using wildcards.
  Remove silly insults from avformat_version() Doxygen documentation.
  mpegaudiodsp: fix x86 and ppc makefiles
  configure: Adjust AVX assembler check.
  mpegaudio: remove unused version of SAME_HEADER_MASK
  mpegaudio: remove useless #undef at end of file
  asfdec: add missing #include for av_bswap32()
  mpegaudio: merge two #if CONFIG_FLOAT blocks
  mpegaudio: move some struct definitions from mpegaudio.h
  Move some mpegaudio functions to new mpegaudiodsp subsystem
  Clean up #includes in cmdutils.h.
  g729: Merge g729.h into g729dec.c.
  av_find_stream_info: Print more details about max anaylize duration failures.
  10l: wrap float_interleave functions in HAVE_YASM.
  Add little description for -rc_override
  APIchanges: fill in date and commit for request_sample_fmt
  Add floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
  Add support for request_sample_format in ffmpeg and ffplay.
  Add APIchanges entry for request_sample_fmt.
  Add request_sample_fmt field to AVCodecContext.
  Add float_interleave() to FmtConvertContext with x86-optimized versions.
  Remove unused make variable SEEK_REFFILE
  fate: remove redundant aref and vref references
  Parse 'bext' metadata in the wav demuxer
  Cosmetics: indent
  Keep parsing wav until EOF if the input is seekable and we know the size of the data tag
  Refactor the tag checking into a switch statement
  Use avio_tell() instead of url_ftell()
  add x264opts entry to docs
  cleaned up the udp.c, removed some variables and an av_log
  configure: favor pkg_config over sdl_config
  libx264: support passing arbitrary parameters.
  ffmpeg: dont show_banner() on verbose<0
  fate: remove do_ffmpeg_nocheck function
  fate: do not collect -benchmark output
  mpegaudiodec: remove decode_end() function
  fate: run aref and vref as regular tests
  mpegaudio: sanitise compute_antialias_* names
  mpeg12: add slice-threading checks to slice-threading initializers.
  h264: copy pixel_shift between slice threading contexts.
  mdec: enable frame-level multithreading.
  mdec.c: fix overread.
  id3v2: prevent unsigned integer overflow in ff_id3v2_parse()
  id3v2: add @file doxy and link to format documentation
  configure: opensolaris install is not compatible with ffmpeg, allow overriding it.
  Fix compilation of iirfilter-test.
  eval: opensolaris strtod() cannot handle 0x1234
  libx264: handle closed GOP codec flag
  lavf: remove duplicate assignment in avformat_alloc_context.
  lavf: use designated initializers for AVClasses.
  Make sure neither data_size nor sample_count is negative
  Refactor the 'fmt ' tag search and parsing
  flvdec: clenup debug code
  asfdec: fix possible overread on broken files.
  asfdec: do not fall back to binary/generic search
  asfdec: reindent after previous commit c7bd5ed
  asfdec: fallback to binary search internally
  mpegaudio: add _fixed suffix to some names
  Modify x86util.asm to ease transitioning to 10-bit H.264 assembly.
  ffmpeg: reset top_field_first in opt_input_file().
  dct: build dct32 as separate object files
  qdm2: include correct header for rdft
  Ogg demuxer: give meaningful error codes and warnings.
  update changelog with 9/10 bit H264 and FFV1 changes
  Add some forgotten const to function arguments in libavfilter & libavformat.
  Write channel_layout for multichannel aif files.
  Fix ff_mov_write_chan() so it can be used by other muxers.
  Fix some mov files with little endian audio (tickets 201 - 203).
  iff/8svx: redesign 8SVX demuxing and decoding for handling stereo samples correctly
  iff: compact code setting metadata tags
  iff: fix bitrate computation for compressed audio stream
  iff: distinguish fields for audio and video compression
  imgutils: introduce internal image_get_linesize() and use it
  imgutils: make av_image_get_linesize() return AVERROR(EINVAL) for invalid pixel formats
  drawtext: specify union type for setting default options
  drawtext: reindent after the previous commit
  drawtext: fix strftime() text expansion
  ffmpeg: fix -aspect cli option
  Restructure video filter implementation in ffmpeg.c.
  ffplay: remove audio_write_get_buf_size() forward declaration
  lavfi: print key-frame and picture type information in ff_dlog_ref()
  mathops: remove ancient confusing comment
  rawdec: Allow overriding top field first.
  ffmpeg: initialize input_codec array earlier.
  cmdutils: Allocate private decoder context if its not allocated yet.
  cws2fws: Improve error message wording.
  tools: Check the return value of write().
  mpegaudio: move OUT_FMT macro to mpegaudiodec.c
  mpegaudio: remove OUT_MIN/MAX macros
  Add missing #includes to mp3_header_(de)compress bsf
  dct: fix indentation
  dct: bypass table allocation for DCT_II of size 32
  pngdec: relax condition for setting monoblack pixel format
  h264dsp_mmx: Add #ifdefs around some mmxext functions on x86_64.
  Remove unused header mpegaudio3.h.
  Support decoding of 1bpp rawvideo in avi (ticket 205).
  Support decoding of 2bpp rawvideo in avi (ticket 206).
  Bump minor after adding a caf muxer.
  configure: another try on fixing osx/mingw SDL
  aacdec: Use float instead of int16_t for ltp_state to avoid needless rounding.
  av_picture_crop(): Support simple cases with packed pixels too.
  acelp: Remove unused gray_decode table.
  dfa: Remove unused variable.
  configure: Include AVX availability in summary output.
  rawdec: propagate pict_type information to the output frame
  showinfo: replace "CRC" by "checksum"
  showinfo: fix vertical align nit
  showinfo: fix computation of Adler checksum
  imgutils: generalize linesize computation for bitstream formats
  configure: use same CPPFLAGS in kFreeBSD as Linux

Conflicts:
	ffserver.c
	libavcodec/avcodec.h
	libavcodec/opt.h
	libavcodec/version.h
	libavdevice/avdevice.h
	libavfilter/avfilter.h
	libavformat/avformat.h
	libavformat/metadata.c
	libavformat/metadata.h
	libavformat/utils.c
	libavformat/version.h
	libavutil/avutil.h
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-16 06:29:01 +02:00
Michael Niedermayer
33651e3edf Revert "lavc: remove the FF_API_VIDEO_OLD cruft."
This reverts commit e89e5afdd0.

Conflicts:

	libavcodec/utils.c
	libavcodec/version.h

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-15 19:38:46 +02:00
Michael Niedermayer
d46aada5c2 Merge branch 'master' into oldabi
* master: (403 commits)
  Initial caf muxer.
  Support decoding of amr_nb and gsm in caf.
  Fix decoding of msrle samples with 1bpp.
  udp: remove resource.h inclusion, it breaks mingw compilation.
  ffmpeg: Allow seting and cycling through debug modes.
  Fix FSF address copy paste error in some license headers.
  Add an aac sample which uses LTP to fate-aac.
  ffmpeg: Help for interactive keys.
  UDP: dont use thread_t as truth value.
  swscale: fix compile on mingw32
  [PATCH] Update pixdesc_be fate refs after adding 9/10bit YUV420P formats.
  arm: properly mark external symbol call
  ffmpeg: Interactivity support. Try pressing +-hs.
  swscale: 10l forgot git add this change from ronald.
  AVFrame: only set parameters from AVCodecContext in decode_video*() when no frame reordering is used.
  avcodec_default_get_buffer: init picture parameters.
  swscale: properly inline bits/endianness in yuv2yuvX16inC().
  swscale: fix clipping of 9/10bit YUV420P.
  Add av_clip_uintp2() function
  Support more QT 1bpp rawvideo files.
  ...

Conflicts:
	libavcodec/flacenc.c
	libavcodec/h261dec.c
	libavcodec/h263dec.c
	libavcodec/mpeg12.c
	libavcodec/msrle.c
	libavcodec/options.c
	libavcodec/qpeg.c
	libavcodec/rv34.c
	libavcodec/svq1dec.c
	libavcodec/svq3.c
	libavcodec/vc1dec.c
	libavcodec/version.h
	libavfilter/avfilter.h
	libavformat/file.c
	libavformat/options.c
	libavformat/rtpproto.c
	libavformat/udp.c
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-15 19:18:02 +02:00
Michael Niedermayer
66b1f210c0 Revert "avio: Fix the deprecated fallback URL-prefixed open flags"
This reverts commit 5b81e29593.
2011-05-02 04:25:42 +02:00
Michael Niedermayer
d4b98d475f Merge commit '1a9f9f8' into oldabi
* commit '1a9f9f8': (98 commits)
  Do not drop packets with no valid ->pos set as e.g. DV-in-AVI produces.
  FFMPEG: support demuxer specific options. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  AVIDEC: use_odmc demuxer specific option. (mostly an exmaple for demuxer specific options) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVFAPI: demuxer specific options. (someone please add doxy) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  output_example: use avformat_alloc_output_context() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVFAPI: avformat_alloc_output_context() / simplify usage of muxers. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVF API: remove AVOutputFormat.set_parameters() the field is unused. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  CrystalHD: Add auto-detection of packed b-frame bug.
  lavc: remove disabled avcodec_decode_video() code
  Read the album_artist, grouping and lyrics metadata.
  In libx264 wrapper, change wpredp to a codec specific option.
  AMV: disable DR1 and don't override EMU_EDGE
  lavf: inspect more frames for fps when container time base is coarse
  Fix races in default av_log handler
  flashsv2enc: regression test. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vorbis: Replace sized int_fast integer types with plain int/unsigned.
  Remove disabled non-optimized code variants.
  bswap.h: Remove disabled code.
  Remove some disabled printf debug cruft.
  Replace more disabled printf() calls by av_dlog().
  ...

Conflicts:
	libavcodec/options.c
	libavcodec/qpeg.c
	libavfilter/avfilter.h
	libavformat/avformat.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-02 04:18:04 +02:00
Michael Niedermayer
8d8962ca3e Revert "lavc: remove FF_API_HURRY_UP cruft"
This reverts commit e7021c0ed5.
2011-05-02 04:10:59 +02:00
Michael Niedermayer
329559ae50 Revert "lavc: remove FF_API_RATE_EMU cruft"
This reverts commit 694c142434.
2011-05-02 04:10:51 +02:00
Michael Niedermayer
0b3a88fe15 Revert "lavc: remove FF_API_MB_Q cruft"
This reverts commit 6deae83e55.
2011-05-02 04:10:44 +02:00
Michael Niedermayer
563fe360c3 Merge commit 'd7e5aeb' into oldabi
* commit 'd7e5aeb': (24 commits)
  Fix runtime CPU detection in libswscale.
  ac3enc: correct the flipped sign in the ac3_fixed encoder
  Eliminate pointless '#if 1' statements without matching '#else'.
  Add AVX FFT implementation.
  Increase alignment of av_malloc() as needed by AVX ASM.
  Update x86inc.asm from x264 to allow AVX emulation using SSE and MMX.
  mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
  documentation: extend documentation for ffmpeg -aspect option
  APIChanges: update commit hashes for recent additions.
  lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums
  aac: add headers needed for log2f()
  lavc: remove FF_API_MB_Q cruft
  lavc: remove FF_API_RATE_EMU cruft
  lavc: remove FF_API_HURRY_UP cruft
  pad: make the filter parametric
  vsrc_movie: add key_frame and pict_type.
  vsrc_movie: fix leak in request_frame()
  lavfi: add key_frame and pict_type to AVFilterBufferRefVideo.
  vsrc_buffer: add sample_aspect_ratio fields to arguments.
  lavfi: add fieldorder filter
  ...

Conflicts:
	libavcodec/version.h
	libavfilter/avfilter.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-02 04:10:19 +02:00
Michael Niedermayer
73a502dd43 Merge branch 'master' into oldabi
* master: (37 commits)
  vsrc_buffer: 10l mixed up input & output sizes. (funnily this worked 99% of the time) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  Add MxPEG decoder
  Add support for picture_ptr field in MJpegDecodeContext
  Move MJPEG's input buffer preprocessing in separate public function
  Support reference picture defined by bitmask in MJPEG's SOS decoder
  DCA/DTA encoder
  vsrc_buffer: Reinit scale filter when an existing filter is used. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vsrc_buffer: set output timebase when output equalization is done Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vsrc_buffer: Set output size Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vsrc_buffer: fix NULL dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  bfi: store palette data in the context
  Fix issue1503, this fix may be incomplete we need more samples to know for sure. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  wmadec: prevent null pointer call. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  fraps: do not set avctx->pix_fmt to none in decode_init()
  graphparser: add a NULL check on the argument passed to strstr
  setdar: prefer "sar" over "par" in log info message
  fade: fix draw_slice() check on fade->factor value
  fade: make draw_slice() chroma check against planes 1 and 2
  lsws: prevent overflow in sws_init_context()
  ffplay: fix logic for selecting the show mode in case of missing video
  ...

Conflicts:
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-27 00:11:58 +02:00
multiple authors
ea189b77eb Revert removial of 3 files, this sliped through the last merge into oldabi because
the files where locally available during testing just not in git.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-27 00:03:39 +02:00
Michael Niedermayer
2ebd47841f Merge branch 'master' into oldabi
* master: (172 commits)
  Check mmap() return against correct value Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vorbisdec: Employ proper printf format specifiers for uint_fast32_t.
  Support fourcc MMJP.
  Support fourcc XVIX.
  Support fourcc M263.
  Support fourcc auv2.
  Fix indentation.
  Support PARSER_FLAG_COMPLETE_FRAMES for h261 and h263 parsers.
  ffplay: avoid SIGFPE exception in SDL_DisplayYUVOverlay
  avi: try to synchronize the points in time of the starts of streams after seeking. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  Add flag to force demuxers to sort more strictly by dts. This enables non interleaved AVI mode for example. Players that are picky on strict interleaving can set this. Patches to only switch to non intereaved AVI mode when the index is not strictly correctly interleaved are welcome. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  applehttp: Don't export variant_bitrate if it isn't known
  crypto: Use av_freep instead of av_free
  CrystalHD: Add AVOption to configure hardware downscaling.
  Check for malloc failures in fraps decoder.
  Use av_fast_malloc instead of av_realloc in fraps decoder.
  general.texi: document libcelt decoder.
  Fix some passing argument from incompatible pointer type warnings. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  configure: Add missing libm library dependencies to .pc files.
  oggdec: reindent after 8f3eebd6
  ...

Conflicts:
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-25 03:49:47 +02:00
Michael Niedermayer
9d7244c4c6 Typo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-19 11:50:32 +02:00
Michael Niedermayer
7aee089978 Merge branch 'master' into oldabi
* master: (22 commits)
  ffmpeg:Daemon mode, add -d as first option to try it. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  ffmpeg:Fix negative verbositiy Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  Include authorship information from ffmpeg-mt at Ronald S. Bultjes request.
  In mov and flv muxer, check aac bitstream validity.
  Added key_frame and pict_type to vsrc_movie
  Allow h264pred_init_arm.c to compile.
  anm decoder: move buffer allocation from decode_init() to decode_frame()
  vsrc_movie: fix leak in request_frame()
  Replace mplayerhq.hu URLs by libav.org.
  asfdec: Remove dead code from asf_read_close().
  ptx: Use av_log_ask_for_sample() where appropriate.
  Merge remote-tracking branch 'ffmpeg-mt/master'
  10l, commit that should have been stashed into the merge. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  Update regtest checksums after revision 6001dad.
  Replace more FFmpeg references by Libav.
  ac3dec: fix processing of delta bit allocation information.
  vc1: fix fate-vc1 after previous commit.
  wmv3dec: fix playback of complex WMV3 files using simple_idct.
  Replace references to ffmpeg-devel with libav-devel; fix roundup URL.
  make av_dup_packet() more cautious on allocation failures
  ...

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-19 02:27:53 +02:00
1764 changed files with 76668 additions and 157320 deletions

12
.gitignore vendored
View File

@@ -7,25 +7,18 @@
*-example
*-test
*_g
*.def
*.dll
*.lib
*.exp
config.*
doc/*.1
doc/*.html
doc/*.pod
doc/fate.txt
doxy
ffmpeg
ffplay
ffprobe
ffserver
avconv
libavcodec/*_tablegen
libavcodec/*_tables.c
libavcodec/*_tables.h
libavcodec/codec_names.h
libavcodec/libavcodec*
libavcore/libavcore*
libavdevice/libavdevice*
@@ -34,23 +27,22 @@ libavformat/libavformat*
libavutil/avconfig.h
libavutil/libavutil*
libpostproc/libpostproc*
libswresample/libswresample*
libswscale/libswscale*
tests/audiogen
tests/base64
tests/data
tests/rotozoom
tests/seek_test
tests/tiny_psnr
tests/videogen
tests/vsynth1
tests/vsynth2
tools/aviocat
tools/cws2fws
tools/graph2dot
tools/ismindex
tools/lavfi-showfiltfmts
tools/pktdumper
tools/probetest
tools/qt-faststart
tools/trasher
tools/trasher*.d
version.h

552
Changelog
View File

@@ -1,480 +1,59 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version next:
version 0.7.1:
version 0.10.11
- added various additional FOURCC codec identifiers
- H.264 4:4:4 fixes
- build system and compilation fixes
- Doxygen and general documentation corrections and improvements
- fixed segfault in ffprobe
- behavioral fix in av_open_input_stream()
- Licensing clarification for LGPL'ed vf_gradfun
- bugfixes while seeking in multithreaded decoding
- support newer versions of OpenCV
- ffmpeg: fix operation with --disable-avfilter
- fixed integer underflow in matroska decoder
- pthread: Avoid spurious wakeups
- pthread: Fix deadlock during thread initialization
- mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0
- vc1dec: Don't decode slices when the latest slice header failed to decode
- vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks
- r3d: Add more input value validation
- fraps: Make the input buffer size checks more strict
- svq3: Avoid a division by zero
- rmdec: Validate the fps value
- twinvqdec: Check the ibps parameter separately
- asfdec: Check the return value of asf_read_stream_properties
- mxfdec: set audio timebase to 1/samplerate
- pcx: Check the packet size before assuming it fits a palette
- rpza: Fix a buffer size check
- xxan: Disallow odd width
- xan: Only read within the data that actually was initialized
- xan: Use bytestream2 to limit reading to within the buffer
- pcx: Consume the whole packet if giving up due to missing palette
- pngdec: Stop trying to decode once inflate returns Z_STREAM_END
- mov: Make sure the read sample count is nonnegative
- bfi: Add some very basic sanity checks for input packet sizes
- bfi: Avoid divisions by zero
- electronicarts: Add more sanity checking for the number of channels
- riffdec: Add sanity checks for the sample rate
- mvi: Add sanity checking for the audio frame size
- xwma: Avoid division by zero
- avidec: Make sure a packet is large enough before reading its data
- vqf: Make sure the bitrate is in the valid range
- vqf: Make sure sample_rate is set to a valid value
- vc1dec: Undo mpegvideo initialization if unable to allocate tables
- vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
- wnv1: Make sure the input packet is large enough
- dca: Validate the lfe parameter
- rl2: Avoid a division by zero
- wtv: Add more sanity checks for a length read from the file
- segafilm: Validate the number of audio channels
- qpeg: Add checks for running out of rows in qpeg_decode_inter
- mpegaudiodec: Validate that the number of channels fits at the given offset
- asv1: Verify the amount of extradata
- idroqdec: Make sure a video stream has been allocated before returning packets
- rv10: Validate the dimensions set from the container
- xmv: Add more sanity checks for parameters read from the bitstream
- ffv1: Make sure at least one slice context is initialized
- truemotion2: Use av_freep properly in an error path
- eacmv: Make sure a reference frame exists before referencing it
- mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory
- ivi_common: Make sure color planes have been initialized
- oggparseogm: Convert to use bytestream2
- rv34: Check the return value from ff_rv34_decode_init
- matroskadec: Verify realaudio codec parameters
- mace: Make sure that the channel count is set to a valid value
- svq3: Check for any negative return value from ff_h264_check_intra_pred_mode
- vp3: Check the framerate for validity
- cavsdec: Make sure a sequence header has been decoded before decoding pictures
- sierravmd: Do sanity checking of frame sizes
- omadec: Properly check lengths before incrementing the position
- mpc8: Make sure the first stream exists before parsing the seek table
- mpc8: Check the seek table size parsed from the bitstream
- zmbvdec: Check the buffer size for uncompressed data
- ape: Don't allow the seektable to be omitted
- shorten: Break out of loop looking for fmt chunk if none is found
- shorten: Use a checked bytestream reader for the wave header
- smacker: Make sure we don't fill in huffman codes out of range
- smacker: Avoid integer overflow when allocating packets
- smacker: Don't return packets in unallocated streams
- dsicin: Add some basic sanity checks for fields read from the file
- roqvideodec: check dimensions validity
- qdm2: check array index before use, fix out of array accesses
- alsdec: check block length
version 0.10.10
- x86: fft: Remove 3DNow! optimizations, they break FATE
- x86: ac3dsp: Drop mmx variant of ac3_max_msb_abs_int16
- aac: Check init_get_bits return value
- aac: return meaningful errors
- dsicinav: K&R formatting cosmetics
- mov: Seek back if overreading an individual atom
- vcr1: add sanity checks
- pictordec: pass correct context to avpriv_request_sample
- dsicinav: Clip the source size to the expected maximum
- alsdec: Clean up error paths
- ogg: Fix potential infinite discard loop
- nuv: check rtjpeg_decode_frame_yuv420 return value
- nuv: Reset the frame on resize
- nuv: Use av_fast_realloc
- nuv: return meaningful error codes.
- nuv: Pad the lzo outbuf
- nuv: Do not ignore lzo decompression failures
- oma: correctly mark and decrypt partial packets
- oma: check geob tag boundary
- oma: refactor seek function
- 8bps: Bound-check the input buffer
- rtmp: Do not misuse memcmp
- rtmp: rename data_size to size
- lavc: set the default rc_initial_buffer_occupancy
- 4xm: Reject not a multiple of 16 dimension
- 4xm: do not overread the prestream buffer
- 4xm: validate the buffer size before parsing it
- indeo: Do not reference mismatched tiles
- indeo: Sanitize ff_ivi_init_planes fail paths
- indeo: Bound-check before applying motion compensation
- indeo: Bound-check before applying transform
- indeo: reject negative array indexes
- indeo: Cosmetic formatting
- indeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks
- indeo: Refactor ff_ivi_dec_huff_desc
- lavf: fix the comparison in an overflow check
- dv: Add a guard to not overread the ppcm array
- mpegvideo: Avoid 32-bit wrapping of linesize multiplications
- mjpegb: Detect changing number of planes in interlaced video
- matroskadec: Check that .lang was allocated and set before reading it
- ape demuxer: check for EOF in potentially long loops
- lavf: avoid integer overflow when estimating bitrate
- pictordec: break out of both decoding loops when y drops below 0
- ac3: Return proper error codes
- ac3: Clean up the error paths
- ac3: Do not clash with normal AVERROR
- dxa: Make sure the reference frame exists
- h261: check the mtype index
- segafilm: Error out on impossible packet size
- ogg: Always alloc the private context in vorbis_header
- vc1: check mb_height validity.
- vc1: check the source buffer in vc1_mc functions
- bink: Bound check the quantization matrix.
- xl: Make sure the width is valid
- alsdec: Fix the clipping range
- dsicinav: Bound-check the source buffer when needed
- mov: Do not allow updating the time scale after it has been set
- ac3dec: Don't consume more data than the actual input packet size
- indeo: Reject impossible FRAMETYPE_NULL
- indeo5: return proper error codes
- indeo4: Validate scantable dimension
- indeo4: Check the quantization matrix index
- indeo4: Do not access missing reference MV
- adpcm: Unbreak ima-dk4
- ac3dec: validate channel output mode against channel count
- dca: Respect the current limits in the downmixing capabilities
- dca: Error out on missing DSYNC
- pcm: always use codec->id instead of codec_id
- mlpdec: Do not set invalid context in read_restart_header
- pcx: Do not overread source buffer in pcx_rle_decode
- wmavoice: conceal clearly corrupted blocks
- iff: Do not read over the source buffer
- qdm2: Conceal broken samples
- qdm2: refactor joined stereo support
- adpcm: Write the correct number of samples for ima-dk4
- imc: Catch a division by zero
- atrac3: Error on impossible encoding/channel combinations
- atrac3: set the getbits context the right buffer_end
- atrac3: fix error handling
- qdm2: check and reset dithering index per channel
- westwood_vqa: do not free extradata on error in read_header
- vqavideo: check the version
- rmdec: Use the AVIOContext given as parameter in rm_read_metadata()
- avio: Handle AVERROR_EOF in the same way as the return value 0
- wtv: Mark attachment with a negative stream id
- avidec: Let the inner dv demuxer take care of discarding
- swfdec: do better validation of tag length
version 0.10.8
- kmvc: Clip pixel position to valid range
- kmvc: use fixed sized arrays in the context
- indeo: use a typedef for the mc function pointer
- lavc: check for overflow in init_get_bits
- mjpegdec: properly report unsupported disabled features
- jpegls: return meaningful errors
- jpegls: factorize return paths
- jpegls: check the scan offset
- wavpack: validate samples size parsed in wavpack_decode_block
- ljpeg: use the correct number of components in yuv
- mjpeg: Validate sampling factors
- mjpegdec: validate parameters in mjpeg_decode_scan_progressive_ac
- wavpack: check packet size early
- wavpack: return meaningful errors
- apetag: use int64_t for filesize
- tiff: do not overread the source buffer
- Prepare for 0.8.8 Release
- smacker: fix an off by one in huff.length computation
- smacker: check the return value of smacker_decode_tree
- smacker: pad the extradata allocation
- smacker: check frame size validity
- vmdav: convert to bytestream2
- 4xm: don't rely on get_buffer() initializing the frame.
- 4xm: check the return value of read_huffman_tables().
- 4xm: use the correct logging context
- 4xm: reject frames not compatible with the declared version
- 4xm: check bitstream_size boundary before using it
- 4xm: do not overread the source buffer in decode_p_block
- avfiltergraph: check for sws opts being non-NULL before using them
- bmv: check for len being valid in bmv_decode_frame()
- dfa: check for invalid access in decode_wdlt()
- indeo3: check motion vectors
- indeo3: fix data size check
- indeo3: switch parsing the header to bytestream2
- lavf: make sure stream probe data gets freed.
- oggdec: fix faulty cleanup prototype
- oma: Validate sample rates
- qdm2: check that the FFT size is a power of 2
- rv10: check that extradata is large enough
- xmv: check audio track parameters validity
- xmv: do not leak memory in the error paths in xmv_read_header()
- aac: check the maximum number of channels
- indeo3: fix off by one in MV validity check, Bug #503
- id3v2: check for end of file while unescaping tags
- wav: Always seek to an even offset, Bug #500, LP: #1174737
- proresdec: support mixed interlaced/non-interlaced content
version 0.10.6:
- many bug fixes that where found with Coverity
- The following CVE fixes where backported:
CVE-2012-2796, CVE-2012-2775, CVE-2012-2772, CVE-2012-2776,
CVE-2012-2779, CVE-2012-2787, CVE-2012-2794, CVE-2012-2800,
CVE-2012-2802, CVE-2012-2801, CVE-2012-2786, CVE-2012-2798,
CVE-2012-2793, CVE-2012-2789, CVE-2012-2788, CVE-2012-2790,
CVE-2012-2777, CVE-2012-2784
- hundreads of other bug fixes, some possibly security relevant,
see the git log for details.
version 0.10.5:
- Several bugs and crashes have been fixed as well as build problems
with recent mingw64
version 0.10.4:
- Several bugs and crashes have been fixed
Note, CVE-2012-0851 and CVE-2011-3937 have been fixed in previous releases
version 0.10.3:
- Security fixes in the 4xm demuxer, avi demuxer, cook decoder,
mm demuxer, mpegvideo decoder, vqavideo decoder (CVE-2012-0947) and
xmv demuxer.
- Several bugs and crashes have been fixed in the following codecs: AAC,
APE, H.263, H.264, Indeo 4, Mimic, MJPEG, Motion Pixels Video, RAW,
TTA, VC1, VQA, WMA Voice, vqavideo.
- Several bugs and crashes have been fixed in the following formats:
ASF, ID3v2, MOV, xWMA
- This release additionally updates the following codecs to the
bytestream2 API, and therefore benefit from additional overflow
checks: truemotion2, utvideo, vqavideo
version 0.10.1
- Several security fixes, many bugfixes affecting many formats and
codecs, the list below is not complete.
- swapuv filter
- Several bugs and crashes have been fixed in the following codecs: AAC,
AC-3, ADPCM, AMR (both NB and WB), ATRAC3, CAVC, Cook, camstudio, DCA,
DPCM, DSI CIN, DV, EA TGQ, FLAC, fraps, G.722 (both encoder and
decoder), H.264, huvffyuv, BB JV decoder, Indeo 3, KGV1, LCL, the
libx264 wrapper, MJPEG, mp3on4, Musepack, MPEG1/2, PNG, QDM2, Qt RLE,
ROQ, RV10, RV30/RV34/RV40, shorten, smacker, subrip, SVQ3, TIFF,
Truemotion2, TTA, VC1, VMware Screen codec, Vorbis, VP5, VP6, WMA,
Westwood SNDx, XXAN.
- This release additionally updates the following codecs to the
bytestream2 API, and therefore benefit from additional overflow
checks: XXAN, ALG MM, TQG, SMC, Qt SMC, ROQ, PNG
- Several bugs and crashes have been fixed in the following formats:
AIFF, ASF, DV, Matroska, NSV, MOV, MPEG-TS, Smacker, Sony OpenMG, RM,
SWF.
- Libswscale has an potential overflow for large image size fixed.
- The following APIs have been added:
avcodec_is_open()
avformat_get_riff_video_tags()
avformat_get_riff_audio_tags()
Please see the file doc/APIchanges and the Doxygen documentation for
further information.
version 0.10:
- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,
CVE-2011-3937, CVE-2011-3940, CVE-2011-3941, CVE-2011-3944,
CVE-2011-3945, CVE-2011-3946, CVE-2011-3947, CVE-2011-3949,
CVE-2011-3950, CVE-2011-3951, CVE-2011-3952
- v410 Quicktime Uncompressed 4:4:4 10-bit encoder and decoder
- SBaGen (SBG) binaural beats script demuxer
- OpenMG Audio muxer
- Timecode extraction in DV and MOV
- thumbnail video filter
- XML output in ffprobe
- asplit audio filter
- tinterlace video filter
- astreamsync audio filter
- amerge audio filter
- ISMV (Smooth Streaming) muxer
- GSM audio parser
- SMJPEG muxer
- XWD encoder and decoder
- Automatic thread count based on detection number of (available) CPU cores
- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
- ffprobe -show_error option
- Avid 1:1 10-bit RGB Packer codec
- v308 Quicktime Uncompressed 4:4:4 encoder and decoder
- yuv4 libquicktime packed 4:2:0 encoder and decoder
- ffprobe -show_frames option
- silencedetect audio filter
- ffprobe -show_program_version, -show_library_versions, -show_versions options
- rv34: frame-level multi-threading
- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
- Improved PGS subtitle decoder
- dumpgraph option to lavfi device
- r210 and r10k encoders
- ffwavesynth decoder
- aviocat tool
- ffeval tool
version 0.9:
- openal input device added
- boxblur filter added
- BWF muxer
- Flash Screen Video 2 decoder
- lavfi input device added
- added avconv, which is almost the same for now, except
for a few incompatible changes in the options, which will hopefully make them
easier to use. The changes are:
* The options placement is now strictly enforced! While in theory the
options for ffmpeg should be given in [input options] -i INPUT [output
options] OUTPUT order, in practice it was possible to give output options
before the -i and it mostly worked. Except when it didn't - the behavior was
a bit inconsistent. In avconv, it is not possible to mix input and output
options. All non-global options are reset after an input or output filename.
* All per-file options are now truly per-file - they apply only to the next
input or output file and specifying different values for different files
will now work properly (notably -ss and -t options).
* All per-stream options are now truly per-stream - it is possible to
specify which stream(s) should a given option apply to. See the Stream
specifiers section in the avconv manual for details.
* In ffmpeg some options (like -newvideo/-newaudio/...) are irregular in the
sense that they're specified after the output filename instead of before,
like all other options. In avconv this irregularity is removed, all options
apply to the next input or output file.
* -newvideo/-newaudio/-newsubtitle options were removed. Not only were they
irregular and highly confusing, they were also redundant. In avconv the -map
option will create new streams in the output file and map input streams to
them. E.g. avconv -i INPUT -map 0 OUTPUT will create an output stream for
each stream in the first input file.
* The -map option now has slightly different and more powerful syntax:
+ Colons (':') are used to separate file index/stream type/stream index
instead of dots. Comma (',') is used to separate the sync stream instead
of colon.. This is done for consistency with other options.
+ It's possible to specify stream type. E.g. -map 0:a:2 creates an
output stream from the third input audio stream.
+ Omitting the stream index now maps all the streams of the given type,
not just the first. E.g. -map 0:s creates output streams for all the
subtitle streams in the first input file.
+ Since -map can now match multiple streams, negative mappings were
introduced. Negative mappings disable some streams from an already
defined map. E.g. '-map 0 -map -0:a:1' means 'create output streams for
all the stream in the first input file, except for the second audio
stream'.
* There is a new option -c (or -codec) for choosing the decoder/encoder to
use, which allows to precisely specify target stream(s) consistently with
other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0
libvorbis sets the codec for the first audio stream and -c copy copies all
the streams without reencoding. Old -vcodec/-acodec/-scodec options are now
aliases to -c:v/a/s
* It is now possible to precisely specify which stream should an AVOption
apply to. E.g. -b:v:0 2M sets the bitrate for the first video stream, while
-b:a 128k sets the bitrate for all audio streams. Note that the old -ab 128k
syntax is deprecated and will stop working soon.
* -map_chapters now takes only an input file index and applies to the next
output file. This is consistent with how all the other options work.
* -map_metadata now takes only an input metadata specifier and applies to
the next output file. Output metadata specifier is now part of the option
name, similarly to the AVOptions/map/codec feature above.
* -metadata can now be used to set metadata on streams and chapters, e.g.
-metadata:s:1 language=eng sets the language of the first stream to 'eng'.
This made -vlang/-alang/-slang options redundant, so they were removed.
* -qscale option now uses stream specifiers and applies to all streams, not
just video. I.e. plain -qscale number would now apply to all streams. To get
the old behavior, use -qscale:v. Also there is now a shortcut -q for -qscale
and -aq is now an alias for -q:a.
* -vbsf/-absf/-sbsf options were removed and replaced by a -bsf option which
uses stream specifiers. Use -bsf:v/a/s instead of the old options.
* -itsscale option now uses stream specifiers, so its argument is only the
scale parameter.
* -intra option was removed, use -g 0 for the same effect.
* -psnr option was removed, use -flags +psnr for the same effect.
* -vf option is now an alias to the new -filter option, which uses stream specifiers.
* -vframes/-aframes/-dframes options are now aliases to the new -frames option.
* -vtag/-atag/-stag options are now aliases to the new -tag option.
- XMV demuxer
- LOAS demuxer
- ashowinfo filter added
- Windows Media Image decoder
- amovie source added
- LATM muxer/demuxer
- Speex encoder via libspeex
- JSON output in ffprobe
- WTV muxer
- Optional C++ Support (needed for libstagefright)
- H.264 Decoding on Android via Stagefright
- Prores decoder
- BIN/XBIN/ADF/IDF text file decoder
- aconvert audio filter added
- audio support to lavfi input device added
- libcdio-paranoia input device for audio CD grabbing
- Apple ProRes decoder
- CELT in Ogg demuxing
- G.723.1 demuxer and decoder
- libmodplug support (--enable-libmodplug)
- VC-1 interlaced decoding
- libutvideo wrapper (--enable-libutvideo)
- aevalsrc audio source added
- Ut Video decoder
- Speex encoding via libspeex
- 4:2:2 H.264 decoding support
- 4:2:2 and 4:4:4 H.264 encoding with libx264
- Pulseaudio input device
- Prores encoder
- Video Decoder Acceleration (VDA) HWAccel module.
- replacement Indeo 3 decoder
- new ffmpeg option: -map_channel
- volume audio filter added
- earwax audio filter added
- libv4l2 support (--enable-libv4l2)
- TLS/SSL and HTTPS protocol support
- AVOptions API rewritten and documented
- most of CODEC_FLAG2_*, some CODEC_FLAG_* and many codec-specific fields in
AVCodecContext deprecated. Codec private options should be used instead.
- Properly working defaults in libx264 wrapper, support for native presets.
- Encrypted OMA files support
- Discworld II BMV decoding support
- VBLE Decoder
- OS X Video Decoder Acceleration (VDA) support
- compact and csv output in ffprobe
- pan audio filter
- IFF Amiga Continuous Bitmap (ACBM) decoder
- ass filter
- CRI ADX audio format muxer and demuxer
- Playstation Portable PMP format demuxer
- Microsoft Windows ICO demuxer
- life source
- PCM format support in OMA demuxer
- CLJR encoder
- new option: -report
- Dxtory capture format decoder
- cellauto source
- Simple segmenting muxer
- Indeo 4 decoder
- SMJPEG demuxer
version 0.8:
version 0.7:
- many many things we forgot because we rather write code than changelogs
- libmpcodecs video filter support (3 times as many filters than before)
- mpeg2 aspect ratio dection fixed
- libxvid aspect pickiness fixed
- Frame multithreaded decoding
- E-AC-3 audio encoder
- ac3enc: add channel coupling support
- floating-point sample format support for (E-)AC-3, DCA, AAC, Vorbis decoders
- H.264/MPEG frame-level multithreading
- av_metadata_* functions renamed to av_dict_* and moved to libavutil
- 4:4:4 H.264 decoding support
- 10-bit H.264 optimizations for x86
- lut, lutrgb, and lutyuv filters added
- buffersink libavfilter sink added
- bump libswscale for recently reported ABI break
version 0.7_beta2:
- VP8 frame-level multithreading
- NEON optimizations for VP8
- removed a lot of deprecated API cruft
- FFT and IMDCT optimizations for AVX (Sandy Bridge) processors
- showinfo filter added
- DPX image encoder
- SMPTE 302M AES3 audio decoder
- Apple Core Audio Format muxer
- 9bit and 10bit per sample support in the H.264 decoder
- 9bit and 10bit FFV1 encoding / decoding
- split filter added
- select filter added
- sdl output device added
version 0.7_beta1:
- WebM support in Matroska de/muxer
- low overhead Ogg muxing
- MMS-TCP support
@@ -482,7 +61,6 @@ version 0.8:
- Demuxer for On2's IVF format
- Pictor/PC Paint decoder
- HE-AAC v2 decoder
- HE-AAC v2 encoding with libaacplus
- libfaad2 wrapper removed
- DTS-ES extension (XCh) decoding support
- native VP8 decoder
@@ -494,7 +72,7 @@ version 0.8:
- RTP depacketization of QDM2
- ANSI/ASCII art playback system
- Lego Mindstorms RSO de/muxer
- libavcore added (and subsequently removed)
- libavcore added
- SubRip subtitle file muxer and demuxer
- Chinese AVS encoding via libxavs
- ffprobe -show_packets option added
@@ -562,38 +140,6 @@ version 0.8:
- AMR-WB encoding via libvo-amrwbenc
- xWMA demuxer
- Mobotix MxPEG decoder
- VP8 frame-multithreading
- NEON optimizations for VP8
- Lots of deprecated API cruft removed
- fft and imdct optimizations for AVX (Sandy Bridge) processors
- showinfo filter added
- SMPTE 302M AES3 audio decoder
- Apple Core Audio Format muxer
- 9bit and 10bit per sample support in the H.264 decoder
- 9bit and 10bit FFV1 encoding / decoding
- split filter added
- select filter added
- sdl output device added
- libmpcodecs video filter support (3 times as many filters than before)
- mpeg2 aspect ratio dection fixed
- libxvid aspect pickiness fixed
- Frame multithreaded decoding
- E-AC-3 audio encoder
- ac3enc: add channel coupling support
- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
- H264/MPEG frame-level multi-threading
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
- 4:4:4 H.264 decoding support
- 10-bit H.264 optimizations for x86
- lut, lutrgb, and lutyuv filters added
- buffersink libavfilter sink added
- Bump libswscale for recently reported ABI break
- New J2K encoder (via OpenJPEG)
version 0.7:
- all the changes for 0.8, but keeping API/ABI compatibility with the 0.6 release
version 0.6:

View File

@@ -31,13 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.10.16
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
# pixels and the maximum width should not exceed 200 pixels. Doxygen will
# copy the logo to the output directory.
PROJECT_LOGO =
PROJECT_NUMBER = 0.7.4
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -766,7 +760,7 @@ ALPHABETICAL_INDEX = YES
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 2
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
@@ -800,13 +794,13 @@ HTML_FILE_EXTENSION = .html
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER = doc/doxy/header.html
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = doc/doxy/footer.html
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
@@ -815,7 +809,7 @@ HTML_FOOTER = doc/doxy/footer.html
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
HTML_STYLESHEET =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen will adjust the colors in the stylesheet and background images
@@ -825,7 +819,7 @@ HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
# The allowed range is 0 to 359.
HTML_COLORSTYLE_HUE = 120
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
# the colors in the HTML output. For a value of 0 the output will use
@@ -864,7 +858,7 @@ HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OS X 10.5 (Leopard).
# integrated development environment, introduced with OSX 10.5 (Leopard).
# To create a documentation set, doxygen will generate a Makefile in the
# HTML output directory. Running make will produce the docset in that
# directory and running "make install" will install the docset in
@@ -1388,8 +1382,7 @@ PREDEFINED = "__attribute__(x)=" \
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED = declare_idct \
READ_PAR_DATA \
EXPAND_AS_DEFINED = declare_idct
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone

View File

@@ -41,6 +41,6 @@ is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of
those licenses. So to combine the OpenCORE libraries with FFmpeg, the license
version needs to be upgraded by passing --enable-version3 to configure.
The nonfree external libraries libfaac and libaacplus can be hooked up in FFmpeg.
You need to pass --enable-nonfree to configure to enable it. Employ this option
with care as FFmpeg then becomes nonfree and unredistributable.
The nonfree external library libfaac can be hooked up in FFmpeg. You need to
pass --enable-nonfree to configure to enable it. Employ this option with care
as FFmpeg then becomes nonfree and unredistributable.

View File

@@ -4,16 +4,11 @@ FFmpeg maintainers
Below is a list of the people maintaining different parts of the
FFmpeg code.
Please try to keep entries where you are the maintainer upto date!
Names in () mean that the maintainer currently has no time to maintain the code.
A CC after the name means that the maintainer prefers to be CC-ed on patches
and related discussions.
Project Leader
==============
Michael Niedermayer
final design decisions
@@ -24,7 +19,7 @@ ffmpeg:
ffmpeg.c Michael Niedermayer
ffplay:
ffplay.c Marton Balint
ffplay.c Michael Niedermayer
ffprobe:
ffprobe.c Stefano Sabatini
@@ -43,13 +38,13 @@ Miscellaneous Areas
===================
documentation Mike Melanson
website Robert Swain, Lou Logan
website Robert Swain
build system (configure,Makefiles) Diego Biurrun, Mans Rullgard
project server Árpád Gereöffy, Michael Niedermayer, Reimar Döffinger
mailinglists Michael Niedermayer, Baptiste Coudurier, Lou Logan
project server Diego Biurrun, Mans Rullgard
mailinglists Michael Niedermayer, Baptiste Coudurier
presets Robert Swain
metadata subsystem Aurelien Jacobs
release management Michael Niedermayer
release management Diego Biurrun, Reinhard Tartler
libavutil
@@ -86,8 +81,6 @@ Generic Parts:
bitstream.c, bitstream.h Michael Niedermayer
CABAC:
cabac.h, cabac.c Michael Niedermayer
codec names:
codec_names.sh Nicolas George
DSP utilities:
dsputils.c, dsputils.h Michael Niedermayer
entropy coding:
@@ -141,7 +134,6 @@ Codecs:
dv.c Roman Shaposhnik
eacmv*, eaidct*, eat* Peter Ross
ffv1.c Michael Niedermayer
ffwavesynth.c Nicolas George
flac* Justin Ruggles
flashsv* Benjamin Larsson
flicvideo.c Mike Melanson
@@ -162,11 +154,9 @@ Codecs:
jvdec.c Peter Ross
kmvc.c Kostya Shishkov
lcl*.c Roberto Togni, Reimar Doeffinger
libcelt_dec.c Nicolas George
libgsm.c Michel Bardiaux
libdirac* David Conrad
libopenjpeg.c Jaikrishnan Menon
libopenjpegenc.c Michael Bradshaw
libschroedinger* David Conrad
libspeexdec.c Justin Ruggles
libtheoraenc.c David Conrad
@@ -221,9 +211,7 @@ Codecs:
tta.c Alex Beregszaszi, Jaikrishnan Menon
txd.c Ivo van Poorten
ulti* Kostya Shishkov
v410*.c Derek Buitenhuis
vb.c Kostya Shishkov
vble.c Derek Buitenhuis
vc1* Kostya Shishkov
vcr1.c Michael Niedermayer
vmnc.c Kostya Shishkov
@@ -247,9 +235,7 @@ Codecs:
Hardware acceleration:
crystalhd.c Philip Langdale
dxva2* Laurent Aimar
libstagefright.cpp Mohamed Naufal
vaapi* Gwenole Beauchesne
vda* Sebastien Zwickert
vdpau* Carl Eugen Hoyos
@@ -264,18 +250,6 @@ libavdevice
vfwcap.c Ramiro Polla
libavfilter
===========
Video filters:
graphdump.c Nicolas George
af_amerge.c Nicolas George
af_astreamsync.c Nicolas George
af_pan.c Nicolas George
vsrc_mandelbrot.c Michael Niedermayer
vf_yadif.c Michael Niedermayer
libavformat
===========
@@ -313,7 +287,6 @@ Muxers/Demuxers:
img2.c Michael Niedermayer
iss.c Stefan Gehrer
jvdec.c Peter Ross
libmodplug.c Clément Bœsch
libnut.c Oded Shimon
lmlm4.c Ivo van Poorten
lxfdec.c Tomas Härdin
@@ -332,7 +305,6 @@ Muxers/Demuxers:
msnwc_tcp.c Ramiro Polla
mtv.c Reynaldo H. Verdejo Pinochet
mxf* Baptiste Coudurier
mxfdec.c Tomas Härdin
nsvdec.c Francois Revol
nut.c Michael Niedermayer
nuv.c Reimar Doeffinger
@@ -352,7 +324,6 @@ Muxers/Demuxers:
rtpdec_asf.* Ronald S. Bultje
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
rtsp.c Luca Barbato
sbgdec.c Nicolas George
sdp.c Martin Storsjo
segafilm.c Mike Melanson
siff.c Kostya Shishkov
@@ -391,15 +362,8 @@ Sparc Roman Shaposhnik
x86 Michael Niedermayer
Releases
========
0.9 Michael Niedermayer
GnuPG Fingerprints of maintainers and contributors
==================================================
GnuPG Fingerprints of maintainers and others who have svn write access
======================================================================
Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
@@ -409,15 +373,12 @@ Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
Luca Barbato 6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
Panagiotis Issaris 515C E262 10A8 FDCE 5481 7B9C 3AD7 D9A5 071D B3A9
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4

252
Makefile
View File

@@ -1,14 +1,13 @@
MAIN_MAKEFILE=1
include config.mak
vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH)
vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH)
vpath %.v $(SRC_PATH)
vpath %.texi $(SRC_PATH)
vpath %/fate_config.sh.template $(SRC_PATH)
SRC_DIR = $(SRC_PATH_BARE)
vpath %.c $(SRC_DIR)
vpath %.h $(SRC_DIR)
vpath %.S $(SRC_DIR)
vpath %.asm $(SRC_DIR)
vpath %.v $(SRC_DIR)
vpath %.texi $(SRC_PATH_BARE)
PROGS-$(CONFIG_FFMPEG) += ffmpeg
PROGS-$(CONFIG_FFPLAY) += ffplay
@@ -16,57 +15,58 @@ PROGS-$(CONFIG_FFPROBE) += ffprobe
PROGS-$(CONFIG_FFSERVER) += ffserver
PROGS := $(PROGS-yes:%=%$(EXESUF))
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
MANPAGES = $(PROGS-yes:%=doc/%.1)
PODPAGES = $(PROGS-yes:%=doc/%.pod)
HTMLPAGES = $(PROGS-yes:%=doc/%.html)
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%)
TOOLS = qt-faststart trasher
TOOLS-$(CONFIG_ZLIB) += cws2fws
BASENAMES = ffmpeg ffplay ffprobe ffserver
ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
ALLPROGS = $(BASENAMES:%=%$(EXESUF))
ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
ALLMANPAGES = $(BASENAMES:%=%.1)
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_AVFORMAT) += avformat
FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_POSTPROC) += postproc
FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
FFLIBS-$(CONFIG_SWSCALE) += swscale
FFLIBS := avutil
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
SKIPHEADERS = cmdutils_common_opts.h
include $(SRC_PATH)/common.mak
include common.mak
FF_LDFLAGS := $(FFLDFLAGS)
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
all: $(PROGS)
all-$(CONFIG_DOC): documentation
$(PROGS): %$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
$(CP) $< $@$(PROGSSUF)
$(STRIP) $@$(PROGSSUF)
all: $(FF_DEP_LIBS) $(PROGS)
$(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
tools/cws2fws$(EXESUF): ELIBS = -lz
$(PROGS): %$(EXESUF): %_g$(EXESUF)
$(CP) $< $@
$(STRIP) $@
config.h: .config
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/lib%/all*.c))
@-tput bold 2>/dev/null
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
define RESET
$(1) :=
@@ -76,26 +76,31 @@ endef
define DOSUBDIR
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
SUBDIR := $(1)/
include $(SRC_PATH)/$(1)/Makefile
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
include $(SRC_PATH)/library.mak
include $(1)/Makefile
endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
ffplay.o: CFLAGS += $(SDL_CFLAGS)
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
%$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
OBJDIRS += tools
alltools: $(TOOLS)
tools/%$(EXESUF): tools/%.o
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
tools/%.o: tools/%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
-include $(wildcard tools/*.d)
-include $(wildcard tests/*.d)
VERSION_SH = $(SRC_PATH)/version.sh
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
VERSION_SH = $(SRC_PATH_BARE)/version.sh
GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
.version: M=@
@@ -107,6 +112,28 @@ version.h .version:
# force version.sh to run whenever version might have changed
-include .version
DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
documentation: $(DOCS)
-include $(wildcard $(DOCS:%=%.d))
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
doc/%.html: TAG = HTML
doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
$(Q)$(TEXIDEP)
$(M)texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init --output $@ $<
doc/%.pod: TAG = POD
doc/%.pod: doc/%.texi
$(Q)$(TEXIDEP)
$(M)doc/texi2pod.pl $< $@
doc/%.1: TAG = MAN
doc/%.1: doc/%.pod
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
ifdef PROGS
install: install-progs install-data
endif
@@ -116,17 +143,22 @@ install: install-libs install-headers
install-libs: install-libs-yes
install-progs-yes:
install-progs-$(CONFIG_DOC): install-man
install-progs-$(CONFIG_SHARED): install-libs
install-progs: install-progs-yes $(PROGS)
$(Q)mkdir -p "$(BINDIR)"
$(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
install-data: $(DATA_FILES)
$(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
install-man: $(MANPAGES)
$(Q)mkdir -p "$(MANDIR)/man1"
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-man
uninstall-progs:
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
@@ -134,12 +166,21 @@ uninstall-progs:
uninstall-data:
$(RM) -r "$(DATADIR)"
clean::
uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
testclean:
$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
clean:: testclean
$(RM) $(ALLPROGS) $(ALLPROGS_G)
$(RM) $(CLEANSUFFIXES)
$(RM) doc/*.html doc/*.pod doc/*.1 doc/*.d doc/*~
$(RM) $(TOOLS)
$(RM) $(CLEANSUFFIXES:%=tools/%)
$(RM) coverage.info
$(RM) -r coverage-html
distclean::
$(RM) $(DISTCLEANSUFFIXES)
@@ -148,30 +189,119 @@ distclean::
config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
# regression tests
coverage-html: coverage.info
$(Q)mkdir -p $@
$(Q)genhtml -o $@ $<
$(Q)touch $@
check: test
check: all alltools checkheaders examples testprogs fate
fulltest test: codectest lavftest lavfitest seektest
include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/tests/Makefile
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
$(sort $(OBJDIRS)):
$(Q)mkdir -p $@
codectest: fate-codec
lavftest: fate-lavf
lavfitest: fate-lavfi
seektest: fate-seek
# Dummy rule to stop make trying to rebuild removed or renamed headers
%.h:
@:
AREF = fate-acodec-aref
VREF = fate-vsynth1-vref fate-vsynth2-vref
REFS = $(AREF) $(VREF)
# Disable suffix rules. Most of the builtin rules are suffix rules,
# so this saves some time on slow systems.
.SUFFIXES:
$(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
$(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
.PHONY: all all-yes alltools check *clean config examples install*
.PHONY: testprogs uninstall*
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
@echo
@echo "Unfortunately ffserver is broken and therefore its regression"
@echo "test fails randomly. Treat the results accordingly."
@echo
$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
@mkdir -p tests/vsynth1
$(M)./$< 'tests/vsynth1/'
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
@mkdir -p tests/vsynth2
$(M)./$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
@mkdir -p tests/data
$(M)./$< $@
tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
include $(SRC_PATH_BARE)/tests/fate.mak
include $(SRC_PATH_BARE)/tests/fate2.mak
include $(SRC_PATH_BARE)/tests/fate/aac.mak
include $(SRC_PATH_BARE)/tests/fate/als.mak
include $(SRC_PATH_BARE)/tests/fate/fft.mak
include $(SRC_PATH_BARE)/tests/fate/h264.mak
include $(SRC_PATH_BARE)/tests/fate/mp3.mak
include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
include $(SRC_PATH_BARE)/tests/fate/vp8.mak
FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
FATE = $(FATE_ACODEC) \
$(FATE_VCODEC) \
$(FATE_LAVF) \
$(FATE_LAVFI) \
$(FATE_SEEK) \
$(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
$(filter-out %-vref,$(FATE_VCODEC)): $(VREF)
$(FATE_LAVF): $(REFS)
$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
$(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
$(FATE_ACODEC): CMD = codectest acodec
$(FATE_VSYNTH1): CMD = codectest vsynth1
$(FATE_VSYNTH2): CMD = codectest vsynth2
$(FATE_LAVF): CMD = lavftest
$(FATE_LAVFI): CMD = lavfitest
$(FATE_SEEK): CMD = seektest
fate-codec: fate-acodec fate-vcodec
fate-acodec: $(FATE_ACODEC)
fate-vcodec: $(FATE_VCODEC)
fate-lavf: $(FATE_LAVF)
fate-lavfi: $(FATE_LAVFI)
fate-seek: $(FATE_SEEK)
ifdef SAMPLES
FATE += $(FATE_TESTS)
fate-rsync:
rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
else
fate-rsync:
@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
$(FATE_TESTS):
@echo "SAMPLES not specified, cannot run FATE. See doc/fate.txt for more information."
endif
FATE_UTILS = base64 tiny_psnr
fate: $(FATE)
$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
@echo "TEST $(@:fate-%=%)"
$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
fate-list:
@printf '%s\n' $(sort $(FATE))
.PHONY: all alltools *clean check config documentation examples install*
.PHONY: *test testprogs uninstall*

View File

@@ -1 +1 @@
0.10.16
0.7.4

View File

@@ -1 +1 @@
0.10.16
0.7.4

1066
cmdutils.c

File diff suppressed because it is too large Load Diff

View File

@@ -43,15 +43,11 @@ extern const char program_name[];
*/
extern const int program_birth_year;
/**
* this year, defined by the program for show_banner()
*/
extern const int this_year;
extern const char **opt_names;
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts;
extern struct SwsContext *sws_opts;
extern AVDictionary *format_opts, *codec_opts;
extern AVDictionary *format_opts, *video_opts, *audio_opts, *sub_opts;
/**
* Initialize the cmdutils option system, in particular
@@ -81,12 +77,6 @@ int opt_default(const char *opt, const char *arg);
*/
int opt_loglevel(const char *opt, const char *arg);
int opt_report(const char *opt);
int opt_max_alloc(const char *opt, const char *arg);
int opt_codec_debug(const char *opt, const char *arg);
/**
* Limit the execution time.
*/
@@ -98,15 +88,14 @@ int opt_timelimit(const char *opt, const char *arg);
* parsed or the corresponding value is invalid.
*
* @param context the context of the value to be set (e.g. the
* corresponding command line option name)
* corresponding commandline option name)
* @param numstr the string to be parsed
* @param type the type (OPT_INT64 or OPT_FLOAT) as which the
* string should be parsed
* @param min the minimum valid accepted value
* @param max the maximum valid accepted value
*/
double parse_number_or_die(const char *context, const char *numstr, int type,
double min, double max);
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max);
/**
* Parse a string specifying a time and return its corresponding
@@ -114,7 +103,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
* the string cannot be correctly parsed.
*
* @param context the context of the value to be set (e.g. the
* corresponding command line option name)
* corresponding commandline option name)
* @param timestr the string to be parsed
* @param is_duration a flag which tells how to interpret timestr, if
* not zero timestr is interpreted as a duration, otherwise as a
@@ -122,19 +111,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
*
* @see parse_date()
*/
int64_t parse_time_or_die(const char *context, const char *timestr,
int is_duration);
typedef struct SpecifierOpt {
char *specifier; /**< stream/chapter/program/... specifier */
union {
uint8_t *str;
int i;
int64_t i64;
float f;
double dbl;
} u;
} SpecifierOpt;
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
typedef struct {
const char *name;
@@ -152,95 +129,31 @@ typedef struct {
#define OPT_INT64 0x0400
#define OPT_EXIT 0x0800
#define OPT_DATA 0x1000
#define OPT_FUNC2 0x2000
#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
Implies OPT_OFFSET. Next element after the offset is
an int containing element count in the array. */
#define OPT_TIME 0x10000
#define OPT_DOUBLE 0x20000
union {
void *dst_ptr;
int *int_arg;
char **str_arg;
float *float_arg;
int (*func_arg)(const char *, const char *);
int (*func2_arg)(void *, const char *, const char *);
size_t off;
int64_t *int64_arg;
} u;
const char *help;
const char *argname;
} OptionDef;
void show_help_options(const OptionDef *options, const char *msg, int mask,
int value);
/**
* Show help for all options with given flags in class and all its
* children.
*/
void show_help_children(const AVClass *class, int flags);
void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
/**
* Parse the command line arguments.
*
* @param optctx an opaque options context
* @param options Array with the definitions required to interpret every
* option of the form: -option_name [argument]
* @param parse_arg_function Name of the function called to process every
* argument without a leading option name flag. NULL if such arguments do
* not have to be processed.
*/
void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(void *optctx, const char*));
void parse_options(int argc, char **argv, const OptionDef *options,
int (* parse_arg_function)(const char *opt, const char *arg));
/**
* Parse one given option.
*
* @return on success 1 if arg was consumed, 0 otherwise; negative number on error
*/
int parse_option(void *optctx, const char *opt, const char *arg,
const OptionDef *options);
/**
* Find the '-loglevel' option in the command line args and apply it.
*/
void parse_loglevel(int argc, char **argv, const OptionDef *options);
/**
* Check if the given stream matches a stream specifier.
*
* @param s Corresponding format context.
* @param st Stream from s to be checked.
* @param spec A stream specifier of the [v|a|s|d]:[\<stream index\>] form.
*
* @return 1 if the stream matches, 0 if it doesn't, <0 on error
*/
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
/**
* Filter out options for given codec.
*
* Create a new options dictionary containing only the options from
* opts which apply to the codec with ID codec_id.
*
* @param s Corresponding format context.
* @param st A stream from s for which the options should be filtered.
* @return a pointer to the created dictionary
*/
AVDictionary *filter_codec_opts(AVDictionary *opts, AVCodec *codec,
AVFormatContext *s, AVStream *st);
/**
* Setup AVCodecContext options for avformat_find_stream_info().
*
* Create an array of dictionaries, one dictionary for each stream
* contained in s.
* Each dictionary will contain the options from codec_opts which can
* be applied to the corresponding stream codec context.
*
* @return pointer to the created array of dictionaries, NULL if it
* cannot be created
*/
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
AVDictionary *codec_opts);
void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec);
/**
* Print an error message to stderr, indicating filename and a human
@@ -258,7 +171,7 @@ void print_error(const char *filename, int err);
* current version of the repository and of the libav* libraries used by
* the program.
*/
void show_banner(int argc, char **argv, const OptionDef *options);
void show_banner(void);
/**
* Print the version of the program to stdout. The version message
@@ -317,12 +230,6 @@ int opt_protocols(const char *opt, const char *arg);
*/
int opt_pix_fmts(const char *opt, const char *arg);
/**
* Print a listing containing all the sample formats supported by the
* program.
*/
int show_sample_fmts(const char *opt, const char *arg);
/**
* Return a positive value if a line read from standard input
* starts with [yY], otherwise return 0.
@@ -338,7 +245,7 @@ int read_yesno(void);
* @return 0 in case of success, a negative value corresponding to an
* AVERROR error code in case of failure.
*/
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
int read_file(const char *filename, char **bufptr, size_t *size);
/**
* Get a file corresponding to a preset file.
@@ -361,20 +268,4 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
FILE *get_preset_file(char *filename, size_t filename_size,
const char *preset_name, int is_path, const char *codec_name);
/**
* Do all the necessary cleanup and abort.
* This function is implemented in the avtools, not cmdutils.
*/
void exit_program(int ret);
/**
* Realloc array to hold new_size elements of elem_size.
* Calls exit_program() on failure.
*
* @param elem_size size in bytes of each element
* @param size new element count will be written here
* @return reallocated array
*/
void *grow_array(void *array, int elem_size, int *size, int new_size);
#endif /* CMDUTILS_H */
#endif /* FFMPEG_CMDUTILS_H */

View File

@@ -10,9 +10,4 @@
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "v", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" },
{ "report", 0, {(void*)opt_report}, "generate a report" },
{ "max_alloc", HAS_ARG, {(void*)opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },

View File

@@ -10,7 +10,7 @@ ifndef SUBDIR
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC CXX AS YASM AR LD HOSTCC STRIP CP
BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
SILENT = DEPCC YASMDEP RM RANLIB
MSG = $@
M = @$(call ECHO,$(TAG),$@);
@@ -20,38 +20,20 @@ $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
endif
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
IFLAGS := -I. -I$(SRC_PATH)
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
CFLAGS += $(ECFLAGS)
YASMFLAGS += $(IFLAGS) -Pconfig.asm
# NASM requires -I path terminated with /
IFLAGS := -I. -I$(SRC_PATH)/
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
CFLAGS += $(ECFLAGS)
CCFLAGS = $(CFLAGS)
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
YASMFLAGS += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
HOSTCFLAGS += $(IFLAGS)
LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
define COMPILE
$($(1)DEP)
$($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
endef
COMPILE_C = $(call COMPILE,CC)
COMPILE_CXX = $(call COMPILE,CXX)
COMPILE_S = $(call COMPILE,AS)
%.o: %.c
$(COMPILE_C)
%.o: %.cpp
$(COMPILE_CXX)
%.s: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
$(CCDEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
%.o: %.S
$(COMPILE_S)
$(ASDEP)
$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
%.ho: %.h
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
@@ -79,51 +61,31 @@ OBJS += $(OBJS-yes)
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
FFLDFLAGS := $(addprefix -Llib,$(ALLFFLIBS)) $(LDFLAGS)
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
TOOLS += $(TOOLS-yes)
TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS) $(TESTPROGS:%=%-test.o))
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
alltools: $(TOOLS)
$(HOSTOBJS): %.o: %.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
$(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
$(OBJS): | $(sort $(dir $(OBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
$(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver *.gcno *.gcda
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
define RULES
clean::
$(RM) $(OBJS) $(OBJS:.o=.d)
$(RM) $(HOSTPROGS)
$(RM) $(TOOLS)
endef
$(eval $(RULES))
-include $(wildcard $(OBJS:.o=.d) $(TESTOBJS:.o=.d))

722
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -13,240 +13,7 @@ libavutil: 2011-04-18
API changes, most recent first:
2014-09-16 - 8637f4e - lavu 51.22.3 - cpu.h
Add AV_CPU_FLAG_CMOV.
2012-01-24 - xxxxxxx - lavfi 2.60.100
Add avfilter_graph_dump.
2012-01-25 - lavf 53.31.100 / 53.22.0
3c5fe5b / f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
muxers supporting it (av_write_frame makes sure it is called
only for muxers with this flag).
2012-03-04 - 7f3f855 - lavu 51.22.1 - error.h
Add AVERROR_UNKNOWN
2012-02-29 - 2ad77c6 - lavf 53.21.1
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
2012-02-29 - a1556d3 - lavu 51.22.0 - intfloat.h
Add a new installed header libavutil/intfloat.h with int/float punning
functions.
2012-02-17 - 350d06d - lavc 53.35.0
Add avcodec_is_open() function.
2012-01-15 - lavc 53.56.105 / 53.34.0
New audio encoding API:
67f5650 / b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
encoders.
67f5650 / 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
67f5650 / b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
Add AVCodec.encode2().
2012-01-12 - b18e17e / 3167dc9 - lavfi 2.59.100 / 2.15.0
Add a new installed header -- libavfilter/version.h -- with version macros.
2011-12-08 - a502939 - lavfi 2.52.0
Add av_buffersink_poll_frame() to buffersink.h.
2011-12-08 - xxxxxxx - lavu 51.31.0
Add av_log_format_line.
2011-12-03 - xxxxxxx - lavu 51.30.0
Add AVERROR_BUG.
2011-xx-xx - xxxxxxx - lavu 51.28.1
Add av_get_alt_sample_fmt() to samplefmt.h.
2011-11-03 - 96949da - lavu 51.23.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-10-20 - b35e9e1 - lavu 51.22.0
Add av_strtok() to avstring.h.
2012-01-03 - ad1c8dd / b73ec05 - lavu 51.34.100 / 51.21.0
Add av_popcount64
2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
Deprecate AVFrame.age. The field is unused.
2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
Add avformat_close_input().
Deprecate av_close_input_file() and av_close_input_stream().
2011-12-02 - e4de716 / 0eea212 - lavc 53.40.0 / 53.25.0
Add nb_samples and extended_data fields to AVFrame.
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
audio decoders to use get_buffer().
2011-12-04 - e4de716 / 560f773 - lavc 53.40.0 / 53.24.0
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
Change AVCodecContext.error[4] to [8] at next major bump.
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
2011-11-23 - 8e576d5 / bbb46f3 - lavu 51.27.0 / 51.18.0
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
av_samples_alloc(), to samplefmt.h.
2011-11-23 - 8e576d5 / 8889cc4 - lavu 51.27.0 / 51.17.0
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
2011-11-19 - dbb38bc / f3a29b7 - lavc 53.36.0 / 53.21.0
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
which is accessed from a new field, AVCodecContext.internal.
- fields moved:
AVCodecContext.internal_buffer --> AVCodecInternal.buffer
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
AVCodecContext.is_copy --> AVCodecInternal.is_copy
2011-11-16 - 8709ba9 / 6270671 - lavu 51.26.0 / 51.16.0
Add av_timegm()
2011-11-13 - lavf 53.21.0 / 53.15.0
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
interrupt callbacks.
5f268ca / 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
AVFormatContext.
5f268ca / 1dee0ac Add avio_open2() with additional parameters. Those are
an interrupt callback and an options AVDictionary.
This will allow passing AVOptions to protocols after lavf
54.0.
2011-11-06 - 13b7781 / ba04ecf - lavu 51.24.0 / 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-11-06 - 13b7781 / 07b172f - lavu 51.24.0 / 51.13.0
Add av_toupper()/av_tolower()
2011-11-05 - d8cab5c / b6d08f4 - lavf 53.19.0 / 53.13.0
Add avformat_network_init()/avformat_network_uninit()
2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
Remove avcodec_parse_frame.
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
2011-10-19 - d049257 / 569129a - lavf 53.17.0 / 53.10.0
Add avformat_new_stream(). Deprecate av_new_stream().
2011-10-13 - 91eb1b1 / b631fba - lavf 53.16.0 / 53.9.0
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
2011-10-12 - lavu 51.21.0 / 51.12.0
AVOptions API rewrite.
- f884ef0 / 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
- new setting/getting functions with slightly different semantics:
f884ef0 / dac66da av_set_string3 -> av_opt_set
av_set_double -> av_opt_set_double
av_set_q -> av_opt_set_q
av_set_int -> av_opt_set_int
f884ef0 / 41d9d51 av_get_string -> av_opt_get
av_get_double -> av_opt_get_double
av_get_q -> av_opt_get_q
av_get_int -> av_opt_get_int
- f884ef0 / 8c5dcaa trivial rename av_next_option -> av_opt_next
- f884ef0 / 641c7af new functions - av_opt_child_next, av_opt_child_class_next
and av_opt_find2()
2011-09-22 - a70e787 - lavu 51.17.0
Add av_x_if_null().
2011-09-18 - 645cebb - lavc 53.16.0
Add showall flag2
2011-09-16 - ea8de10 - lavfi 2.42.0
Add avfilter_all_channel_layouts.
2011-09-16 - 9899037 - lavfi 2.41.0
Rename avfilter_all_* function names to avfilter_make_all_*.
In particular, apply the renames:
avfilter_all_formats -> avfilter_make_all_formats
avfilter_all_channel_layouts -> avfilter_make_all_channel_layouts
avfilter_all_packing_formats -> avfilter_make_all_packing_formats
2011-09-12 - 4381bdd - lavfi 2.40.0
Change AVFilterBufferRefAudioProps.sample_rate type from uint32_t to int.
2011-09-12 - 2c03174 - lavfi 2.40.0
Simplify signature for avfilter_get_audio_buffer(), make it
consistent with avfilter_get_video_buffer().
2011-09-06 - 4f7dfe1 - lavfi 2.39.0
Rename libavfilter/vsink_buffer.h to libavfilter/buffersink.h.
2011-09-06 - c4415f6 - lavfi 2.38.0
Unify video and audio sink API.
In particular, add av_buffersink_get_buffer_ref(), deprecate
av_vsink_buffer_get_video_buffer_ref() and change the value for the
opaque field passed to the abuffersink init function.
2011-09-04 - 61e2e29 - lavu 51.16.0
Add av_asprintf().
2011-08-22 - dacd827 - lavf 53.10.0
Add av_find_program_from_stream().
2011-08-20 - 69e2c1a - lavu 51.13.0
Add av_get_media_type_string().
2011-09-03 - 1889c67 / fb4ca26 - lavc 53.13.0
lavf 53.11.0
lsws 2.1.0
Add {avcodec,avformat,sws}_get_class().
2011-08-03 - 1889c67 / c11fb82 - lavu 51.15.0
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
2011-08-14 - 323b930 - lavu 51.12.0
Add av_fifo_peek2(), deprecate av_fifo_peek().
2011-08-26 - lavu 51.14.0 / 51.9.0
- 976a8b2 / add41de..976a8b2 / abc78a5 Do not include intfloat_readwrite.h,
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
2011-08-16 - 27fbe31 / 48f9e45 - lavf 53.11.0 / 53.8.0
Add avformat_query_codec().
2011-08-16 - 27fbe31 / bca06e7 - lavc 53.11.0
Add avcodec_get_type().
2011-08-06 - 0cb233c / 2f63440 - lavf 53.7.0
Add error_recognition to AVFormatContext.
2011-08-02 - 1d186e9 / 9d39cbf - lavc 53.9.1
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
2011-07-16 - b57df29 - lavfi 2.27.0
Add audio packing negotiation fields and helper functions.
In particular, add AVFilterPacking enum, planar, in_packings and
out_packings fields to AVFilterLink, and the functions:
avfilter_set_common_packing_formats()
avfilter_all_packing_formats()
2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
Add avformat_find_stream_info(), deprecate av_find_stream_info().
2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
Add function av_get_output_timestamp().
2011-06-28 - 5129336 - lavu 51.11.0 - avutil.h
Define the AV_PICTURE_TYPE_NONE value in AVPictureType enum.
2011-06-19 - fd2c0a5 - lavfi 2.23.0 - avfilter.h
2011-06-19 - xxxxxxx - lavfi 2.23.0 - avfilter.h
Add layout negotiation fields and helper functions.
In particular, add in_chlayouts and out_chlayouts to AVFilterLink,
@@ -255,7 +22,7 @@ API changes, most recent first:
avfilter_set_common_channel_layouts()
avfilter_all_channel_layouts()
2011-06-19 - 527ca39 - lavfi 2.22.0 - AVFilterFormats
2011-06-19 - xxxxxxx - lavfi 2.22.0 - AVFilterFormats
Change type of AVFilterFormats.formats from int * to int64_t *,
and update formats handling API accordingly.
@@ -263,48 +30,45 @@ API changes, most recent first:
it to int64_t. A new function, avfilter_make_format64_list(), that
takes int64_t arrays has been added.
2011-06-19 - 44f669e - lavfi 2.21.0 - vsink_buffer.h
2011-06-19 - xxxxxxx - lavfi 2.21.0 - vsink_buffer.h
Add video sink buffer and vsink_buffer.h public header.
2011-06-12 - 9fdf772 - lavfi 2.18.0 - avcodec.h
2011-06-12 - xxxxxxx - lavfi 2.18.0 - avcodec.h
Add avfilter_get_video_buffer_ref_from_frame() function in
libavfilter/avcodec.h.
2011-06-12 - c535494 - lavfi 2.17.0 - avfiltergraph.h
2011-06-12 - xxxxxxx - lavfi 2.17.0 - avfiltergraph.h
Add avfilter_inout_alloc() and avfilter_inout_free() functions.
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
2011-06-12 - xxxxxxx - lavfi 2.16.0 - avfilter_graph_parse()
Change avfilter_graph_parse() signature.
2011-06-23 - 686959e / 67e9ae1 - lavu 51.10.0 / 51.8.0 - attributes.h
Add av_printf_format().
2011-06-16 - 2905e3f / 05e84c9, 2905e3f / 25de595 - lavf 53.4.0 / 53.2.0 - avformat.h
2011-06-xx - xxxxxxx - lavf 53.2.0 - avformat.h
Add avformat_open_input and avformat_write_header().
Deprecate av_open_input_stream, av_open_input_file,
AVFormatParameters and av_write_header.
2011-06-16 - 2905e3f / 7e83e1c, 2905e3f / dc59ec5 - lavu 51.9.0 / 51.7.0 - opt.h
2011-06-xx - xxxxxxx - lavu 51.7.0 - opt.h
Add av_opt_set_dict() and av_opt_find().
Deprecate av_find_opt().
Add AV_DICT_APPEND flag.
2011-06-10 - 45fb647 / cb7c11c - lavu 51.6.0 - opt.h
2011-06-xx - xxxxxxx - lavu 51.6.0 - opt.h
Add av_opt_flag_is_set().
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
2011-06-09 - f9ecb84 / d9f80ea - lavu 51.8.0 - AVMetadata
2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata
Move AVMetadata from lavf to lavu and rename it to
AVDictionary -- new installed header dict.h.
All av_metadata_* functions renamed to av_dict_*.
2011-06-07 - d552f61 / a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
2011-06-07 - a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
Deprecate av_get_bits_per_sample_fmt().
2011-06-05 - f956924 / b39b062 - lavu 51.8.0 - opt.h
2011-06-xx - b39b062 - lavu 51.8.0 - opt.h
Add av_opt_free convenience function.
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
@@ -334,7 +98,7 @@ API changes, most recent first:
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
2011-05-25 - 39e4206 / 30315a8 - lavf 53.3.0 - avformat.h
2011-05-25 - 30315a8 - lavf 53.3.0 - avformat.h
Add fps_probe_size to AVFormatContext.
2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
@@ -350,10 +114,10 @@ API changes, most recent first:
2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
2011-05-18 - 75a37b5 / 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
2011-05-18 - 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
Add request_sample_fmt field to AVCodecContext.
2011-05-10 - 59eb12f / 188dea1 - lavc 53.6.0 - avcodec.h
2011-05-10 - 188dea1 - lavc 53.6.0 - avcodec.h
Deprecate AVLPCType and the following fields in
AVCodecContext: lpc_coeff_precision, prediction_order_method,
min_partition_order, max_partition_order, lpc_type, lpc_passes.
@@ -383,81 +147,82 @@ API changes, most recent first:
Add av_dynarray_add function for adding
an element to a dynamic array.
2011-04-26 - d7e5aeb / bebe72f - lavu 51.1.0 - avutil.h
2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h
Add AVPictureType enum and av_get_picture_type_char(), deprecate
FF_*_TYPE defines and av_get_pict_type_char() defined in
libavcodec/avcodec.h.
2011-04-26 - d7e5aeb / 10d3940 - lavfi 2.3.0 - avfilter.h
2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h
Add pict_type and key_frame fields to AVFilterBufferRefVideo.
2011-04-26 - d7e5aeb / 7a11c82 - lavfi 2.2.0 - vsrc_buffer
2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer
Add sample_aspect_ratio fields to vsrc_buffer arguments
2011-04-21 - 8772156 / 94f7451 - lavc 53.1.0 - avcodec.h
2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
2011-04-15 - lavc 52.120.0 - avcodec.h
AVPacket structure got additional members for passing side information:
c407984 / 4de339e introduce side information for AVPacket
c407984 / 2d8591c make containers pass palette change in AVPacket
4de339e introduce side information for AVPacket
2d8591c make containers pass palette change in AVPacket
2011-04-12 - lavf 52.107.0 - avio.h
Avio cleanup, part II - deprecate the entire URLContext API:
c55780d / 175389c add avio_check as a replacement for url_exist
9891004 / ff1ec0c add avio_pause and avio_seek_time as replacements
175389c add avio_check as a replacement for url_exist
ff1ec0c add avio_pause and avio_seek_time as replacements
for _av_url_read_fseek/fpause
d4d0932 / cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
should be used instead.
c88caa5 / 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
c88caa5 / f87b1b3 rename open flags: URL_* -> AVIO_*
d4d0932 / f8270bb add avio_enum_protocols.
d4d0932 / 5593f03 deprecate URLProtocol.
d4d0932 / c486dad deprecate URLContext.
d4d0932 / 026e175 deprecate the typedef for URLInterruptCB
c88caa5 / 8e76a19 deprecate av_register_protocol2.
11d7841 / b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
11d7841 / 1305d93 deprecate av_url_read_seek
11d7841 / fa104e1 deprecate av_url_read_pause
434f248 / 727c7aa deprecate url_get_filename().
434f248 / 5958df3 deprecate url_max_packet_size().
434f248 / 1869ea0 deprecate url_get_file_handle().
434f248 / 32a97d4 deprecate url_filesize().
434f248 / e52a914 deprecate url_close().
434f248 / 58a48c6 deprecate url_seek().
434f248 / 925e908 deprecate url_write().
434f248 / dce3756 deprecate url_read_complete().
434f248 / bc371ac deprecate url_read().
434f248 / 0589da0 deprecate url_open().
434f248 / 62eaaea deprecate url_connect.
434f248 / 5652bb9 deprecate url_alloc.
434f248 / 333e894 deprecate url_open_protocol
434f248 / e230705 deprecate url_poll and URLPollEntry
80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
f87b1b3 rename open flags: URL_* -> AVIO_*
f8270bb add avio_enum_protocols.
5593f03 deprecate URLProtocol.
c486dad deprecate URLContext.
026e175 deprecate the typedef for URLInterruptCB
8e76a19 deprecate av_register_protocol2.
b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
1305d93 deprecate av_url_read_seek
fa104e1 deprecate av_url_read_pause
727c7aa deprecate url_get_filename().
5958df3 deprecate url_max_packet_size().
1869ea0 deprecate url_get_file_handle().
32a97d4 deprecate url_filesize().
e52a914 deprecate url_close().
58a48c6 deprecate url_seek().
925e908 deprecate url_write().
dce3756 deprecate url_read_complete().
bc371ac deprecate url_read().
0589da0 deprecate url_open().
62eaaea deprecate url_connect.
5652bb9 deprecate url_alloc.
333e894 deprecate url_open_protocol
e230705 deprecate url_poll and URLPollEntry
2011-04-08 - lavf 52.106.0 - avformat.h
Minor avformat.h cleanup:
d4d0932 / a9bf9d8 deprecate av_guess_image2_codec
d4d0932 / c3675df rename avf_sdp_create->av_sdp_create
a9bf9d8 deprecate av_guess_image2_codec
c3675df rename avf_sdp_create->av_sdp_create
2011-04-03 - lavf 52.105.0 - avio.h
Large-scale renaming/deprecating of AVIOContext-related functions:
2cae980 / 724f6a0 deprecate url_fdopen
2cae980 / 403ee83 deprecate url_open_dyn_packet_buf
2cae980 / 6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
2cae980 / b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
2cae980 / 8978fed introduce an AVIOContext.seekable field as a replacement for
724f6a0 deprecate url_fdopen
403ee83 deprecate url_open_dyn_packet_buf
6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
8978fed introduce an AVIOContext.seekable field as a replacement for
AVIOContext.is_streamed and url_is_streamed()
1caa412 / b64030f deprecate get_checksum()
1caa412 / 4c4427a deprecate init_checksum()
2fd41c9 / 4ec153b deprecate udp_set_remote_url/get_local_port
4fa0e24 / 933e90a deprecate av_url_read_fseek/fpause
4fa0e24 / 8d9769a deprecate url_fileno
0fecf26 / b7f2fdd rename put_flush_packet -> avio_flush
0fecf26 / 35f1023 deprecate url_close_buf
0fecf26 / 83fddae deprecate url_open_buf
0fecf26 / d9d86e0 rename url_fprintf -> avio_printf
0fecf26 / 59f65d9 deprecate url_setbufsize
6947b0c / 3e68b3b deprecate url_ferror
b64030f deprecate get_checksum()
4c4427a deprecate init_checksum()
4ec153b deprecate udp_set_remote_url/get_local_port
933e90a deprecate av_url_read_fseek/fpause
8d9769a deprecate url_fileno
b7f2fdd rename put_flush_packet -> avio_flush
35f1023 deprecate url_close_buf
83fddae deprecate url_open_buf
d9d86e0 rename url_fprintf -> avio_printf
59f65d9 deprecate url_setbufsize
3e68b3b deprecate url_ferror
66e5b1d deprecate url_feof
e8bb2e2 deprecate url_fget_max_packet_size
76aa876 rename url_fsize -> avio_size
e519753 deprecate url_fgetc
@@ -478,7 +243,7 @@ API changes, most recent first:
b3db9ce deprecate get_partial_buffer
8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
2011-03-25 - 27ef7b1 / 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
Add audio_service_type field to AVCodecContext.
2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h
@@ -516,11 +281,11 @@ API changes, most recent first:
2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
2011-02-09 - c0b102c - lavc 52.112.0 - avcodec_thread_init()
2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init()
Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
set thread_count before calling avcodec_open.
2011-02-09 - 37b00b4 - lavc 52.111.0 - threading API
2011-02-09 - 778b08a - lavc 52.111.0 - threading API
Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
Add thread_type and active_thread_type fields to AVCodecContext.

View File

@@ -1,64 +0,0 @@
MANPAGES = $(PROGS-yes:%=doc/%.1)
PODPAGES = $(PROGS-yes:%=doc/%.pod)
HTMLPAGES = $(PROGS-yes:%=doc/%.html) \
doc/developer.html \
doc/faq.html \
doc/fate.html \
doc/general.html \
doc/git-howto.html \
doc/libavfilter.html \
doc/platform.html \
TXTPAGES = doc/fate.txt \
DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
ifdef HAVE_MAKEINFO
DOCS += $(TXTPAGES)
endif
all-$(CONFIG_DOC): documentation
documentation: $(DOCS)
TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
doc/%.txt: TAG = TXT
doc/%.txt: doc/%.texi
$(Q)$(TEXIDEP)
$(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
doc/%.html: TAG = HTML
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
$(Q)$(TEXIDEP)
$(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
doc/%.pod: TAG = POD
doc/%.pod: doc/%.texi
$(Q)$(TEXIDEP)
$(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
doc/%.1: TAG = MAN
doc/%.1: doc/%.pod
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
$(DOCS): | doc
OBJDIRS += doc
install-progs-$(CONFIG_DOC): install-man
install-man: $(MANPAGES)
$(Q)mkdir -p "$(MANDIR)/man1"
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
uninstall: uninstall-man
uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
clean::
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
-include $(wildcard $(DOCS:%=%.d))
.PHONY: documentation

View File

@@ -1,15 +1,28 @@
Release Notes
=============
* 0.10 "Freedom" January, 2012
* 0.8 "Love" June, 2011
* 0.7.1 "Peace" June, 2011 (identical to 0.8 but using 0.6 ABI/API)
General notes
-------------
This release is binary compatible with 0.8 and 0.9.
See the Changelog file for a list of significant changes. Note, there
are many more new features and bugfixes than whats listed there.
This release enables frame-based multithreaded decoding for a number of codecs,
including theora, huffyuv, VP8, H.263, mpeg4 and H.264. Additionally, there has
been a major cleanup of
both internal and external APIs. For this reason, the major versions of all
libraries except libpostproc have been bumped. This means that 0.8 can be installed
side-by-side with previous releases, on the other hand applications need to be
recompiled to use 0.8.
Other important changes are more than 200 bugfixes, known regressions were fixed
w.r.t 0.5 and 0.6, additions of decoders including, but not limited to,
AMR-WB, single stream LATM/LOAS, G.722 ADPCM, a native VP8 decoder
and HE-AACv2. Additionally, many new de/muxers such as WebM in Matroska, Apple
HTTP Live Streaming, SAP, IEC 61937 (S/PDIF) have been added.
See the Changelog file for a list of significant changes.
Bugreports against FFmpeg git master or the most recent FFmpeg release are
accepted. If you are experiencing issues with any formally released version of
@@ -17,33 +30,36 @@ FFmpeg, please try git master to check if the issue still exists. If it does,
make your report against the development code following the usual bug reporting
guidelines.
Note, if you have difficulty building for mingw, try --disable-outdev=sdl
API changes
-----------
A number of additional APIs have been introduced and some existing
functions have been deprecated and are scheduled for removal in the next
release. Significant API changes include:
* new audio decoding API which decodes from an AVPacket to an AVFrame and
is able to use AVCodecContext.get_buffer() in the similar way as video decoding.
* new audio encoding API which encodes from an AVFrame to an AVPacket, thus
allowing it to properly output timing information and side data.
Please see the git history and the file doc/APIchanges for details.
Please see git log of the public headers or the file doc/APIchanges for
programmer-centric information. Note that some long-time deprecated APIs have
been removed. Also, a number of additional APIs have been deprecated and might
be removed in the next release.
Other notable changes
---------------------
Libavcodec and libavformat built as shared libraries now hide non-public
symbols. This will break applications using those symbols. Possible solutions
are, in order of preference:
1) Try finding a way of accomplishing the same with public API.
2) If there is no corresponding public API, but you think there should be,
post a request on the developer mailing list or IRC channel.
3) Finally if your program needs access to FFmpeg / libavcodec / libavformat
internals for some special reason then the best solution is to link statically.
Please see the Changelog file and git history for a more detailed list of changes.
- high quality dithering in swscale to fix banding issues
- ffmpeg is now interactive and various information can be turned on/off while its running
- resolution changing support in ffmpeg
- sdl output device
- optimizations in libavfilter that make it much faster
- split, buffer, select, lut, negate filters amongth others
- more than 50 new video filters from mplayers libmpcodecs
- many ARM NEON optimizations
- nonfree libfaad support for AAC decoding removed
- 4:4:4 H.264 decoding
- 9/10bit H.264 decoding
- Win64 Assembler support
- native MMSH/MMST support
- Windows TV demuxing
- native AMR-WB decoding
- native GSM-MS decoding
- SMPTE 302M decoding
- AVS encoding

82
doc/TODO Normal file
View File

@@ -0,0 +1,82 @@
ffmpeg TODO list:
----------------
Fabrice's TODO list: (unordered)
-------------------
Short term:
- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
- add RTSP regression test (both client and server)
- make ffserver allocate AVFormatContext
- clean up (incompatible change, for 0.5.0):
* AVStream -> AVComponent
* AVFormatContext -> AVInputStream/AVOutputStream
* suppress rate_emu from AVCodecContext
- add new float/integer audio filterting and conversion : suppress
CODEC_ID_PCM_xxc and use CODEC_ID_RAWAUDIO.
- fix telecine and frame rate conversion
Long term (ask me if you want to help):
- commit new imgconvert API and new PIX_FMT_xxx alpha formats
- commit new LGPL'ed float and integer-only AC3 decoder
- add WMA integer-only decoder
- add new MPEG4-AAC audio decoder (both integer-only and float version)
Michael's TODO list: (unordered) (if anyone wanna help with sth, just ask)
-------------------
- optimize H264 CABAC
- more optimizations
- simper rate control
Philip'a TODO list: (alphabetically ordered) (please help)
------------------
- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
than one big file.
- Authenticated users support -- where the authentication is in the URL
- Change ASF files so that the embedded timestamp in the frames is right rather
than being an offset from the start of the stream
- Make ffm files more resilient to changes in the codec structures so that you
can play old ffm files.
Baptiste's TODO list:
-----------------
- mov edit list support (AVEditList)
- YUV 10 bit per component support "2vuy"
- mxf muxer
- mpeg2 non linear quantizer
unassigned TODO: (unordered)
---------------
- use AVFrame for audio codecs too
- rework aviobuf.c buffering strategy and fix url_fskip
- generate optimal huffman tables for mjpeg encoding
- fix ffserver regression tests
- support xvids motion estimation
- support x264s motion estimation
- support x264s rate control
- SNOW: non translational motion compensation
- SNOW: more optimal quantization
- SNOW: 4x4 block support
- SNOW: 1/8 pel motion compensation support
- SNOW: iterative motion estimation based on subsampled images
- SNOW: try B frames and MCTF and see how their PSNR/bitrate/complexity behaves
- SNOW: try to use the wavelet transformed MC-ed reference frame as context for the entropy coder
- SNOW: think about/analyize how to make snow use multiple cpus/threads
- SNOW: finish spec
- FLAC: lossy encoding (viterbi and naive scalar quantization)
- libavfilter
- JPEG2000 decoder & encoder
- MPEG4 GMC encoding support
- macroblock based pixel format (better cache locality, somewhat complex, one paper claimed it faster for high res)
- regression tests for codecs which do not have an encoder (I+P-frame bitstream in the 'master' branch)
- add support for using mplayers video filters to ffmpeg
- H264 encoder
- per MB ratecontrol (so VCD and such do work better)
- write a script which iteratively changes all functions between always_inline and noinline and benchmarks the result to find the best set of inlined functions
- convert all the non SIMD asm into small asm vs. C testcases and submit them to the gcc devels so they can improve gcc
- generic audio mixing API
- extract PES packetizer from PS muxer and use it for new TS muxer
- implement automatic AVBistreamFilter activation
- make cabac encoder use bytestream (see http://trac.videolan.org/x264/changeset/?format=diff&new=651)
- merge imdct and windowing, the current code does considerable amounts of redundant work

View File

@@ -1,168 +0,0 @@
All the numerical options, if not specified otherwise, accept in input
a string representing a number, which may contain one of the
International System number postfixes, for example 'K', 'M', 'G'.
If 'i' is appended after the postfix, powers of 2 are used instead of
powers of 10. The 'B' postfix multiplies the value for 8, and can be
appended after another postfix or used alone. This allows using for
example 'KB', 'MiB', 'G' and 'B' as postfix.
Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing
with "no" the option name, for example using "-nofoo" in the
command line will set to false the boolean option with name "foo".
@anchor{Stream specifiers}
@section Stream specifiers
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
are used to precisely specify which stream(s) does a given option belong to.
A stream specifier is a string generally appended to the option name and
separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
@code{a:1} stream specifer, which matches the second audio stream. Therefore it
would select the ac3 codec for the second audio stream.
A stream specifier can match several stream, the option is then applied to all
of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
streams.
An empty stream specifier matches all streams, for example @code{-codec copy}
or @code{-codec: copy} would copy all the streams without reencoding.
Possible forms of stream specifiers are:
@table @option
@item @var{stream_index}
Matches the stream with this index. E.g. @code{-threads:1 4} would set the
thread count for the second stream to 4.
@item @var{stream_type}[:@var{stream_index}]
@var{stream_type} is one of: 'v' for video, 'a' for audio, 's' for subtitle,
'd' for data and 't' for attachments. If @var{stream_index} is given, then
matches stream number @var{stream_index} of this type. Otherwise matches all
streams of this type.
@item p:@var{program_id}[:@var{stream_index}]
If @var{stream_index} is given, then matches stream number @var{stream_index} in
program with id @var{program_id}. Otherwise matches all streams in this program.
@end table
@section Generic options
These options are shared amongst the av* tools.
@table @option
@item -L
Show license.
@item -h, -?, -help, --help
Show help.
@item -version
Show version.
@item -formats
Show available formats.
The fields preceding the format names have the following meanings:
@table @samp
@item D
Decoding available
@item E
Encoding available
@end table
@item -codecs
Show available codecs.
The fields preceding the codec names have the following meanings:
@table @samp
@item D
Decoding available
@item E
Encoding available
@item V/A/S
Video/audio/subtitle codec
@item S
Codec supports slices
@item D
Codec supports direct rendering
@item T
Codec can handle input truncated at random locations instead of only at frame boundaries
@end table
@item -bsfs
Show available bitstream filters.
@item -protocols
Show available protocols.
@item -filters
Show available libavfilter filters.
@item -pix_fmts
Show available pixel formats.
@item -sample_fmts
Show available sample formats.
@item -loglevel @var{loglevel} | -v @var{loglevel}
Set the logging level used by the library.
@var{loglevel} is a number or a string containing one of the following values:
@table @samp
@item quiet
@item panic
@item fatal
@item error
@item warning
@item info
@item verbose
@item debug
@end table
By default the program logs to stderr, if coloring is supported by the
terminal, colors are used to mark errors and warnings. Log coloring
can be disabled setting the environment variable
@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
the environment variable @env{AV_LOG_FORCE_COLOR}.
The use of the environment variable @env{NO_COLOR} is deprecated and
will be dropped in a following FFmpeg version.
@item -report
Dump full command line and console output to a file named
@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
directory.
This file can be useful for bug reports.
It also implies @code{-loglevel verbose}.
Note: setting the environment variable @code{FFREPORT} to any value has the
same effect.
@end table
@section AVOptions
These options are provided directly by the libavformat, libavdevice and
libavcodec libraries. To see the list of available AVOptions, use the
@option{-help} option. They are separated into two categories:
@table @option
@item generic
These options can be set for any container, codec or device. Generic options
are listed under AVFormatContext options for containers/devices and under
AVCodecContext options for codecs.
@item private
These options are specific to the given container, device or codec. Private
options are listed under their corresponding containers/devices/codecs.
@end table
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
an MP3 file, use the @option{id3v2_version} private option of the MP3
muxer:
@example
ffmpeg -i input.flac -id3v2_version 3 out.mp3
@end example
All codec AVOptions are obviously per-stream, so the chapter on stream
specifiers applies to them
Note @option{-nooption} syntax cannot be used for boolean AVOptions,
use @option{-option 0}/@option{-option 1}.
Note2 old undocumented way of specifying per-stream AVOptions by prepending
v/a/s to the options name is now obsolete and will be removed soon.

View File

@@ -23,20 +23,6 @@ Below is a description of the currently available bitstream filters.
@section h264_mp4toannexb
Convert an H.264 bitstream from length prefixed mode to start code
prefixed mode (as defined in the Annex B of the ITU-T H.264
specification).
This is required by some streaming formats, typically the MPEG-2
transport stream format ("mpegts").
For example to remux an MP4 file containing an H.264 stream to mpegts
format with @command{ffmpeg}, you can use the command:
@example
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
@end example
@section imx_dump_header
@section mjpeg2jpeg
@@ -48,7 +34,7 @@ JPEG image. The individual frames can be extracted without loss,
e.g. by
@example
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
@end example
Unfortunately, these chunks are incomplete JPEG images, because
@@ -71,9 +57,9 @@ stream (carrying the AVI1 header ID and lacking a DHT segment) to
produce fully qualified JPEG images.
@example
ffmpeg -i mjpeg-movie.avi -c:v copy -vbsf mjpeg2jpeg frame_%d.jpg
ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
exiftran -i -9 frame*.jpg
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
@end example
@section mjpega_dump_header

View File

@@ -27,7 +27,7 @@ follows.
@section rawvideo
Raw video decoder.
Rawvideo decoder.
This decoder decodes rawvideo streams.
@@ -48,16 +48,3 @@ top-field-first is assumed
@end table
@c man end VIDEO DECODERS
@chapter Audio Decoders
@c man begin AUDIO DECODERS
@section ffwavesynth
Internal wave synthetizer.
This decoder generates wave patterns according to predefined sequences. Its
use is purely internal and the format of the data it accepts is not publicly
documented.
@c man end AUDIO DECODERS

View File

@@ -49,19 +49,19 @@ sequence of filenames of the form @file{i%m%g-1.jpg},
The size, the pixel format, and the format of each image must be the
same for all the files in the sequence.
The following example shows how to use @command{ffmpeg} for creating a
The following example shows how to use @file{ffmpeg} for creating a
video from the images in the file sequence @file{img-001.jpeg},
@file{img-002.jpeg}, ..., assuming an input frame rate of 10 frames per
@file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per
second:
@example
ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
@end example
Note that the pattern must not necessarily contain "%d" or
"%0@var{N}d", for example to convert a single image file
@file{img.jpeg} you can employ the command:
@example
ffmpeg -i img.jpeg img.png
ffmpeg -f image2 -i img.jpeg img.png
@end example
@section applehttp
@@ -75,34 +75,4 @@ the caller can decide which variant streams to actually receive.
The total bitrate of the variant that the stream belongs to is
available in a metadata key named "variant_bitrate".
@section sbg
SBaGen script demuxer.
This demuxer reads the script language used by SBaGen
@url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
script looks like that:
@example
-SE
a: 300-2.5/3 440+4.5/0
b: 300-2.5/0 440+4.5/3
off: -
NOW == a
+0:07:00 == b
+0:14:00 == a
+0:21:00 == b
+0:30:00 off
@end example
A SBG script can mix absolute and relative timestamps. If the script uses
either only absolute timestamps (including the script start time) or only
relative ones, then its layout is fixed, and the conversion is
straightforward. On the other hand, if the script mixes both kind of
timestamps, then the @var{NOW} reference for relative timestamps will be
taken from the current time of day at the time the script is read, and the
script layout will be frozen according to that reference. That means that if
the script is directly played, the actual times will match the absolute
timestamps up to the sound controller's clock accuracy, but if the user
somehow pauses the playback or seeks, all times will be shifted accordingly.
@c man end INPUT DEVICES

View File

@@ -34,86 +34,9 @@ You can use libavcodec or libavformat in your commercial program, but
@emph{any patch you make must be published}. The best way to proceed is
to send your patches to the FFmpeg mailing list.
@section Contributing
There are 3 ways by which code gets into ffmpeg.
@itemize @bullet
@item Submitting Patches to the main developer mailing list
see @ref{Submitting patches} for details.
@item Directly committing changes to the main tree.
@item Committing changes to a git clone, for example on github.com or
gitorious.org. And asking us to merge these changes.
@end itemize
Whichever way, changes should be reviewed by the maintainer of the code
before they are committed. And they should follow the @ref{Coding Rules}.
The developer making the commit and the author are responsible for their changes
and should try to fix issues their commit causes.
@anchor{Coding Rules}
@section Coding Rules
@subsection Code formatting conventions
There are the following guidelines regarding the indentation in files:
@itemize @bullet
@item
Indent size is 4.
@item
The TAB character is forbidden outside of Makefiles as is any
form of trailing whitespace. Commits containing either will be
rejected by the git repository.
@item
You should try to limit your code lines to 80 characters; however, do so if
and only if this improves readability.
@end itemize
The presentation is one inspired by 'indent -i4 -kr -nut'.
The main priority in FFmpeg is simplicity and small code size in order to
minimize the bug count.
@subsection Comments
Use the JavaDoc/Doxygen format (see examples below) so that code documentation
can be generated automatically. All nontrivial functions should have a comment
above them explaining what the function does, even if it is just one sentence.
All structures and their member variables should be documented, too.
Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace
@code{//!} with @code{///} and similar. Also @@ syntax should be employed
for markup commands, i.e. use @code{@@param} and not @code{\param}.
@example
/**
* @@file
* MPEG codec.
* @@author ...
*/
/**
* Summary sentence.
* more text ...
* ...
*/
typedef struct Foobar@{
int var1; /**< var1 description */
int var2; ///< var2 description
/** var3 description */
int var3;
@} Foobar;
/**
* Summary sentence.
* more text ...
* ...
* @@param my_parameter description of my_parameter
* @@return return value description
*/
int myfunc(int my_parameter)
...
@end example
@subsection C language features
FFmpeg is programmed in the ISO C90 language with a few additional
features from ISO C99, namely:
@itemize @bullet
@@ -145,64 +68,55 @@ mixing statements and declarations;
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
@end itemize
@subsection Naming conventions
All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
for example structs and enums; they should always be in the CamelCase
Indent size is 4.
The presentation is one inspired by 'indent -i4 -kr -nut'.
The TAB character is forbidden outside of Makefiles as is any
form of trailing whitespace. Commits containing either will be
rejected by the git repository.
The main priority in FFmpeg is simplicity and small code size in order to
minimize the bug count.
There are following conventions for naming variables and functions:
@itemize @bullet
@item
For local variables no prefix is required.
@item
For variables and functions declared as @code{static} no prefixes are required.
@item
For variables and functions used internally by the library, @code{ff_} prefix
should be used.
For example, @samp{ff_w64_demuxer}.
@item
For variables and functions used internally across multiple libraries, use
@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}.
@item
For exported names, each library has its own prefixes. Just check the existing
code and name accordingly.
@end itemize
Comments: Use the JavaDoc/Doxygen
format (see examples below) so that code documentation
can be generated automatically. All nontrivial functions should have a comment
above them explaining what the function does, even if it is just one sentence.
All structures and their member variables should be documented, too.
@example
/**
* @@file mpeg.c
* MPEG codec.
* @@author ...
*/
/**
* Summary sentence.
* more text ...
* ...
*/
typedef struct Foobar@{
int var1; /**< var1 description */
int var2; ///< var2 description
/** var3 description */
int var3;
@} Foobar;
/**
* Summary sentence.
* more text ...
* ...
* @@param my_parameter description of my_parameter
* @@return return value description
*/
int myfunc(int my_parameter)
...
@end example
@subsection Miscellanous conventions
@itemize @bullet
@item
fprintf and printf are forbidden in libavformat and libavcodec,
please use av_log() instead.
@item
Casts should be used only when necessary. Unneeded parentheses
should also be avoided if they don't make the code easier to understand.
@end itemize
@subsection Editor configuration
In order to configure Vim to follow FFmpeg formatting conventions, paste
the following snippet into your @file{.vimrc}:
@example
" indentation rules for FFmpeg: 4 spaces, no tabs
set expandtab
set shiftwidth=4
set softtabstop=4
" Allow tabs in Makefiles.
autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
" Trailing whitespace and tabs are forbidden, so highlight them.
highlight ForbiddenWhitespace ctermbg=red guibg=red
match ForbiddenWhitespace /\s\+$\|\t/
" Do not highlight spaces at the end of line while typing on that line.
autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
@end example
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
@example
(setq c-default-style "k&r")
(setq-default c-basic-offset 4)
(setq-default indent-tabs-mode nil)
(setq-default show-trailing-whitespace t)
@end example
@section Development Policy
@@ -264,7 +178,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
Always fill out the commit log message. Describe in a few lines what you
changed and why. You can refer to mailing list postings if you fix a
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
Recommended format:
Recommanded format:
area changed: Short 1 line description
details describing what and why and giving references.
@@ -299,7 +213,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
always check values read from some untrusted source before using them
as array index or other risky things.
@item
Remember to check if you need to bump versions for the specific libav*
Remember to check if you need to bump versions for the specific libav
parts (libavutil, libavcodec, libavformat) you are changing. You need
to change the version integer.
Incrementing the first component means no backward compatibility to
@@ -326,11 +240,9 @@ We think our rules are not too hard. If you have comments, contact us.
Note, these rules are mostly borrowed from the MPlayer project.
@anchor{Submitting patches}
@section Submitting patches
First, read the @ref{Coding Rules} above if you did not yet, in particular
the rules regarding patch submission.
First, read the (@pxref{Coding Rules}) above if you did not yet.
When you submit your patch, please use @code{git format-patch} or
@code{git send-email}. We cannot read other diffs :-)
@@ -345,8 +257,8 @@ for us and greatly increases your chances of getting your patch applied.
Use the patcheck tool of FFmpeg to check your patch.
The tool is located in the tools directory.
Run the @ref{Regression tests} before submitting a patch in order to verify
it does not cause unexpected problems.
Run the regression tests before submitting a patch so that you can
verify that there are no big problems.
Patches should be posted as base64 encoded attachments (or any other
encoding which ensures that the patch will not be trashed during
@@ -380,13 +292,13 @@ send a reminder by email. Your patch should eventually be dealt with.
AVInputFormat/AVOutputFormat struct?
@item
Did you bump the minor version number (and reset the micro version
number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
number) in @file{avcodec.h} or @file{avformat.h}?
@item
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
@item
Did you add the CodecID to @file{avcodec.h}?
@item
If it has a fourCC, did you add it to @file{libavformat/riff.c},
If it has a fourcc, did you add it to @file{libavformat/riff.c},
even if it is only a decoder?
@item
Did you add a rule to compile the appropriate files in the Makefile?
@@ -413,7 +325,7 @@ send a reminder by email. Your patch should eventually be dealt with.
@enumerate
@item
Does @code{make fate} pass with the patch applied?
Does 'make fate' pass with the patch applied?
@item
Was the patch generated with git format-patch or send-email?
@item
@@ -425,7 +337,7 @@ send a reminder by email. Your patch should eventually be dealt with.
@item
Is the patch against latest FFmpeg git master branch?
@item
Are you subscribed to ffmpeg-devel?
Are you subscribed to ffmpeg-dev?
(the list is subscribers only due to spam)
@item
Have you checked that the changes are minimal, so that the same cannot be
@@ -498,23 +410,34 @@ After a patch is approved it will be committed to the repository.
We will review all submitted patches, but sometimes we are quite busy so
especially for large patches this can take several weeks.
If you feel that the review process is too slow and you are willing to try to
take over maintainership of the area of code you change then just clone
git master and maintain the area of code there. We will merge each area from
where its best maintained.
When resubmitting patches, please do not make any significant changes
not related to the comments received during review. Such patches will
be rejected. Instead, submit significant changes or new features as
be rejected. Instead, submit significant changes or new features as
separate patches.
@anchor{Regression tests}
@section Regression tests
Before submitting a patch (or committing to the repository), you should at least
test that you did not break anything.
Running 'make fate' accomplishes this, please see @url{fate.html} for details.
The regression tests build a synthetic video stream and a synthetic
audio stream. These are then encoded and decoded with all codecs or
formats. The CRC (or MD5) of each generated file is recorded in a
result file. A 'diff' is launched to compare the reference results and
the result file. The output is checked immediately after each test
has run.
The regression tests then go on to test the FFserver code with a
limited set of streams. It is important that this step runs correctly
as well.
Run 'make test' to test all the codecs and formats. Commands like
'make regtest-mpeg2' can be used to run a single test. By default,
make will abort if any test fails. To run all tests regardless,
use make -k. To get a more verbose output, use 'make V=1 test' or
'make V=2 test'.
Run 'make fulltest' to test all the codecs, formats and FFserver.
[Of course, some patches may change the results of the regression tests. In
this case, the reference results of the regression tests shall be modified

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
</div>
<div id="footer">
Generated on $datetime for $projectname by&#160;<a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion
</div>
</div>
</body>
</html>

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath$doxy_stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<div id="container">
<div id="body">
<div>

View File

@@ -320,10 +320,10 @@ apply Dolby Surround EX processing.
Not Indicated (default)
@item 1
@itemx on
Dolby Surround EX Off
Dolby Surround EX On
@item 2
@itemx off
Dolby Surround EX On
Dolby Surround EX Off
@end table
@item -dheadphone_mode @var{mode}
@@ -337,10 +337,10 @@ processing.
Not Indicated (default)
@item 1
@itemx on
Dolby Headphone Off
Dolby Headphone On
@item 2
@itemx off
Dolby Headphone On
Dolby Headphone Off
@end table
@item -ad_conv_type @var{type}
@@ -551,33 +551,36 @@ Set the encoding preset.
@item tune @var{tune_name}
Tune the encoding params.
Deprecated in favor of @var{x264_opts}
@item fastfirstpass @var{bool}
Use fast settings when encoding first pass, default value is 1.
Deprecated in favor of @var{x264_opts}.
@item profile @var{profile_name}
Set profile restrictions.
Deprecated in favor of @var{x264_opts}.
@item level @var{level}
Specify level (as defined by Annex A).
Deprecated in favor of @var{x264opts}.
Deprecated in favor of @var{x264_opts}.
@item passlogfile @var{filename}
Specify filename for 2 pass stats.
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
Deprecated in favor of @var{x264_opts}.
@item wpredp @var{wpred_type}
Specify Weighted prediction for P-frames.
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
Deprecated in favor of @var{x264_opts}.
@item x264opts @var{options}
Allow to set any x264 option, see x264 --fullhelp for a list.
Allow to set any x264 option, see x264 manual for a list.
@var{options} is a list of @var{key}=@var{value} couples separated by
":".
@end table
For example to specify libx264 encoding options with @command{ffmpeg}:
For example to specify libx264 encoding options with @file{ffmpeg}:
@example
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
@end example

View File

@@ -1,174 +0,0 @@
The following table lists most error codes found in various operating
systems supported by FFmpeg.
OS
Code Std F LBMWwb Text (YMMV)
E2BIG POSIX ++++++ Argument list too long
EACCES POSIX ++++++ Permission denied
EADDRINUSE POSIX +++..+ Address in use
EADDRNOTAVAIL POSIX +++..+ Cannot assign requested address
EADV +..... Advertise error
EAFNOSUPPORT POSIX +++..+ Address family not supported
EAGAIN POSIX + ++++++ Resource temporarily unavailable
EALREADY POSIX +++..+ Operation already in progress
EAUTH .++... Authentication error
EBADARCH ..+... Bad CPU type in executable
EBADE +..... Invalid exchange
EBADEXEC ..+... Bad executable
EBADF POSIX ++++++ Bad file descriptor
EBADFD +..... File descriptor in bad state
EBADMACHO ..+... Malformed Macho file
EBADMSG POSIX ++4... Bad message
EBADR +..... Invalid request descriptor
EBADRPC .++... RPC struct is bad
EBADRQC +..... Invalid request code
EBADSLT +..... Invalid slot
EBFONT +..... Bad font file format
EBUSY POSIX - ++++++ Device or resource busy
ECANCELED POSIX +++... Operation canceled
ECHILD POSIX ++++++ No child processes
ECHRNG +..... Channel number out of range
ECOMM +..... Communication error on send
ECONNABORTED POSIX +++..+ Software caused connection abort
ECONNREFUSED POSIX - +++ss+ Connection refused
ECONNRESET POSIX +++..+ Connection reset
EDEADLK POSIX ++++++ Resource deadlock avoided
EDEADLOCK +..++. File locking deadlock error
EDESTADDRREQ POSIX +++... Destination address required
EDEVERR ..+... Device error
EDOM C89 - ++++++ Numerical argument out of domain
EDOOFUS .F.... Programming error
EDOTDOT +..... RFS specific error
EDQUOT POSIX +++... Disc quota exceeded
EEXIST POSIX ++++++ File exists
EFAULT POSIX - ++++++ Bad address
EFBIG POSIX - ++++++ File too large
EFTYPE .++... Inappropriate file type or format
EHOSTDOWN +++... Host is down
EHOSTUNREACH POSIX +++..+ No route to host
EHWPOISON +..... Memory page has hardware error
EIDRM POSIX +++... Identifier removed
EILSEQ C99 ++++++ Illegal byte sequence
EINPROGRESS POSIX - +++ss+ Operation in progress
EINTR POSIX - ++++++ Interrupted system call
EINVAL POSIX + ++++++ Invalid argument
EIO POSIX + ++++++ I/O error
EISCONN POSIX +++..+ Socket is already connected
EISDIR POSIX ++++++ Is a directory
EISNAM +..... Is a named type file
EKEYEXPIRED +..... Key has expired
EKEYREJECTED +..... Key was rejected by service
EKEYREVOKED +..... Key has been revoked
EL2HLT +..... Level 2 halted
EL2NSYNC +..... Level 2 not synchronized
EL3HLT +..... Level 3 halted
EL3RST +..... Level 3 reset
ELIBACC +..... Can not access a needed shared library
ELIBBAD +..... Accessing a corrupted shared library
ELIBEXEC +..... Cannot exec a shared library directly
ELIBMAX +..... Too many shared libraries
ELIBSCN +..... .lib section in a.out corrupted
ELNRNG +..... Link number out of range
ELOOP POSIX +++..+ Too many levels of symbolic links
EMEDIUMTYPE +..... Wrong medium type
EMFILE POSIX ++++++ Too many open files
EMLINK POSIX ++++++ Too many links
EMSGSIZE POSIX +++..+ Message too long
EMULTIHOP POSIX ++4... Multihop attempted
ENAMETOOLONG POSIX - ++++++ Filen ame too long
ENAVAIL +..... No XENIX semaphores available
ENEEDAUTH .++... Need authenticator
ENETDOWN POSIX +++..+ Network is down
ENETRESET SUSv3 +++..+ Network dropped connection on reset
ENETUNREACH POSIX +++..+ Network unreachable
ENFILE POSIX ++++++ Too many open files in system
ENOANO +..... No anode
ENOATTR .++... Attribute not found
ENOBUFS POSIX - +++..+ No buffer space available
ENOCSI +..... No CSI structure available
ENODATA XSR +N4... No message available
ENODEV POSIX - ++++++ No such device
ENOENT POSIX - ++++++ No such file or directory
ENOEXEC POSIX ++++++ Exec format error
ENOFILE ...++. No such file or directory
ENOKEY +..... Required key not available
ENOLCK POSIX ++++++ No locks available
ENOLINK POSIX ++4... Link has been severed
ENOMEDIUM +..... No medium found
ENOMEM POSIX ++++++ Not enough space
ENOMSG POSIX +++..+ No message of desired type
ENONET +..... Machine is not on the network
ENOPKG +..... Package not installed
ENOPROTOOPT POSIX +++..+ Protocol not available
ENOSPC POSIX ++++++ No space left on device
ENOSR XSR +N4... No STREAM resources
ENOSTR XSR +N4... Not a STREAM
ENOSYS POSIX + ++++++ Function not implemented
ENOTBLK +++... Block device required
ENOTCONN POSIX +++..+ Socket is not connected
ENOTDIR POSIX ++++++ Not a directory
ENOTEMPTY POSIX ++++++ Directory not empty
ENOTNAM +..... Not a XENIX named type file
ENOTRECOVERABLE SUSv4 - +..... State not recoverable
ENOTSOCK POSIX +++..+ Socket operation on non-socket
ENOTSUP POSIX +++... Operation not supported
ENOTTY POSIX ++++++ Inappropriate I/O control operation
ENOTUNIQ +..... Name not unique on network
ENXIO POSIX ++++++ No such device or address
EOPNOTSUPP POSIX +++..+ Operation not supported (on socket)
EOVERFLOW POSIX +++..+ Value too large to be stored in data type
EOWNERDEAD SUSv4 +..... Owner died
EPERM POSIX - ++++++ Operation not permitted
EPFNOSUPPORT +++..+ Protocol family not supported
EPIPE POSIX - ++++++ Broken pipe
EPROCLIM .++... Too many processes
EPROCUNAVAIL .++... Bad procedure for program
EPROGMISMATCH .++... Program version wrong
EPROGUNAVAIL .++... RPC prog. not avail
EPROTO POSIX ++4... Protocol error
EPROTONOSUPPORT POSIX - +++ss+ Protocol not supported
EPROTOTYPE POSIX +++..+ Protocol wrong type for socket
EPWROFF ..+... Device power is off
ERANGE C89 - ++++++ Result too large
EREMCHG +..... Remote address changed
EREMOTE +++... Object is remote
EREMOTEIO +..... Remote I/O error
ERESTART +..... Interrupted system call should be restarted
ERFKILL +..... Operation not possible due to RF-kill
EROFS POSIX ++++++ Read-only file system
ERPCMISMATCH .++... RPC version wrong
ESHLIBVERS ..+... Shared library version mismatch
ESHUTDOWN +++..+ Cannot send after socket shutdown
ESOCKTNOSUPPORT +++... Socket type not supported
ESPIPE POSIX ++++++ Illegal seek
ESRCH POSIX ++++++ No such process
ESRMNT +..... Srmount error
ESTALE POSIX +++..+ Stale NFS file handle
ESTRPIPE +..... Streams pipe error
ETIME XSR +N4... Stream ioctl timeout
ETIMEDOUT POSIX - +++ss+ Connection timed out
ETOOMANYREFS +++... Too many references: cannot splice
ETXTBSY POSIX +++... Text file busy
EUCLEAN +..... Structure needs cleaning
EUNATCH +..... Protocol driver not attached
EUSERS +++... Too many users
EWOULDBLOCK POSIX +++..+ Operation would block
EXDEV POSIX ++++++ Cross-device link
EXFULL +..... Exchange full
Notations:
F: used in FFmpeg (-: a few times, +: a lot)
SUSv3: Single Unix Specification, version 3
SUSv4: Single Unix Specification, version 4
XSR: XSI STREAMS (obsolete)
OS: availability on some supported operating systems
L: GNU/Linux
B: BSD (F: FreeBSD, N: NetBSD)
M: MacOS X
W: Microsoft Windows (s: emulated with winsock, see libavformat/network.h)
w: Mingw32 (3.17) and Mingw64 (2.0.1)
b: BeOS

View File

@@ -1,7 +1,7 @@
@chapter Expression Evaluation
@c man begin EXPRESSION EVALUATION
When evaluating an arithmetic expression, FFmpeg uses an internal
When evaluating an arithemetic expression, FFmpeg uses an internal
formula evaluator, implemented through the @file{libavutil/eval.h}
interface.
@@ -50,11 +50,10 @@ Allow to store the value of the expression @var{expr} in an internal
variable. @var{var} specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Note, Variables are currently not shared between expressions.
@item ld(var)
Allow to load the value of the internal variable with number
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
@var{var}, which was previosly stored with st(@var{var}, @var{expr}).
The function returns the loaded value.
@item while(cond, expr)
@@ -84,54 +83,21 @@ Return 1.0 if @var{expr} is zero, 0.0 otherwise.
@item pow(x, y)
Compute the power of @var{x} elevated @var{y}, it is equivalent to
"(@var{x})^(@var{y})".
@item random(x)
Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
internal variable which will be used to save the seed/state.
@item hypot(x, y)
This function is similar to the C function with the same name; it returns
"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
right triangle with sides of length @var{x} and @var{y}, or the distance of the
point (@var{x}, @var{y}) from the origin.
@item gcd(x, y)
Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
@var{y} are 0 or either or both are less than zero then behavior is undefined.
@item if(x, y)
Evaluate @var{x}, and if the result is non-zero return the result of
the evaluation of @var{y}, return 0 otherwise.
@item ifnot(x, y)
Evaluate @var{x}, and if the result is zero return the result of the
evaluation of @var{y}, return 0 otherwise.
@end table
The following constants are available:
@table @option
@item PI
area of the unit disc, approximately 3.14
@item E
exp(1) (Euler's number), approximately 2.718
@item PHI
golden ratio (1+sqrt(5))/2, approximately 1.618
@end table
Assuming that an expression is considered "true" if it has a non-zero
value, note that:
Note that:
@code{*} works like AND
@code{+} works like OR
and the construct:
thus
@example
if A then B else C
@end example
is equivalent to
@example
if(A,B) + ifnot(A,C)
A*B + not(A)*C
@end example
In your C code, you can extend the list of unary and binary functions,

View File

@@ -3,7 +3,7 @@ FFMPEG_LIBS=libavdevice libavformat libavfilter libavcodec libswscale libavutil
CFLAGS+=$(shell pkg-config --cflags $(FFMPEG_LIBS))
LDFLAGS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
EXAMPLES=decoding_encoding filtering metadata muxing
EXAMPLES=encoding-example muxing-example
OBJS=$(addsuffix .o,$(EXAMPLES))

View File

@@ -1,39 +1,42 @@
/*
* Copyright (c) 2001 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* This file is part of FFmpeg.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 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.1 of the License, or (at your option) any later version.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* libavcodec API use example.
* avcodec API use example.
*
* Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
* not file formats (avi, vob, mp4, mov, mkv, mxf, flv, mpegts, mpegps, etc...). See library 'libavformat' for the
* Note that this library only handles codecs (mpeg, mpeg4, etc...),
* not file formats (avi, vob, etc...). See library 'libavformat' for the
* format handling
*/
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_AV_CONFIG_H
#undef HAVE_AV_CONFIG_H
#endif
#include "libavcodec/avcodec.h"
#include "libavutil/mathematics.h"
#include "libavutil/samplefmt.h"
#define INBUF_SIZE 4096
#define AUDIO_INBUF_SIZE 20480
@@ -61,13 +64,12 @@ static void audio_encode_example(const char *filename)
exit(1);
}
c = avcodec_alloc_context3(codec);
c= avcodec_alloc_context();
/* put sample parameters */
c->bit_rate = 64000;
c->sample_rate = 44100;
c->channels = 2;
c->sample_fmt = AV_SAMPLE_FMT_S16;
/* open it */
if (avcodec_open(c, codec) < 0) {
@@ -115,11 +117,11 @@ static void audio_decode_example(const char *outfilename, const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int len;
int out_size, len;
FILE *f, *outfile;
uint8_t *outbuf;
uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt;
AVFrame *decoded_frame = NULL;
av_init_packet(&avpkt);
@@ -132,7 +134,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
exit(1);
}
c = avcodec_alloc_context3(codec);
c= avcodec_alloc_context();
/* open it */
if (avcodec_open(c, codec) < 0) {
@@ -140,6 +142,8 @@ static void audio_decode_example(const char *outfilename, const char *filename)
exit(1);
}
outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
f = fopen(filename, "rb");
if (!f) {
fprintf(stderr, "could not open %s\n", filename);
@@ -156,32 +160,18 @@ static void audio_decode_example(const char *outfilename, const char *filename)
avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
while (avpkt.size > 0) {
int got_frame = 0;
if (!decoded_frame) {
if (!(decoded_frame = avcodec_alloc_frame())) {
fprintf(stderr, "out of memory\n");
exit(1);
}
} else
avcodec_get_frame_defaults(decoded_frame);
len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
if (len < 0) {
fprintf(stderr, "Error while decoding\n");
exit(1);
}
if (got_frame) {
if (out_size > 0) {
/* if a frame has been decoded, output it */
int data_size = av_samples_get_buffer_size(NULL, c->channels,
decoded_frame->nb_samples,
c->sample_fmt, 1);
fwrite(decoded_frame->data[0], 1, data_size, outfile);
fwrite(outbuf, 1, out_size, outfile);
}
avpkt.size -= len;
avpkt.data += len;
avpkt.dts =
avpkt.pts = AV_NOPTS_VALUE;
if (avpkt.size < AUDIO_REFILL_THRESH) {
/* Refill the input buffer, to avoid trying to decode
* incomplete frames. Instead of this, one could also use
@@ -198,34 +188,34 @@ static void audio_decode_example(const char *outfilename, const char *filename)
fclose(outfile);
fclose(f);
free(outbuf);
avcodec_close(c);
av_free(c);
av_free(decoded_frame);
}
/*
* Video encoding example
*/
static void video_encode_example(const char *filename, int codec_id)
static void video_encode_example(const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int i, out_size, size, x, y, outbuf_size;
FILE *f;
AVFrame *picture;
uint8_t *outbuf;
uint8_t *outbuf, *picture_buf;
printf("Video encoding\n");
/* find the mpeg1 video encoder */
codec = avcodec_find_encoder(codec_id);
codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
if (!codec) {
fprintf(stderr, "codec not found\n");
exit(1);
}
c = avcodec_alloc_context3(codec);
c= avcodec_alloc_context();
picture= avcodec_alloc_frame();
/* put sample parameters */
@@ -239,9 +229,6 @@ static void video_encode_example(const char *filename, int codec_id)
c->max_b_frames=1;
c->pix_fmt = PIX_FMT_YUV420P;
if(codec_id == CODEC_ID_H264)
av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */
if (avcodec_open(c, codec) < 0) {
fprintf(stderr, "could not open codec\n");
@@ -257,11 +244,15 @@ static void video_encode_example(const char *filename, int codec_id)
/* alloc image and output buffer */
outbuf_size = 100000;
outbuf = malloc(outbuf_size);
size = c->width * c->height;
picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */
/* the image can be allocated by any means and av_image_alloc() is
* just the most convenient way if av_malloc() is to be used */
av_image_alloc(picture->data, picture->linesize,
c->width, c->height, c->pix_fmt, 1);
picture->data[0] = picture_buf;
picture->data[1] = picture->data[0] + size;
picture->data[2] = picture->data[1] + size / 4;
picture->linesize[0] = c->width;
picture->linesize[1] = c->width / 2;
picture->linesize[2] = c->width / 2;
/* encode 1 second of video */
for(i=0;i<25;i++) {
@@ -304,11 +295,11 @@ static void video_encode_example(const char *filename, int codec_id)
outbuf[3] = 0xb7;
fwrite(outbuf, 1, 4, f);
fclose(f);
free(picture_buf);
free(outbuf);
avcodec_close(c);
av_free(c);
av_free(picture->data[0]);
av_free(picture);
printf("\n");
}
@@ -355,7 +346,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
exit(1);
}
c = avcodec_alloc_context3(codec);
c= avcodec_alloc_context();
picture= avcodec_alloc_frame();
if(codec->capabilities&CODEC_CAP_TRUNCATED)
@@ -463,8 +454,7 @@ int main(int argc, char **argv)
audio_encode_example("/tmp/test.mp2");
audio_decode_example("/tmp/test.sw", "/tmp/test.mp2");
video_encode_example("/tmp/test.h264", CODEC_ID_H264);
video_encode_example("/tmp/test.mpg", CODEC_ID_MPEG1VIDEO);
video_encode_example("/tmp/test.mpg");
filename = "/tmp/test.mpg";
} else {
filename = argv[1];

View File

@@ -1,229 +0,0 @@
/*
* Copyright (c) 2010 Nicolas George
* Copyright (c) 2011 Stefano Sabatini
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @file
* API example for decoding and filtering
*/
#define _XOPEN_SOURCE 600 /* for usleep */
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
#include <libavfilter/vsrc_buffer.h>
const char *filter_descr = "scale=78:24";
static AVFormatContext *fmt_ctx;
static AVCodecContext *dec_ctx;
AVFilterContext *buffersink_ctx;
AVFilterContext *buffersrc_ctx;
AVFilterGraph *filter_graph;
static int video_stream_index = -1;
static int64_t last_pts = AV_NOPTS_VALUE;
static int open_input_file(const char *filename)
{
int ret, i;
AVCodec *dec;
if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
return ret;
}
if ((ret = av_find_stream_info(fmt_ctx)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
return ret;
}
/* select the video stream */
ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");
return ret;
}
video_stream_index = ret;
dec_ctx = fmt_ctx->streams[video_stream_index]->codec;
/* init the video decoder */
if ((ret = avcodec_open(dec_ctx, dec)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
return ret;
}
return 0;
}
static int init_filters(const char *filters_descr)
{
char args[512];
int ret;
AVFilter *buffersrc = avfilter_get_by_name("buffer");
AVFilter *buffersink = avfilter_get_by_name("buffersink");
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE };
filter_graph = avfilter_graph_alloc();
/* buffer video source: the decoded frames from the decoder will be inserted here. */
snprintf(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d",
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
dec_ctx->time_base.num, dec_ctx->time_base.den,
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
args, NULL, filter_graph);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
return ret;
}
/* buffer video sink: to terminate the filter chain. */
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
NULL, pix_fmts, filter_graph);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
return ret;
}
/* Endpoints for the filter graph. */
outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0;
outputs->next = NULL;
inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx = 0;
inputs->next = NULL;
if ((ret = avfilter_graph_parse(filter_graph, filter_descr,
&inputs, &outputs, NULL)) < 0)
return ret;
if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
return ret;
}
static void display_picref(AVFilterBufferRef *picref, AVRational time_base)
{
int x, y;
uint8_t *p0, *p;
int64_t delay;
if (picref->pts != AV_NOPTS_VALUE) {
if (last_pts != AV_NOPTS_VALUE) {
/* sleep roughly the right amount of time;
* usleep is in microseconds, just like AV_TIME_BASE. */
delay = av_rescale_q(picref->pts - last_pts,
time_base, AV_TIME_BASE_Q);
if (delay > 0 && delay < 1000000)
usleep(delay);
}
last_pts = picref->pts;
}
/* Trivial ASCII grayscale display. */
p0 = picref->data[0];
puts("\033c");
for (y = 0; y < picref->video->h; y++) {
p = p0;
for (x = 0; x < picref->video->w; x++)
putchar(" .-+#"[*(p++) / 52]);
putchar('\n');
p0 += picref->linesize[0];
}
fflush(stdout);
}
int main(int argc, char **argv)
{
int ret;
AVPacket packet;
AVFrame frame;
int got_frame;
if (argc != 2) {
fprintf(stderr, "Usage: %s file\n", argv[0]);
exit(1);
}
avcodec_register_all();
av_register_all();
avfilter_register_all();
if ((ret = open_input_file(argv[1])) < 0)
goto end;
if ((ret = init_filters(filter_descr)) < 0)
goto end;
/* read all packets */
while (1) {
AVFilterBufferRef *picref;
if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
break;
if (packet.stream_index == video_stream_index) {
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
av_free_packet(&packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
break;
}
if (got_frame) {
if (frame.pts == AV_NOPTS_VALUE)
frame.pts = frame.pkt_dts == AV_NOPTS_VALUE ?
frame.pkt_dts : frame.pkt_pts;
/* push the decoded frame into the filtergraph */
av_vsrc_buffer_add_frame(buffersrc_ctx, &frame);
/* pull filtered pictures from the filtergraph */
while (avfilter_poll_frame(buffersink_ctx->inputs[0])) {
av_vsink_buffer_get_video_buffer_ref(buffersink_ctx, &picref, 0);
if (picref) {
display_picref(picref, buffersink_ctx->inputs[0]->time_base);
avfilter_unref_buffer(picref);
}
}
}
}
}
end:
avfilter_graph_free(&filter_graph);
if (dec_ctx)
avcodec_close(dec_ctx);
av_close_input_file(fmt_ctx);
if (ret < 0 && ret != AVERROR_EOF) {
char buf[1024];
av_strerror(ret, buf, sizeof(buf));
fprintf(stderr, "Error occurred: %s\n", buf);
exit(1);
}
exit(0);
}

View File

@@ -22,10 +22,8 @@
/**
* @file
* libavformat API example.
*
* Output a media file in any supported libavformat format.
* The default codecs are used.
* Libavformat API example: Output a media file in any supported
* libavformat format. The default codecs are used.
*/
#include <stdlib.h>
@@ -33,14 +31,13 @@
#include <string.h>
#include <math.h>
#include "libavutil/mathematics.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#undef exit
/* 5 seconds stream duration */
#define STREAM_DURATION 200.0
#define STREAM_DURATION 5.0
#define STREAM_FRAME_RATE 25 /* 25 images/s */
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */
@@ -50,11 +47,11 @@ static int sws_flags = SWS_BICUBIC;
/**************************************************************/
/* audio output */
static float t, tincr, tincr2;
static int16_t *samples;
static uint8_t *audio_outbuf;
static int audio_outbuf_size;
static int audio_input_frame_size;
float t, tincr, tincr2;
int16_t *samples;
uint8_t *audio_outbuf;
int audio_outbuf_size;
int audio_input_frame_size;
/*
* add an audio output stream
@@ -64,12 +61,11 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
AVCodecContext *c;
AVStream *st;
st = avformat_new_stream(oc, NULL);
st = av_new_stream(oc, 1);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
exit(1);
}
st->id = 1;
c = st->codec;
c->codec_id = codec_id;
@@ -82,7 +78,7 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
c->channels = 2;
// some formats want stream headers to be separate
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
return st;
@@ -145,7 +141,7 @@ static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
int16_t *q;
q = samples;
for (j = 0; j < frame_size; j++) {
for(j=0;j<frame_size;j++) {
v = (int)(sin(t) * 10000);
for(i = 0; i < nb_channels; i++)
*q++ = v;
@@ -164,13 +160,13 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
get_audio_frame(samples, audio_input_frame_size, c->channels);
pkt.size = avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE)
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = st->index;
pkt.data = audio_outbuf;
pkt.stream_index= st->index;
pkt.data= audio_outbuf;
/* write the compressed frame in the media file */
if (av_interleaved_write_frame(oc, &pkt) != 0) {
@@ -190,34 +186,25 @@ static void close_audio(AVFormatContext *oc, AVStream *st)
/**************************************************************/
/* video output */
static AVFrame *picture, *tmp_picture;
static uint8_t *video_outbuf;
static int frame_count, video_outbuf_size;
AVFrame *picture, *tmp_picture;
uint8_t *video_outbuf;
int frame_count, video_outbuf_size;
/* add a video output stream */
static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
{
AVCodecContext *c;
AVStream *st;
AVCodec *codec;
st = avformat_new_stream(oc, NULL);
st = av_new_stream(oc, 0);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
exit(1);
}
c = st->codec;
/* find the video encoder */
codec = avcodec_find_encoder(codec_id);
if (!codec) {
fprintf(stderr, "codec not found\n");
exit(1);
}
avcodec_get_context_defaults3(c, codec);
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_VIDEO;
/* put sample parameters */
c->bit_rate = 400000;
@@ -243,7 +230,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
c->mb_decision=2;
}
// some formats want stream headers to be separate
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
return st;
@@ -329,15 +316,15 @@ static void fill_yuv_image(AVFrame *pict, int frame_index, int width, int height
i = frame_index;
/* Y */
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
for(y=0;y<height;y++) {
for(x=0;x<width;x++) {
pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
}
}
/* Cb and Cr */
for (y = 0; y < height/2; y++) {
for (x = 0; x < width/2; x++) {
for(y=0;y<height/2;y++) {
for(x=0;x<width/2;x++) {
pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
}
@@ -382,14 +369,14 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
/* raw video case. The API will change slightly in the near
future for that. */
futur for that */
AVPacket pkt;
av_init_packet(&pkt);
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = st->index;
pkt.data = (uint8_t *)picture;
pkt.size = sizeof(AVPicture);
pkt.stream_index= st->index;
pkt.data= (uint8_t *)picture;
pkt.size= sizeof(AVPicture);
ret = av_interleaved_write_frame(oc, &pkt);
} else {
@@ -404,9 +391,9 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
if(c->coded_frame->key_frame)
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = st->index;
pkt.data = video_outbuf;
pkt.size = out_size;
pkt.stream_index= st->index;
pkt.data= video_outbuf;
pkt.size= out_size;
/* write the compressed frame in the media file */
ret = av_interleaved_write_frame(oc, &pkt);
@@ -454,7 +441,7 @@ int main(int argc, char **argv)
"The output format is automatically guessed according to the file extension.\n"
"Raw images can also be output by using '%%d' in the filename\n"
"\n", argv[0]);
return 1;
exit(1);
}
filename = argv[1];
@@ -466,9 +453,9 @@ int main(int argc, char **argv)
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
}
if (!oc) {
return 1;
exit(1);
}
fmt = oc->oformat;
fmt= oc->oformat;
/* add the audio and video streams using the default format codecs
and initialize the codecs */
@@ -492,15 +479,15 @@ int main(int argc, char **argv)
/* open the output file, if needed */
if (!(fmt->flags & AVFMT_NOFILE)) {
if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
if (avio_open(&oc->pb, filename, AVIO_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
return 1;
exit(1);
}
}
/* write the stream header, if any */
av_write_header(oc);
picture->pts = 0;
for(;;) {
/* compute current audio and video time */
if (audio_st)
@@ -522,7 +509,6 @@ int main(int argc, char **argv)
write_audio_frame(oc, audio_st);
} else {
write_video_frame(oc, video_st);
picture->pts++;
}
}

View File

@@ -11,6 +11,22 @@
@chapter General Questions
@section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
Like most open source projects FFmpeg suffers from a certain lack of
manpower. For this reason the developers have to prioritize the work
they do and putting out releases is not at the top of the list, fixing
bugs and reviewing patches takes precedence. Please don't complain or
request more timely and/or frequent releases unless you are willing to
help out creating them.
@section I have a problem with an old version of FFmpeg; where should I report it?
Nowhere. We do not support old FFmpeg versions in any way, we simply lack
the time, motivation and manpower to do so. If you have a problem with an
old version of FFmpeg, upgrade to the latest git snapshot. If you
still experience the problem, then you can report it according to the
guidelines in @url{http://ffmpeg.org/bugreports.html}.
@section Why doesn't FFmpeg support feature [xyz]?
Because no one has taken on that task yet. FFmpeg development is
@@ -24,6 +40,30 @@ No. Windows DLLs are not portable, bloated and often slow.
Moreover FFmpeg strives to support all codecs natively.
A DLL loader is not conducive to that goal.
@section My bug report/mail to ffmpeg-devel/user has not received any replies.
Likely reasons
@itemize
@item We are busy and haven't had time yet to read your report or
investigate the issue.
@item You didn't follow @url{http://ffmpeg.org/bugreports.html}.
@item You didn't use git HEAD.
@item You reported a segmentation fault without gdb output.
@item You describe a problem but not how to reproduce it.
@item It's unclear if you use ffmpeg as command line tool or use
libav* from another application.
@item You speak about a video having problems on playback but
not what you use to play it.
@item We have no faint clue what you are talking about besides
that it is related to FFmpeg.
@end itemize
@section Is there a forum for FFmpeg? I do not like mailing lists.
You may view our mailing lists with a more forum-alike look here:
@url{http://dir.gmane.org/gmane.comp.video.ffmpeg.user},
but, if you post, please remember that our mailing list rules still apply there.
@section I cannot read this file although this format seems to be supported by ffmpeg.
Even if ffmpeg can read the container format, it may not support all its
@@ -83,8 +123,7 @@ problem and an NP-hard problem...
@section ffmpeg does not work; what is wrong?
Try a @code{make distclean} in the ffmpeg source directory before the build.
If this does not help see
Try a @code{make distclean} in the ffmpeg source directory before the build. If this does not help see
(@url{http://ffmpeg.org/bugreports.html}).
@section How do I encode single pictures into movies?
@@ -135,15 +174,15 @@ The @file{movie.mpg} used as input will be converted to
Instead of relying on file format self-recognition, you may also use
@table @option
@item -c:v ppm
@item -c:v png
@item -c:v mjpeg
@item -vcodec ppm
@item -vcodec png
@item -vcodec mjpeg
@end table
to force the encoding.
Applying that to the previous example:
@example
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
@end example
Beware that there is no "jpeg" codec. Use "mjpeg" instead.
@@ -162,21 +201,59 @@ Use @file{-} as file name.
Try '-f image2 test%d.jpg'.
@section Why can I not change the frame rate?
@section Why can I not change the framerate?
Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
Choose a different codec with the -c:v command line option.
Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
Choose a different codec with the -vcodec command line option.
@section How do I encode Xvid or DivX video with ffmpeg?
Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
standard (note that there are many other coding formats that use this
same standard). Thus, use '-c:v mpeg4' to encode in these formats. The
same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
force the fourcc 'xvid' to be stored as the video fourcc rather than the
default.
@section How do I encode videos which play on the iPod?
@table @option
@item needed stuff
-acodec libfaac -vcodec mpeg4 width<=320 height<=240
@item working stuff
mv4, title
@item non-working stuff
B-frames
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
@end table
@section How do I encode videos which play on the PSP?
@table @option
@item needed stuff
-acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
@item working stuff
mv4, title
@item non-working stuff
B-frames
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -ar 24000 -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
@item needed stuff for H.264
-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
@item working stuff for H.264
title, loop filter
@item non-working stuff for H.264
CAVLC
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec libx264 -b 1200k -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
@item higher resolution for newer PSP firmwares, width<=480, height<=272
-vcodec libx264 -level 21 -coder 1 -f psp
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640k -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
@end table
@section Which are good parameters for encoding high quality MPEG-4?
'-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
@@ -208,8 +285,7 @@ Just create an "input.avs" text file with this single line ...
ffmpeg -i input.avs
@end example
For ANY other help on Avisynth, please visit the
@uref{http://www.avisynth.org/, Avisynth homepage}.
For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
@section How can I join video files?
@@ -222,13 +298,13 @@ equally humble @code{copy} under Windows), and finally transcoding back to your
format of choice.
@example
ffmpeg -i input1.avi -same_quant intermediate1.mpg
ffmpeg -i input2.avi -same_quant intermediate2.mpg
ffmpeg -i input1.avi -sameq intermediate1.mpg
ffmpeg -i input2.avi -sameq intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -same_quant output.avi
ffmpeg -i intermediate_all.mpg -sameq output.avi
@end example
Notice that you should either use @code{-same_quant} or set a reasonably high
Notice that you should either use @code{-sameq} or set a reasonably high
bitrate for your intermediate and output files, if you want to preserve
video quality.
@@ -238,10 +314,10 @@ of named pipes, should your platform support it:
@example
mkfifo intermediate1.mpg
mkfifo intermediate2.mpg
ffmpeg -i input1.avi -same_quant -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -same_quant -y intermediate2.mpg < /dev/null &
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
cat intermediate1.mpg intermediate2.mpg |\
ffmpeg -f mpeg -i - -same_quant -c:v mpeg4 -acodec libmp3lame output.avi
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
@end example
Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
@@ -268,47 +344,27 @@ cat temp1.a temp2.a > all.a &
cat temp1.v temp2.v > all.v &
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-same_quant -y output.flv
-sameq -y output.flv
rm temp[12].[av] all.[av]
@end example
@section -profile option fails when encoding H.264 video with AAC audio
@section The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.
@command{ffmpeg} prints an error like
Read the MPEG spec about video buffer verifier.
@example
Undefined constant or missing '(' in 'baseline'
Unable to parse option value "baseline"
Error setting option profile to value baseline.
@end example
@section I want CBR, but no matter what I do frame sizes differ.
Short answer: write @option{-profile:v} instead of @option{-profile}.
You do not understand what CBR is, please read the MPEG spec.
Read about video buffer verifier and constant bitrate.
The one sentence summary is that there is a buffer and the input rate is
constant, the output can vary as needed.
Long answer: this happens because the @option{-profile} option can apply to both
video and audio. Specifically the AAC encoder also defines some profiles, none
of which are named @var{baseline}.
@section How do I check if a stream is CBR?
The solution is to apply the @option{-profile} option to the video stream only
by using @url{http://ffmpeg.org/ffmpeg.html#Stream-specifiers-1, Stream specifiers}.
Appending @code{:v} to it will do exactly that.
To quote the MPEG-2 spec:
"There is no way to tell that a bitstream is constant bitrate without
examining all of the vbv_delay values and making complicated computations."
@section Using @option{-f lavfi}, audio becomes mono for no apparent reason.
Use @option{-dumpgraph -} to find out exactly where the channel layout is
lost.
Most likely, it is through @code{auto-inserted aconvert}. Try to understand
why the converting filter was needed at that place.
Just before the output is a likely place, as @option{-f lavfi} currently
only support packed S16.
Then insert the correct @code{aconvert} explicitly in the filter graph,
specifying the exact format.
@example
aconvert=s16:stereo:packed
@end example
@chapter Development
@@ -356,12 +412,12 @@ the FFmpeg Windows Help Forum at
No. These tools are too bloated and they complicate the build.
@section Why not rewrite FFmpeg in object-oriented C++?
@section Why not rewrite ffmpeg in object-oriented C++?
FFmpeg is already organized in a highly modular manner and does not need to
be rewritten in a formal object language. Further, many of the developers
favor straight C; it works for them. For more arguments on this matter,
read @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
@section Why are the ffmpeg programs devoid of debugging symbols?
@@ -372,10 +428,18 @@ you need the debug information, use the *_g versions.
@section I do not like the LGPL, can I contribute code under the GPL instead?
Yes, as long as the code is optional and can easily and cleanly be placed
under #if CONFIG_GPL without breaking anything. So, for example, a new codec
under #if CONFIG_GPL without breaking anything. So for example a new codec
or filter would be OK under GPL while a bug fix to LGPL code would not.
@section I'm using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.
@section I want to compile xyz.c alone but my compiler produced many errors.
Common code is in its own files in libav* and is used by the individual
codecs. They will not work without the common parts, you have to compile
the whole libav*. If you wish, disable some parts with configure switches.
You can also try to hack it and remove more, but if you had problems fixing
the compilation failure then you are probably not qualified for this.
@section I'm using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.
FFmpeg is a pure C project, so to use the libraries within your C++ application
you need to explicitly state that you are using a C library. You can do this by
@@ -383,16 +447,19 @@ encompassing your FFmpeg includes using @code{extern "C"}.
See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3}
@section I'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
FFmpeg is a pure C project using C99 math features, in order to enable C++
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
@section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
You have to implement a URLProtocol, see @file{libavformat/file.c} in
FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources.
@section I get "No compatible shell script interpreter found." in MSys.
The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
@section I get "./configure: line <xxx>: pr: command not found" in MSys.
The standard MSys install doesn't come with pr. You need to get it from the coreutils package.
@section Where can I find libav* headers for Pascal/Delphi?
see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
@@ -407,24 +474,12 @@ Even if peculiar since it is network oriented, RTP is a container like any
other. You have to @emph{demux} RTP before feeding the payload to libavcodec.
In this specific case please look at RFC 4629 to see how it should be done.
@section AVStream.r_frame_rate is wrong, it is much larger than the frame rate.
@section AVStream.r_frame_rate is wrong, it is much larger than the framerate.
r_frame_rate is NOT the average frame rate, it is the smallest frame rate
r_frame_rate is NOT the average framerate, it is the smallest framerate
that can accurately represent all timestamps. So no, it is not
wrong if it is larger than the average!
For example, if you have mixed 25 and 30 fps content, then r_frame_rate
will be 150.
@section Why is @code{make fate} not running all tests?
Make sure you have the fate-suite samples and the @code{SAMPLES} Make variable
or @code{FATE_SAMPLES} environment variable or the @code{--samples}
@command{configure} option is set to the right path.
@section Why is @code{make fate} not finding the samples?
Do you happen to have a @code{~} character in the samples path to indicate a
home directory? The value is used in ways where the shell cannot expand it,
causing FATE to not find files. Just replace @code{~} by the full path.
@bye

View File

@@ -1,174 +0,0 @@
\input texinfo @c -*- texinfo -*-
@settitle FATE Automated Testing Environment
@titlepage
@center @titlefont{FATE Automated Testing Environment}
@end titlepage
@node Top
@top
@contents
@chapter Introduction
FATE is an extended regression suite on the client-side and a means
for results aggregation and presentation on the server-side.
The first part of this document explains how you can use FATE from
your FFmpeg source directory to test your ffmpeg binary. The second
part describes how you can run FATE to submit the results to FFmpeg's
FATE server.
In any way you can have a look at the publicly viewable FATE results
by visiting this website:
@url{http://fate.ffmpeg.org/}
This is especially recommended for all people contributing source
code to FFmpeg, as it can be seen if some test on some platform broke
with there recent contribution. This usually happens on the platforms
the developers could not test on.
The second part of this document describes how you can run FATE to
submit your results to FFmpeg's FATE server. If you want to submit your
results be sure to check that your combination of CPU, OS and compiler
is not already listed on the above mentioned website.
In the third part you can find a comprehensive listing of FATE makefile
targets and variables.
@chapter Using FATE from your FFmpeg source directory
If you want to run FATE on your machine you need to have the samples
in place. You can get the samples via the build target fate-rsync.
Use this command from the top-level source directory:
@example
make fate-rsync SAMPLES=fate-suite/
make fate SAMPLES=fate-suite/
@end example
The above commands set the samples location by passing a makefile
variable via command line. It is also possible to set the samples
location at source configuration time by invoking configure with
`--samples=<path to the samples directory>'. Afterwards you can
invoke the makefile targets without setting the SAMPLES makefile
variable. This is illustrated by the following commands:
@example
./configure --samples=fate-suite/
make fate-rsync
make fate
@end example
Yet another way to tell FATE about the location of the sample
directory is by making sure the environment variable FATE_SAMPLES
contains the path to your samples directory. This can be achieved
by e.g. putting that variable in your shell profile or by setting
it in your interactive session.
@example
FATE_SAMPLES=fate-suite/ make fate
@end example
@float NOTE
Do not put a '~' character in the samples path to indicate a home
directory. Because of shell nuances, this will cause FATE to fail.
@end float
@chapter Submitting the results to the FFmpeg result aggregation server
To submit your results to the server you should run fate through the
shell script tests/fate.sh from the FFmpeg sources. This script needs
to be invoked with a configuration file as its first argument.
@example
tests/fate.sh /path/to/fate_config
@end example
A configuration file template with comments describing the individual
configuration variables can be found at @file{tests/fate_config.sh.template}.
@ifhtml
The mentioned configuration template is also available here:
@verbatiminclude ../tests/fate_config.sh.template
@end ifhtml
Create a configuration that suits your needs, based on the configuration
template. The `slot' configuration variable can be any string that is not
yet used, but it is suggested that you name it adhering to the following
pattern <arch>-<os>-<compiler>-<compiler version>. The configuration file
itself will be sourced in a shell script, therefore all shell features may
be used. This enables you to setup the environment as you need it for your
build.
For your first test runs the `fate_recv' variable should be empty or
commented out. This will run everything as normal except that it will omit
the submission of the results to the server. The following files should be
present in $workdir as specified in the configuration file:
@itemize
@item configure.log
@item compile.log
@item test.log
@item report
@item version
@end itemize
When you have everything working properly you can create an SSH key and
send its public part to the FATE server administrator.
Configure your SSH client to use public key authentication with that key
when connecting to the FATE server. Also do not forget to check the identity
of the server and to accept its host key. This can usually be achieved by
running your SSH client manually and killing it after you accepted the key.
The FATE server's fingerprint is:
b1:31:c8:79:3f:04:1d:f8:f2:23:26:5a:fd:55:fa:92
The only thing left is to automate the execution of the fate.sh script and
the synchronisation of the samples directory.
@chapter FATE makefile targets and variables
@section Makefile targets
@table @option
@item fate-rsync
Download/synchronize sample files to the configured samples directory.
@item fate-list
Will list all fate/regression test targets.
@item fate
Run the FATE test suite (requires the fate-suite dataset).
@end table
@section Makefile variables
@table @option
@item V
Verbosity level, can be set to 0, 1 or 2.
@itemize
@item 0: show just the test arguments
@item 1: show just the command used in the test
@item 2: show everything
@end itemize
@item SAMPLES
Specify or override the path to the FATE samples at make time, it has a
meaning only while running the regression tests.
@item THREADS
Specify how many threads to use while running regression tests, it is
quite useful to detect thread-related regressions.
@end table
Example:
@example
make V=1 SAMPLES=/var/fate/samples THREADS=2 fate
@end example

45
doc/fate.txt Normal file
View File

@@ -0,0 +1,45 @@
FATE Automated Testing Environment
FATE provides a regression testsuite that can be run locally or configured
to send reports to fate.ffmpeg.org.
In order to run, it needs a large amount of data (samples and references)
that is provided separately from the actual source distribution.
Use the following command to get the fate test samples
# make fate-rsync SAMPLES=fate-suite/
To inform the build system about the testsuite location, pass
`--samples=<path to the samples>` to configure or set the SAMPLES Make
variable or the FATE_SAMPLES environment variable to a suitable value.
For information on how to set up FATE to send results to the official FFmpeg
testing framework, please refer to the following wiki page:
http://wiki.multimedia.cx/index.php?title=FATE
FATE Makefile targets:
fate-list
Will list all fate/regression test targets.
fate
Run the FATE test suite (requires the fate-suite dataset).
Fate Makefile variables:
V
Verbosity level, can be set to 0, 1 or 2.
* 0: show just the test arguments
* 1: show just the command used in the test
* 2: show everything
SAMPLES
Specify or override the path to the FATE samples at make time, it has a
meaning only while running the regression tests.
THREADS
Specify how many threads to use while running regression tests, it is
quite useful to detect thread-related regressions.
Example:
make V=1 SAMPLES=/var/fate/samples THREADS=2 fate

4561
doc/ffmpeg-mt-authorship.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@ The generic syntax is:
@example
@c man begin SYNOPSIS
ffmpeg [global options] [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
@c man end
@end example
@@ -26,39 +26,21 @@ ffmpeg is a very fast video and audio converter that can also grab from
a live audio/video source. It can also convert between arbitrary sample
rates and resize video on the fly with a high quality polyphase filter.
ffmpeg reads from an arbitrary number of input "files" (which can be regular
files, pipes, network streams, grabbing devices, etc.), specified by the
@code{-i} option, and writes to an arbitrary number of output "files", which are
specified by a plain output filename. Anything found on the command line which
cannot be interpreted as an option is considered to be an output filename.
Each input or output file can in principle contain any number of streams of
different types (video/audio/subtitle/attachment/data). Allowed number and/or
types of streams can be limited by the container format. Selecting, which
streams from which inputs go into output, is done either automatically or with
the @code{-map} option (see the Stream selection chapter).
To refer to input files in options, you must use their indices (0-based). E.g.
the first input file is @code{0}, the second is @code{1} etc. Similarly, streams
within a file are referred to by their indices. E.g. @code{2:3} refers to the
fourth stream in the third input file. See also the Stream specifiers chapter.
The command line interface is designed to be intuitive, in the sense
that ffmpeg tries to figure out all parameters that can possibly be
derived automatically. You usually only have to specify the target
bitrate you want.
As a general rule, options are applied to the next specified
file. Therefore, order is important, and you can have the same
option on the command line multiple times. Each occurrence is
then applied to the next input or output file.
Exceptions from this rule are the global options (e.g. verbosity level),
which should be specified first.
Do not mix input and output files -- first specify all input files, then all
output files. Also do not mix options which belong to different files. All
options apply ONLY to the next input or output file and are reset between files.
@itemize
@item
To set the video bitrate of the output file to 64kbit/s:
@example
ffmpeg -i input.avi -b:v 64k output.avi
ffmpeg -i input.avi -b 64k output.avi
@end example
@item
@@ -77,90 +59,51 @@ ffmpeg -r 1 -i input.m2v -r 24 output.avi
The format option may be needed for raw input files.
By default ffmpeg tries to convert as losslessly as possible: It
uses the same audio and video parameters for the outputs as the one
specified for the inputs.
@c man end DESCRIPTION
@chapter Stream selection
@c man begin STREAM SELECTION
By default ffmpeg includes only one stream of each type (video, audio, subtitle)
present in the input files and adds them to each output file. It picks the
"best" of each based upon the following criteria; for video it is the stream
with the highest resolution, for audio the stream with the most channels, for
subtitle it's the first subtitle stream. In the case where several streams of
the same type rate equally, the lowest numbered stream is chosen.
You can disable some of those defaults by using @code{-vn/-an/-sn} options. For
full manual control, use the @code{-map} option, which disables the defaults just
described.
@c man end STREAM SELECTION
@chapter Options
@c man begin OPTIONS
@include avtools-common-opts.texi
@include fftools-common-opts.texi
@section Main options
@table @option
@item -f @var{fmt} (@emph{input/output})
Force input or output file format. The format is normally auto detected for input
files and guessed from file extension for output files, so this option is not
needed in most cases.
@item -f @var{fmt}
Force format.
@item -i @var{filename} (@emph{input})
@item -i @var{filename}
input file name
@item -y (@emph{global})
Overwrite output files without asking.
@item -y
Overwrite output files.
@item -n (@emph{global})
Do not overwrite output files but exit if file exists.
@item -t @var{duration}
Restrict the transcoded/captured video sequence
to the duration specified in seconds.
@code{hh:mm:ss[.xxx]} syntax is also supported.
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
Select an encoder (when used before an output file) or a decoder (when used
before an input file) for one or more streams. @var{codec} is the name of a
decoder/encoder or a special value @code{copy} (output only) to indicate that
the stream is not to be re-encoded.
For example
@example
ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
@end example
encodes all video streams with libx264 and copies all audio streams.
For each stream, the last matching @code{c} option is applied, so
@example
ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
@end example
will copy all the streams except the second video, which will be encoded with
libx264, and the 138th audio, which will be encoded with libvorbis.
@item -t @var{duration} (@emph{output})
Stop writing the output after its duration reaches @var{duration}.
@var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
@item -fs @var{limit_size} (@emph{output})
@item -fs @var{limit_size}
Set the file size limit.
@item -ss @var{position} (@emph{input/output})
When used as an input option (before @code{-i}), seeks in this input file to
@var{position}. When used as an output option (before an output filename),
decodes but discards input until the timestamps reach @var{position}. This is
slower, but more accurate.
@item -ss @var{position}
Seek to given time position in seconds.
@code{hh:mm:ss[.xxx]} syntax is also supported.
@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
@item -itsoffset @var{offset} (@emph{input})
@item -itsoffset @var{offset}
Set the input time offset in seconds.
@code{[-]hh:mm:ss[.xxx]} syntax is also supported.
This option affects all the input files that follow it.
The offset is added to the timestamps of the input files.
Specifying a positive offset means that the corresponding
streams are delayed by @var{offset} seconds.
streams are delayed by 'offset' seconds.
@item -timestamp @var{time} (@emph{output})
@item -timestamp @var{time}
Set the recording timestamp in the container.
The syntax for @var{time} is:
@example
@@ -172,31 +115,21 @@ interpreted as UTC.
If the year-month-day part is not specified it takes the current
year-month-day.
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
@item -metadata @var{key}=@var{value}
Set a metadata key/value pair.
An optional @var{metadata_specifier} may be given to set metadata
on streams or chapters. See @code{-map_metadata} documentation for
details.
This option overrides metadata set with @code{-map_metadata}. It is
also possible to delete metadata by using an empty value.
For example, for setting the title in the output file:
@example
ffmpeg -i in.avi -metadata title="my title" out.flv
@end example
To set the language of the first audio stream:
@example
ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
@end example
@item -v @var{number}
Set the logging verbosity level.
@item -target @var{type} (@emph{output})
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
@code{film-} to use the corresponding standard. All the format options
(bitrate, codecs, buffer sizes) are then set automatically. You can just type:
@item -target @var{type}
Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
"ntsc-svcd", ... ). All the format options (bitrate, codecs,
buffer sizes) are then set automatically. You can just type:
@example
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
@@ -209,71 +142,33 @@ they do not conflict with the standard, as in:
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
@end example
@item -dframes @var{number} (@emph{output})
Set the number of data frames to record. This is an alias for @code{-frames:d}.
@item -dframes @var{number}
Set the number of data frames to record.
@item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
Stop writing to the stream after @var{framecount} frames.
@item -scodec @var{codec}
Force subtitle codec ('copy' to copy stream).
@item -q[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
@itemx -qscale[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
Use fixed quality scale (VBR). The meaning of @var{q} is
codec-dependent.
@item -newsubtitle
Add a new subtitle stream to the current output stream.
@item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
@var{filter_graph} is a description of the filter graph to apply to
the stream. Use @code{-filters} to show all the available filters
(including also sources and sinks).
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
Specify the preset for matching stream(s).
@item -stats (@emph{global})
Print encoding progress/statistics. On by default.
@item -attach @var{filename} (@emph{output})
Add an attachment to the output file. This is supported by a few formats
like Matroska for e.g. fonts used in rendering subtitles. Attachments
are implemented as a specific type of stream, so this option will add
a new stream to the file. It is then possible to use per-stream options
on this stream in the usual way. Attachment streams created with this
option will be created after all the other streams (i.e. those created
with @code{-map} or automatic mappings).
Note that for Matroska you also have to set the mimetype metadata tag:
@example
ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
@end example
(assuming that the attachment stream will be third in the output file).
@item -dump_attachment[:@var{stream_specifier}] @var{filename} (@emph{input,per-stream})
Extract the matching attachment stream into a file named @var{filename}. If
@var{filename} is empty, then the value of the @code{filename} metadata tag
will be used.
E.g. to extract the first attachment to a file named 'out.ttf':
@example
ffmpeg -dump_attachment:t:0 out.ttf INPUT
@end example
To extract all attachments to files determined by the @code{filename} tag:
@example
ffmpeg -dump_attachment:t "" INPUT
@end example
Technical note -- attachments are implemented as codec extradata, so this
option can actually be used to extract extradata from any stream, not just
attachments.
@item -slang @var{code}
Set the ISO 639 language code (3 letters) of the current subtitle stream.
@end table
@section Video Options
@table @option
@item -vframes @var{number} (@emph{output})
Set the number of video frames to record. This is an alias for @code{-frames:v}.
@item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
@item -b @var{bitrate}
Set the video bitrate in bit/s (default = 200 kb/s).
@item -vframes @var{number}
Set the number of video frames to record.
@item -r @var{fps}
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
@item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
Set frame size. The format is @samp{wxh} (default - same as source).
@item -s @var{size}
Set frame size. The format is @samp{wxh} (ffserver default = 160x128).
There is no default for input streams,
for output streams it is set by default to the size of the source stream.
The following abbreviations are recognized:
@table @samp
@item sqcif
@@ -336,7 +231,7 @@ The following abbreviations are recognized:
1920x1080
@end table
@item -aspect[:@var{stream_specifier}] @var{aspect} (@emph{output,per-stream})
@item -aspect @var{aspect}
Set the video display aspect ratio specified by @var{aspect}.
@var{aspect} can be a floating point number string, or a string of the
@@ -358,8 +253,7 @@ crop=width:height:x:y instead.
@item -padcolor @var{hex_color}
All the pad options have been removed. Use -vf
pad=width:height:x:y:color instead.
@item -vn (@emph{output})
@item -vn
Disable video recording.
@item -bt @var{tolerance}
Set video bitrate tolerance (in bits, default 4000k).
@@ -375,19 +269,17 @@ Requires -bufsize to be set.
Set min video bitrate (in bit/s).
Most useful in setting up a CBR encode:
@example
ffmpeg -i myfile.avi -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
@end example
It is of little use elsewise.
@item -bufsize @var{size}
Set video buffer verifier buffer size (in bits).
@item -vcodec @var{codec} (@emph{output})
Set the video codec. This is an alias for @code{-codec:v}.
@item -same_quant
@item -vcodec @var{codec}
Force video codec to @var{codec}. Use the @code{copy} special value to
tell that the raw codec data must be copied as is.
@item -sameq
Use same quantizer as source (implies VBR).
Note that this is NOT SAME QUALITY. Do not use this option unless you know you
need it.
@item -pass @var{n}
Select the pass number (1 or 2). It is used to do two-pass
video encoding. The statistics of the video are recorded in the first
@@ -397,45 +289,46 @@ at the exact requested bitrate.
On pass 1, you may just deactivate audio and set output to null,
examples for Windows and Unix:
@example
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
@end example
@item -passlogfile @var{prefix} (@emph{global})
@item -passlogfile @var{prefix}
Set two-pass log file name prefix to @var{prefix}, the default file name
prefix is ``ffmpeg2pass''. The complete file name will be
@file{PREFIX-N.log}, where N is a number specific to the output
stream
stream.
Note that this option is overwritten by a local option of the same name
when using @code{-vcodec libx264}. That option maps to the x264 option stats
which has a different syntax.
@item -newvideo
Add a new video stream to the current output stream.
@item -vlang @var{code}
Set the ISO 639 language code (3 letters) of the current video stream.
@item -vf @var{filter_graph} (@emph{output})
@item -vf @var{filter_graph}
@var{filter_graph} is a description of the filter graph to apply to
the input video.
Use the option "-filters" to show all the available filters (including
also sources and sinks). This is an alias for @code{-filter:v}.
also sources and sinks).
@end table
@section Advanced Video Options
@table @option
@item -pix_fmt[:@var{stream_specifier}] @var{format} (@emph{input/output,per-stream})
Set pixel format. Use @code{-pix_fmts} to show all the supported
@item -pix_fmt @var{format}
Set pixel format. Use 'list' as parameter to show all the supported
pixel formats.
@item -sws_flags @var{flags} (@emph{input/output})
@item -sws_flags @var{flags}
Set SwScaler flags.
@item -g @var{gop_size}
Set the group of pictures size.
@item -intra
deprecated, use -g 1
Use only intra frames.
@item -vdt @var{n}
Discard threshold.
@item -qscale @var{q}
Use fixed video quantizer scale (VBR).
@item -qmin @var{q}
minimum video quantizer scale (VBR)
@item -qmax @var{q}
@@ -507,8 +400,8 @@ and the following constants are available:
@item avgTex
@end table
@item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream})
Rate control override for specific intervals, formatted as "int,int,int"
@item -rc_override @var{override}
Rate control override for specific intervals, formated as "int,int,int"
list separated with slashes. Two first values are the beginning and
end frame numbers, last one is quantizer to use if positive, or quality
factor if negative.
@@ -636,59 +529,69 @@ Calculate PSNR of compressed frames.
Dump video coding statistics to @file{vstats_HHMMSS.log}.
@item -vstats_file @var{file}
Dump video coding statistics to @var{file}.
@item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
@item -top @var{n}
top=1/bottom=0/auto=-1 field first
@item -dc @var{precision}
Intra_dc_precision.
@item -vtag @var{fourcc/tag} (@emph{output})
Force video tag/fourcc. This is an alias for @code{-tag:v}.
@item -qphist (@emph{global})
Show QP histogram
@item -vtag @var{fourcc/tag}
Force video tag/fourcc.
@item -qphist
Show QP histogram.
@item -vbsf @var{bitstream_filter}
Deprecated see -bsf
@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg".
@example
ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
@end example
@item -force_key_frames @var{time}[,@var{time}...]
Force key frames at the specified timestamps, more precisely at the first
frames after each specified time.
This option can be useful to ensure that a seek point is present at a
chapter mark or any other designated place in the output file.
The timestamps must be specified in ascending order.
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
When doing stream copy, copy also non-key frames found at the
beginning.
@end table
@section Audio Options
@table @option
@item -aframes @var{number} (@emph{output})
Set the number of audio frames to record. This is an alias for @code{-frames:a}.
@item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
Set the audio sampling frequency. For output streams it is set by
default to the frequency of the corresponding input stream. For input
streams this option only makes sense for audio grabbing devices and raw
demuxers and is mapped to the corresponding demuxer options.
@item -aq @var{q} (@emph{output})
Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
@item -ac[:@var{stream_specifier}] @var{channels} (@emph{input/output,per-stream})
Set the number of audio channels. For output streams it is set by
default to the number of input audio channels. For input streams
this option only makes sense for audio grabbing devices and raw demuxers
and is mapped to the corresponding demuxer options.
@item -an (@emph{output})
@item -aframes @var{number}
Set the number of audio frames to record.
@item -ar @var{freq}
Set the audio sampling frequency. there is no default for input streams,
for output streams it is set by default to the frequency of the input stream.
@item -ab @var{bitrate}
Set the audio bitrate in bit/s (default = 64k).
@item -aq @var{q}
Set the audio quality (codec-specific, VBR).
@item -ac @var{channels}
Set the number of audio channels. For input streams it is set by
default to 1, for output streams it is set by default to the same
number of audio channels in input.
@item -an
Disable audio recording.
@item -acodec @var{codec} (@emph{input/output})
Set the audio codec. This is an alias for @code{-codec:a}.
@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
Set the audio sample format. Use @code{-sample_fmts} to get a list
of supported sample formats.
@item -acodec @var{codec}
Force audio codec to @var{codec}. Use the @code{copy} special value to
specify that the raw codec data must be copied as is.
@item -newaudio
Add a new audio track to the output file. If you want to specify parameters,
do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..).
Mapping will be done automatically, if the number of output streams is equal to
the number of input streams, else it will pick the first one that matches. You
can override the mapping using @code{-map} as usual.
Example:
@example
ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
@end example
@item -alang @var{code}
Set the ISO 639 language code (3 letters) of the current audio stream.
@end table
@section Advanced Audio options:
@table @option
@item -atag @var{fourcc/tag} (@emph{output})
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
@item -atag @var{fourcc/tag}
Force audio tag/fourcc.
@item -audio_service_type @var{type}
Set the type of service that the audio stream contains.
@table @option
@@ -712,155 +615,91 @@ Voice Over
Karaoke
@end table
@item -absf @var{bitstream_filter}
Deprecated, see -bsf
Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
@end table
@section Subtitle options:
@table @option
@item -scodec @var{codec}
Force subtitle codec ('copy' to copy stream).
@item -newsubtitle
Add a new subtitle stream to the current output stream.
@item -slang @var{code}
Set the ISO 639 language code (3 letters) of the current subtitle stream.
@item -scodec @var{codec} (@emph{input/output})
Set the subtitle codec. This is an alias for @code{-codec:s}.
@item -sn (@emph{output})
@item -sn
Disable subtitle recording.
@item -sbsf @var{bitstream_filter}
Deprecated, see -bsf
Bitstream filters available are "mov2textsub", "text2movsub".
@example
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
@end example
@end table
@section Audio/Video grab options
@table @option
@item -isync (@emph{global})
@item -vc @var{channel}
Set video grab channel (DV1394 only).
@item -tvstd @var{standard}
Set television standard (NTSC, PAL (SECAM)).
@item -isync
Synchronize read on input.
@end table
@section Advanced options
@table @option
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][,@var{sync_file_id}[:@var{stream_specifier}]] (@emph{output})
@item -map @var{input_file_id}.@var{input_stream_id}[:@var{sync_file_id}.@var{sync_stream_id}]
Designate one or more input streams as a source for the output file. Each input
Designate an input stream as a source for the output file. Each input
stream is identified by the input file index @var{input_file_id} and
the input stream index @var{input_stream_id} within the input
file. Both indices start at 0. If specified,
@var{sync_file_id}:@var{stream_specifier} sets which input stream
file. Both indexes start at 0. If specified,
@var{sync_file_id}.@var{sync_stream_id} sets which input stream
is used as a presentation sync reference.
The first @code{-map} option on the command line specifies the
The @code{-map} options must be specified just after the output file.
If any @code{-map} options are used, the number of @code{-map} options
on the command line must match the number of streams in the output
file. The first @code{-map} option on the command line specifies the
source for output stream 0, the second @code{-map} option specifies
the source for output stream 1, etc.
A @code{-} character before the stream identifier creates a "negative" mapping.
It disables matching streams from already created mappings.
For example, to map ALL streams from the first input file to output
@example
ffmpeg -i INPUT -map 0 output
@end example
For example, if you have two audio streams in the first input file,
these streams are identified by "0:0" and "0:1". You can use
@code{-map} to select which streams to place in an output file. For
these streams are identified by "0.0" and "0.1". You can use
@code{-map} to select which stream to place in an output file. For
example:
@example
ffmpeg -i INPUT -map 0:1 out.wav
ffmpeg -i INPUT out.wav -map 0.1
@end example
will map the input stream in @file{INPUT} identified by "0:1" to
will map the input stream in @file{INPUT} identified by "0.1" to
the (single) output stream in @file{out.wav}.
For example, to select the stream with index 2 from input file
@file{a.mov} (specified by the identifier "0:2"), and stream with
index 6 from input @file{b.mov} (specified by the identifier "1:6"),
@file{a.mov} (specified by the identifier "0.2"), and stream with
index 6 from input @file{b.mov} (specified by the identifier "1.6"),
and copy them to the output file @file{out.mov}:
@example
ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
@end example
To select all video and the third audio stream from an input file:
@example
ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
@end example
To add more streams to the output file, you can use the
@code{-newaudio}, @code{-newvideo}, @code{-newsubtitle} options.
To map all the streams except the second audio, use negative mappings
@example
ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
@end example
@item -map_meta_data @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
Deprecated, use @var{-map_metadata} instead.
Note that using this option disables the default mappings for this output file.
@item -map_metadata @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}]
Set metadata information of @var{outfile} from @var{infile}. Note that those
are file indices (zero-based), not filenames.
Optional @var{metadata} parameters specify, which metadata to copy - (g)lobal
(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
per-(p)rogram. All metadata specifiers other than global must be followed by the
stream/chapter/program number. If metadata specifier is omitted, it defaults to
global.
@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
Map an audio channel from a given input to an output. If
@var{output_file_id}.@var{stream_specifier} are not set, the audio channel will
be mapped on all the audio streams.
Using "-1" instead of
@var{input_file_id}.@var{stream_specifier}.@var{channel_id} will map a muted
channel.
For example, assuming @var{INPUT} is a stereo audio file, you can switch the
two audio channels with the following command:
@example
ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
@end example
If you want to mute the first channel and keep the second:
@example
ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
@end example
The order of the "-map_channel" option specifies the order of the channels in
the output stream. The output channel layout is guessed from the number of
channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac"
in combination of "-map_channel" makes the channel gain levels to be updated if
channel layouts don't match (for instance two "-map_channel" options and "-ac
6").
You can also extract each channel of an @var{INPUT} to specific outputs; the
following command extract each channel of the audio stream (file 0, stream 0)
to the respective @var{OUTPUT_CH0} and @var{OUTPUT_CH1}:
@example
ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
@end example
The following example split the channels of a stereo input into streams:
@example
ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
@end example
Note that currently each output stream can only contain channels from a single
input stream; you can't for example use "-map_channel" to pick multiple input
audio channels contained in different streams (from the same or different files)
and merge them into a single output stream. It is therefore not currently
possible, for example, to turn two separate mono streams into a single stereo
stream. However spliting a stereo stream into two single channel mono streams
is possible.
@item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
Set metadata information of the next output file from @var{infile}. Note that
those are file indices (zero-based), not filenames.
Optional @var{metadata_spec_in/out} parameters specify, which metadata to copy.
A metadata specifier can have the following forms:
@table @option
@item @var{g}
global metadata, i.e. metadata that applies to the whole file
@item @var{s}[:@var{stream_spec}]
per-stream metadata. @var{stream_spec} is a stream specifier as described
in the @ref{Stream specifiers} chapter. In an input metadata specifier, the first
matching stream is copied from. In an output metadata specifier, all matching
streams are copied to.
@item @var{c}:@var{chapter_index}
per-chapter metadata. @var{chapter_index} is the zero-based chapter index.
@item @var{p}:@var{program_index}
per-program metadata. @var{program_index} is the zero-based program index.
@end table
If metadata specifier is omitted, it defaults to global.
By default, global metadata is copied from the first input file,
By default, global metadata is copied from the first input file to all output files,
per-stream and per-chapter metadata is copied along with streams/chapters. These
default mappings are disabled by creating any mapping of the relevant type. A negative
file index can be used to create a dummy mapping that just disables automatic copying.
@@ -868,92 +707,50 @@ file index can be used to create a dummy mapping that just disables automatic co
For example to copy metadata from the first stream of the input file to global metadata
of the output file:
@example
ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
@end example
To do the reverse, i.e. copy global metadata to all audio streams:
@example
ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
@end example
Note that simple @code{0} would work as well in this example, since global
metadata is assumed by default.
@item -map_chapters @var{input_file_index} (@emph{output})
Copy chapters from input file with index @var{input_file_index} to the next
output file. If no chapter mapping is specified, then chapters are copied from
the first input file with at least one chapter. Use a negative file index to
disable any chapter copying.
@item -debug @var{category}
@item -map_chapters @var{outfile}:@var{infile}
Copy chapters from @var{infile} to @var{outfile}. If no chapter mapping is specified,
then chapters are copied from the first input file with at least one chapter to all
output files. Use a negative file index to disable any chapter copying.
@item -debug
Print specific debug info.
@var{category} is a number or a string containing one of the following values:
@table @samp
@item bitstream
@item buffers
picture buffer allocations
@item bugs
@item dct_coeff
@item er
error recognition
@item mb_type
macroblock (MB) type
@item mmco
memory management control operations (H.264)
@item mv
motion vector
@item pict
picture info
@item pts
@item qp
per-block quantization parameter (QP)
@item rc
rate control
@item skip
@item startcode
@item thread_ops
threading operations
@item vis_mb_type
visualize block types
@item vis_qp
visualize quantization parameter (QP), lower QP are tinted greener
@end table
@item -benchmark (@emph{global})
@item -benchmark
Show benchmarking information at the end of an encode.
Shows CPU time used and maximum memory consumption.
Maximum memory consumption is not supported on all systems,
it will usually display as 0 if not supported.
@item -timelimit @var{duration} (@emph{global})
Exit after ffmpeg has been running for @var{duration} seconds.
@item -dump (@emph{global})
Dump each input packet to stderr.
@item -hex (@emph{global})
@item -dump
Dump each input packet.
@item -hex
When dumping packets, also dump the payload.
@item -bitexact
Only use bit exact algorithms (for codec testing).
@item -ps @var{size}
Set RTP payload size in bytes.
@item -re (@emph{input})
@item -re
Read input at native frame rate. Mainly used to simulate a grab device.
@item -loop_input
Loop over the input stream. Currently it works only for image
streams. This option is used for automatic FFserver testing.
This option is deprecated, use -loop 1.
@item -loop_output @var{number_of_times}
Repeatedly loop output for formats that support looping such as animated GIF
(0 will loop the output infinitely).
This option is deprecated, use -loop.
@item -threads @var{count}
Thread count.
@item -vsync @var{parameter}
Video sync method.
@table @option
@item 0, passthrough
@item 0
Each frame is passed with its timestamp from the demuxer to the muxer.
@item 1, cfr
@item 1
Frames will be duplicated and dropped to achieve exactly the requested
constant framerate.
@item 2, vfr
@item 2
Frames are passed through with their timestamp or dropped so as to
prevent 2 frames from having the same timestamp.
@item -1, auto
@item -1
Chooses between 1 and 2 depending on muxer capabilities. This is the
default method.
@end table
@@ -975,11 +772,11 @@ Copy input stream time base from input to output when stream copying.
Finish encoding when the shortest input stream ends.
@item -dts_delta_threshold
Timestamp discontinuity delta threshold.
@item -muxdelay @var{seconds} (@emph{input})
@item -muxdelay @var{seconds}
Set the maximum demux-decode delay.
@item -muxpreload @var{seconds} (@emph{input})
@item -muxpreload @var{seconds}
Set the initial demux-decode delay.
@item -streamid @var{output-stream-index}:@var{new-value} (@emph{output})
@item -streamid @var{output-stream-index}:@var{new-value}
Assign a new stream-id value to an output stream. This option should be
specified prior to the output filename to which it applies.
For the situation where multiple output files exist, a streamid
@@ -990,35 +787,15 @@ an output mpegts file:
@example
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
@end example
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
Set bitstream filters for matching streams. @var{bistream_filters} is
a comma-separated list of bitstream filters. Use the @code{-bsfs} option
to get the list of bitstream filters.
@example
ffmpeg -i h264.mp4 -c:v copy -vbsf h264_mp4toannexb -an out.h264
@end example
@example
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -c:s copy -f rawvideo sub.txt
@end example
@item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{per-stream})
Force a tag/fourcc for matching streams.
@item -timecode @var{hh}:@var{mm}:@var{ss}SEP@var{ff}
Specify Timecode for writing. @var{SEP} is ':' for non drop timecode and ';'
(or '.') for drop.
@example
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
@end example
@end table
@section Preset files
A preset file contains a sequence of @var{option}=@var{value} pairs,
one for each line, specifying a sequence of options which would be
awkward to specify on the command line. Lines starting with the hash
('#') character are ignored and are used to provide comments. Check
the @file{presets} directory in the FFmpeg source tree for examples.
the @file{ffpresets} directory in the FFmpeg source tree for examples.
Preset files are specified with the @code{vpre}, @code{apre},
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
@@ -1045,7 +822,7 @@ directories, where @var{codec_name} is the name of the codec to which
the preset file options will be applied. For example, if you select
the video codec with @code{-vcodec libx264} and use @code{-vpre max},
then it will search for the file @file{libx264-max.ffpreset}.
@c man end OPTIONS
@c man end
@chapter Tips
@c man begin TIPS
@@ -1058,7 +835,7 @@ the Linux player does not seem to be very fast, so it can miss
frames. An example is:
@example
ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
@end example
@item
@@ -1085,27 +862,17 @@ To have a constant quality (but a variable bitrate), use the option
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
quality).
@item
When converting video files, you can use the '-sameq' option which
uses the same quality factor in the encoder as in the decoder.
It allows almost lossless encoding.
@end itemize
@c man end TIPS
@chapter Examples
@c man begin EXAMPLES
@section Preset files
A preset file contains a sequence of @var{option=value} pairs, one for
each line, specifying a sequence of options which can be specified also on
the command line. Lines starting with the hash ('#') character are ignored and
are used to provide comments. Empty lines are also ignored. Check the
@file{presets} directory in the FFmpeg source tree for examples.
Preset files are specified with the @code{pre} option, this option takes a
preset name as input. FFmpeg searches for a file named @var{preset_name}.avpreset in
the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg})
in that order. For example, if the argument is @code{libx264-max}, it will
search for the file @file{libx264-max.avpreset}.
@section Video and Audio grabbing
If you specify the input format and device then ffmpeg can grab video
@@ -1115,14 +882,9 @@ and audio directly.
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
@end example
Or with an ALSA audio source (mono input, card id 1) instead of OSS:
@example
ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
@end example
Note that you must activate the right video source and channel before
launching ffmpeg with any TV viewer such as
@uref{http://linux.bytesex.org/xawtv/, xawtv} by Gerd Knorr. You also
launching ffmpeg with any TV viewer such as xawtv
(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
have to set the audio recording levels correctly with a
standard mixer.
@@ -1210,7 +972,7 @@ You can encode to several formats at the same time and define a
mapping from input stream to output streams:
@example
ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
@end example
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
@@ -1221,7 +983,7 @@ stream, in the order of the definition of output streams.
You can transcode decrypted VOBs:
@example
ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
@end example
This is a typical DVD ripping example; the input is a VOB file, the
@@ -1265,11 +1027,16 @@ only formats accepting a normal integer are suitable.
You can put many streams of the same type in the output:
@example
ffmpeg -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
@end example
The resulting output file @file{test12.avi} will contain first four streams from
the input file in reverse order.
In addition to the first video and audio streams, the resulting
output file @file{test12.avi} will contain the second video
and the second audio stream found in the input streams list.
The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle}
options have to be specified immediately after the name of the output
file to which you want to add them.
@end itemize
@c man end EXAMPLES
@@ -1296,7 +1063,7 @@ ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
@c man end
@c man begin AUTHORS
See git history
The FFmpeg developers
@c man end
@end ignore

View File

@@ -1,47 +0,0 @@
:
ffmpeg.c : libav*
======== : ======
:
:
--------------------------------:---> AVStream...
InputStream input_streams[] / :
/ :
InputFile input_files[] +==========================+ / ^ :
------> 0 | : st ---:-----------:--/ : :
^ +------+-----------+-----+ / +--------------------------+ : :
: | :ist_index--:-----:---------/ 1 | : st : | : :
: +------+-----------+-----+ +==========================+ : :
nb_input_files : | :ist_index--:-----:------------------> 2 | : st : | : :
: +------+-----------+-----+ +--------------------------+ : nb_input_streams :
: | :ist_index : | 3 | ... | : :
v +------+-----------+-----+ +--------------------------+ : :
--> 4 | | : :
| +--------------------------+ : :
| 5 | | : :
| +==========================+ v :
| :
| :
| :
| :
--------- --------------------------------:---> AVStream...
\ / :
OutputStream output_streams[] / :
\ / :
+======\======================/======+ ^ :
------> 0 | : source_index : st-:--- | : :
OuputFile output_files[] / +------------------------------------+ : :
/ 1 | : : : | : :
^ +------+------------+-----+ / +------------------------------------+ : :
: | : ost_index -:-----:------/ 2 | : : : | : :
nb_output_files : +------+------------+-----+ +====================================+ : :
: | : ost_index -:-----|-----------------> 3 | : : : | : :
: +------+------------+-----+ +------------------------------------+ : nb_output_streams :
: | : : | 4 | | : :
: +------+------------+-----+ +------------------------------------+ : :
: | : : | 5 | | : :
v +------+------------+-----+ +------------------------------------+ : :
6 | | : :
+------------------------------------+ : :
7 | | : :
+====================================+ v :
:

View File

@@ -28,7 +28,7 @@ various FFmpeg APIs.
@chapter Options
@c man begin OPTIONS
@include avtools-common-opts.texi
@include fftools-common-opts.texi
@section Main options
@@ -38,9 +38,8 @@ Force displayed width.
@item -y @var{height}
Force displayed height.
@item -s @var{size}
Set frame size (WxH or abbreviation), needed for videos which do
not contain a header with the frame size like raw YUV. This option
has been deprecated in favor of private options, try -video_size.
Set frame size (WxH or abbreviation), needed for videos which don't
contain a header with the frame size like raw YUV.
@item -an
Disable audio.
@item -vn
@@ -91,7 +90,6 @@ Read @var{input_file}.
@table @option
@item -pix_fmt @var{format}
Set pixel format.
This option has been deprecated in favor of private options, try -pixel_format.
@item -stats
Show the stream duration, the codec parameters, the current position in
the stream and the audio/video synchronisation drift.
@@ -134,8 +132,6 @@ Exit when video is done playing.
Exit if any key is pressed.
@item -exitonmousedown
Exit if any mouse button is pressed.
@item -codec:@var{stream_type}
Force a specific decoder implementation
@end table
@section While playing
@@ -168,9 +164,6 @@ Seek backward/forward 10 seconds.
@item down/up
Seek backward/forward 1 minute.
@item page down/page up
Seek backward/forward 10 minutes.
@item mouse click
Seek to percentage in file corresponding to fraction of width.

View File

@@ -42,18 +42,25 @@ for specifying which information to display, and for setting how
ffprobe will show it.
ffprobe output is designed to be easily parsable by a textual filter,
and consists of one or more sections of a form defined by the selected
writer, which is specified by the @option{print_format} option.
and consists of one or more sections of the form:
@example
[SECTION]
key1=val1
...
keyN=valN
[/SECTION]
@end example
Metadata tags stored in the container or in the streams are recognized
and printed in the corresponding "FORMAT" or "STREAM" section.
and printed in the corresponding "FORMAT" or "STREAM" section, and
are prefixed by the string "TAG:".
@c man end
@chapter Options
@c man begin OPTIONS
@include avtools-common-opts.texi
@include fftools-common-opts.texi
@section Main options
@@ -80,25 +87,6 @@ Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
Prettify the format of the displayed values, it corresponds to the
options "-unit -prefix -byte_binary_prefix -sexagesimal".
@item -print_format @var{writer_name}[=@var{writer_options}]
Set the output printing format.
@var{writer_name} specifies the name of the writer, and
@var{writer_options} specifies the options to be passed to the writer.
For example for printing the output in JSON format, specify:
@example
-print_format json
@end example
For more details on the available output printing formats, see the
Writers section below.
@item -show_error
Show information about the error found when trying to probe the input.
The error information is printed within a section with name "ERROR".
@item -show_format
Show information about the container format of the input multimedia
stream.
@@ -113,13 +101,6 @@ stream.
The information for each single packet is printed within a dedicated
section with name "PACKET".
@item -show_frames
Show information about each frame contained in the input multimedia
stream.
The information for each single frame is printed within a dedicated
section with name "FRAME".
@item -show_streams
Show information about each media stream contained in the input
multimedia stream.
@@ -127,190 +108,12 @@ multimedia stream.
Each media stream information is printed within a dedicated section
with name "STREAM".
@item -show_private_data, -private
Show private data, that is data depending on the format of the
particular shown element.
This option is enabled by default, but you may need to disable it
for specific uses, for example when creating XSD-compliant XML output.
@item -show_program_version
Show information related to program version.
Version information is printed within a section with name
"PROGRAM_VERSION".
@item -show_library_versions
Show information related to library versions.
Version information for each library is printed within a section with
name "LIBRARY_VERSION".
@item -show_versions
Show information related to program and library versions. This is the
equivalent of setting both @option{-show_program_version} and
@option{-show_library_versions} options.
@item -i @var{input_file}
Read @var{input_file}.
@end table
@c man end
@chapter Writers
@c man begin WRITERS
A writer defines the output format adopted by @command{ffprobe}, and will be
used for printing all the parts of the output.
A writer may accept one or more arguments, which specify the options to
adopt.
A description of the currently available writers follows.
@section default
Default format.
Print each section in the form:
@example
[SECTION]
key1=val1
...
keyN=valN
[/SECTION]
@end example
Metadata tags are printed as a line in the corresponding FORMAT or
STREAM section, and are prefixed by the string "TAG:".
@section compact
Compact format.
Each section is printed on a single line.
If no option is specifid, the output has the form:
@example
section|key1=val1| ... |keyN=valN
@end example
Metadata tags are printed in the corresponding "format" or "stream"
section. A metadata tag key, if printed, is prefixed by the string
"tag:".
This writer accepts options as a list of @var{key}=@var{value} pairs,
separated by ":".
The description of the accepted options follows.
@table @option
@item item_sep, s
Specify the character to use for separating fields in the output line.
It must be a single printable character, it is "|" by default.
@item nokey, nk
If set to 1 specify not to print the key of each field. Its default
value is 0.
@item escape, e
Set the escape mode to use, default to "c".
It can assume one of the following values:
@table @option
@item c
Perform C-like escaping. Strings containing a newline ('\n') or
carriage return ('\r'), the escaping character ('\') or the item
separator character @var{SEP} are escaped using C-like fashioned
escaping, so that a newline is converted to the sequence "\n", a
carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
converted to "\@var{SEP}".
@item csv
Perform CSV-like escaping, as described in RFC4180. Strings
containing a newline ('\n'), a carriage return ('\r'), a double quote
('"'), or @var{SEP} are enclosed in double-quotes.
@item none
Perform no escaping.
@end table
@end table
@section csv
CSV format.
This writer is equivalent to
@code{compact=item_sep=,:nokey=1:escape=csv}.
@section json
JSON based format.
Each section is printed using JSON notation.
This writer accepts options as a list of @var{key}=@var{value} pairs,
separated by ":".
The description of the accepted options follows.
@table @option
@item compact, c
If set to 1 enable compact output, that is each section will be
printed on a single line. Default value is 0.
@end table
For more information about JSON, see @url{http://www.json.org/}.
@section xml
XML based format.
The XML output is described in the XML schema description file
@file{ffprobe.xsd} installed in the FFmpeg datadir.
Note that the output issued will be compliant to the
@file{ffprobe.xsd} schema only when no special global output options
(@option{unit}, @option{prefix}, @option{byte_binary_prefix},
@option{sexagesimal} etc.) are specified.
This writer accepts options as a list of @var{key}=@var{value} pairs,
separated by ":".
The description of the accepted options follows.
@table @option
@item fully_qualified, q
If set to 1 specify if the output should be fully qualified. Default
value is 0.
This is required for generating an XML file which can be validated
through an XSD file.
@item xsd_compliant, x
If set to 1 perform more checks for ensuring that the output is XSD
compliant. Default value is 0.
This option automatically sets @option{fully_qualified} to 1.
@end table
For more information about the XML format, see
@url{http://www.w3.org/XML/}.
@chapter Timecode
@command{ffprobe} supports Timecode extraction:
@itemize
@item MPEG1/2 timecode is extracted from the GOP, and is available in the video
stream details (@option{-show_streams}, see @var{timecode}).
@item MOV timecode is extracted from tmcd track, so is available in the tmcd
stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
@item DV and GXF timecodes are available in format metadata
(@option{-show_format}, see @var{TAG:timecode}).
@end itemize
@c man end WRITERS
@include decoders.texi
@include demuxers.texi
@include protocols.texi

View File

@@ -1,164 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ffmpeg.org/schema/ffprobe"
xmlns:ffprobe="http://www.ffmpeg.org/schema/ffprobe">
<xsd:element name="ffprobe" type="ffprobe:ffprobeType"/>
<xsd:complexType name="ffprobeType">
<xsd:sequence>
<xsd:element name="packets" type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
<xsd:element name="frames" type="ffprobe:framesType" minOccurs="0" maxOccurs="1" />
<xsd:element name="streams" type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
<xsd:element name="format" type="ffprobe:formatType" minOccurs="0" maxOccurs="1" />
<xsd:element name="error" type="ffprobe:errorType" minOccurs="0" maxOccurs="1" />
<xsd:element name="program_version" type="ffprobe:programVersionType" minOccurs="0" maxOccurs="1" />
<xsd:element name="library_versions" type="ffprobe:libraryVersionsType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="packetsType">
<xsd:sequence>
<xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="framesType">
<xsd:sequence>
<xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="packetType">
<xsd:attribute name="codec_type" type="xsd:string" use="required" />
<xsd:attribute name="stream_index" type="xsd:int" use="required" />
<xsd:attribute name="pts" type="xsd:long" />
<xsd:attribute name="pts_time" type="xsd:float" />
<xsd:attribute name="dts" type="xsd:long" />
<xsd:attribute name="dts_time" type="xsd:float" />
<xsd:attribute name="duration" type="xsd:long" />
<xsd:attribute name="duration_time" type="xsd:float" />
<xsd:attribute name="size" type="xsd:long" use="required" />
<xsd:attribute name="pos" type="xsd:long" />
<xsd:attribute name="flags" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="frameType">
<xsd:attribute name="media_type" type="xsd:string" use="required"/>
<xsd:attribute name="key_frame" type="xsd:int" use="required"/>
<xsd:attribute name="pts" type="xsd:long" />
<xsd:attribute name="pts_time" type="xsd:float"/>
<xsd:attribute name="pkt_pts" type="xsd:long" />
<xsd:attribute name="pkt_pts_time" type="xsd:float"/>
<xsd:attribute name="pkt_dts" type="xsd:long" />
<xsd:attribute name="pkt_dts_time" type="xsd:float"/>
<xsd:attribute name="pkt_pos" type="xsd:long" />
<!-- audio attributes -->
<xsd:attribute name="sample_fmt" type="xsd:string"/>
<xsd:attribute name="nb_samples" type="xsd:long" />
<!-- video attributes -->
<xsd:attribute name="width" type="xsd:long" />
<xsd:attribute name="height" type="xsd:long" />
<xsd:attribute name="pix_fmt" type="xsd:string"/>
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
<xsd:attribute name="pict_type" type="xsd:string"/>
<xsd:attribute name="coded_picture_number" type="xsd:long" />
<xsd:attribute name="display_picture_number" type="xsd:long" />
<xsd:attribute name="interlaced_frame" type="xsd:int" />
<xsd:attribute name="top_field_first" type="xsd:int" />
<xsd:attribute name="repeat_pict" type="xsd:int" />
<xsd:attribute name="reference" type="xsd:int" />
</xsd:complexType>
<xsd:complexType name="streamsType">
<xsd:sequence>
<xsd:element name="stream" type="ffprobe:streamType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="streamType">
<xsd:attribute name="index" type="xsd:int" use="required"/>
<xsd:attribute name="codec_name" type="xsd:string" />
<xsd:attribute name="codec_long_name" type="xsd:string" />
<xsd:attribute name="codec_type" type="xsd:string" />
<xsd:attribute name="codec_time_base" type="xsd:string" use="required"/>
<xsd:attribute name="codec_tag" type="xsd:string" use="required"/>
<xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
<!-- video attributes -->
<xsd:attribute name="width" type="xsd:int"/>
<xsd:attribute name="height" type="xsd:int"/>
<xsd:attribute name="has_b_frames" type="xsd:int"/>
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
<xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
<xsd:attribute name="pix_fmt" type="xsd:string"/>
<xsd:attribute name="level" type="xsd:int"/>
<xsd:attribute name="timecode" type="xsd:string"/>
<!-- audio attributes -->
<xsd:attribute name="sample_fmt" type="xsd:string"/>
<xsd:attribute name="sample_rate" type="xsd:int"/>
<xsd:attribute name="channels" type="xsd:int"/>
<xsd:attribute name="bits_per_sample" type="xsd:int"/>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="r_frame_rate" type="xsd:string" use="required"/>
<xsd:attribute name="avg_frame_rate" type="xsd:string" use="required"/>
<xsd:attribute name="time_base" type="xsd:string" use="required"/>
<xsd:attribute name="start_time" type="xsd:float"/>
<xsd:attribute name="duration" type="xsd:float"/>
<xsd:attribute name="nb_frames" type="xsd:int"/>
</xsd:complexType>
<xsd:complexType name="formatType">
<xsd:sequence>
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="filename" type="xsd:string" use="required"/>
<xsd:attribute name="nb_streams" type="xsd:int" use="required"/>
<xsd:attribute name="format_name" type="xsd:string" use="required"/>
<xsd:attribute name="format_long_name" type="xsd:string" use="required"/>
<xsd:attribute name="start_time" type="xsd:float"/>
<xsd:attribute name="duration" type="xsd:float"/>
<xsd:attribute name="size" type="xsd:long"/>
<xsd:attribute name="bit_rate" type="xsd:long"/>
</xsd:complexType>
<xsd:complexType name="tagType">
<xsd:attribute name="key" type="xsd:string" use="required"/>
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="errorType">
<xsd:attribute name="code" type="xsd:int" use="required"/>
<xsd:attribute name="string" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="programVersionType">
<xsd:attribute name="version" type="xsd:string" use="required"/>
<xsd:attribute name="copyright" type="xsd:string" use="required"/>
<xsd:attribute name="build_date" type="xsd:string" use="required"/>
<xsd:attribute name="build_time" type="xsd:string" use="required"/>
<xsd:attribute name="compiler_type" type="xsd:string" use="required"/>
<xsd:attribute name="compiler_version" type="xsd:string" use="required"/>
<xsd:attribute name="configuration" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="libraryVersionType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="major" type="xsd:int" use="required"/>
<xsd:attribute name="minor" type="xsd:int" use="required"/>
<xsd:attribute name="micro" type="xsd:int" use="required"/>
<xsd:attribute name="version" type="xsd:int" use="required"/>
</xsd:complexType>
<xsd:complexType name="libraryVersionsType">
<xsd:sequence>
<xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

View File

@@ -23,7 +23,6 @@ ffserver [options]
@c man begin DESCRIPTION
ffserver is a streaming server for both audio and video. It supports
several live feeds, streaming from files and time shifting on live feeds
(you can seek to positions in the past on each live feed, provided you
specify a big enough feed storage in ffserver.conf).
@@ -35,7 +34,7 @@ file.
This documentation covers only the streaming aspects of ffserver /
ffmpeg. All questions about parameters for ffmpeg, codec questions,
etc. are not covered here. Read @file{ffmpeg.html} for more
etc. are not covered here. Read @file{ffmpeg-doc.html} for more
information.
@section How does it work?
@@ -111,8 +110,8 @@ As a simple test, just run the following two command lines where INPUTFILE
is some file which you can decode with ffmpeg:
@example
ffserver -f doc/ffserver.conf &
ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
./ffserver -f doc/ffserver.conf &
./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
@end example
At this point you should be able to go to your Windows machine and fire up
@@ -147,7 +146,7 @@ that only captures in stereo and also requires that one channel be flipped.
If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
starting ffmpeg.
@subsection The audio and video lose sync after a while.
@subsection The audio and video loose sync after a while.
Yes, they do.
@@ -241,7 +240,7 @@ For example: @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
@chapter Options
@c man begin OPTIONS
@include avtools-common-opts.texi
@include fftools-common-opts.texi
@section Main options
@@ -266,7 +265,7 @@ rather than as a daemon.
@c man begin SEEALSO
ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffserver.conf}
ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffmpeg/doc/ffserver.conf}
example and the FFmpeg HTML documentation
@c man end

View File

@@ -0,0 +1,93 @@
All the numerical options, if not specified otherwise, accept in input
a string representing a number, which may contain one of the
International System number postfixes, for example 'K', 'M', 'G'.
If 'i' is appended after the postfix, powers of 2 are used instead of
powers of 10. The 'B' postfix multiplies the value for 8, and can be
appended after another postfix or used alone. This allows using for
example 'KB', 'MiB', 'G' and 'B' as postfix.
Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing
with "no" the option name, for example using "-nofoo" in the
commandline will set to false the boolean option with name "foo".
@section Generic options
These options are shared amongst the ff* tools.
@table @option
@item -L
Show license.
@item -h, -?, -help, --help
Show help.
@item -version
Show version.
@item -formats
Show available formats.
The fields preceding the format names have the following meanings:
@table @samp
@item D
Decoding available
@item E
Encoding available
@end table
@item -codecs
Show available codecs.
The fields preceding the codec names have the following meanings:
@table @samp
@item D
Decoding available
@item E
Encoding available
@item V/A/S
Video/audio/subtitle codec
@item S
Codec supports slices
@item D
Codec supports direct rendering
@item T
Codec can handle input truncated at random locations instead of only at frame boundaries
@end table
@item -bsfs
Show available bitstream filters.
@item -protocols
Show available protocols.
@item -filters
Show available libavfilter filters.
@item -pix_fmts
Show available pixel formats.
@item -loglevel @var{loglevel}
Set the logging level used by the library.
@var{loglevel} is a number or a string containing one of the following values:
@table @samp
@item quiet
@item panic
@item fatal
@item error
@item warning
@item info
@item verbose
@item debug
@end table
By default the program logs to stderr, if coloring is supported by the
terminal, colors are used to mark errors and warnings. Log coloring
can be disabled setting the environment variable
@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
the environment variable @env{FFMPEG_FORCE_COLOR}.
The use of the environment variable @env{NO_COLOR} is deprecated and
will be dropped in a following FFmpeg version.
@end table

File diff suppressed because it is too large Load Diff

View File

@@ -9,92 +9,29 @@
@contents
@chapter External libraries
@chapter external libraries
FFmpeg can be hooked up with a number of external libraries to add support
for more formats. None of them are used by default, their use has to be
explicitly requested by passing the appropriate flags to @file{./configure}.
@section OpenJPEG
FFmpeg can use the OpenJPEG libraries for encoding/decoding J2K videos. Go to
@url{http://www.openjpeg.org/} to get the libraries and follow the installation
instructions. To enable using OpenJPEG in FFmpeg, pass @code{--enable-libopenjpeg} to
@file{./configure}.
@section OpenCORE and VisualOn libraries
Spun off Google Android sources, OpenCore and VisualOn libraries provide
encoders for a number of audio codecs.
@float NOTE
OpenCORE and VisualOn libraries are under the Apache License 2.0
(see @url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
incompatible with the LGPL version 2.1 and GPL version 2. You have to
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
GPL components, GPL version 3) to use it.
@end float
@subsection OpenCORE AMR
@section OpenCORE AMR
FFmpeg can make use of the OpenCORE libraries for AMR-NB
decoding/encoding and AMR-WB decoding.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the libraries.
Then pass @code{--enable-libopencore-amrnb} and/or
@code{--enable-libopencore-amrwb} to configure to enable them.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for
installing the libraries. Then pass @code{--enable-libopencore-amrnb} and/or
@code{--enable-libopencore-amrwb} to configure to enable the libraries.
@subsection VisualOn AAC encoder library
FFmpeg can make use of the VisualOn AACenc library for AAC encoding.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the library.
Then pass @code{--enable-libvo-aacenc} to configure to enable it.
@subsection VisualOn AMR-WB encoder library
FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the library.
Then pass @code{--enable-libvo-amrwbenc} to configure to enable it.
@section LAME
FFmpeg can make use of the LAME library for MP3 encoding.
Go to @url{http://lame.sourceforge.net/} and follow the
instructions for installing the library.
Then pass @code{--enable-libmp3lame} to configure to enable it.
@section libvpx
FFmpeg can make use of the libvpx library for VP8 encoding.
Go to @url{http://www.webmproject.org/} and follow the instructions for
installing the library. Then pass @code{--enable-libvpx} to configure to
enable it.
@section x264
FFmpeg can make use of the x264 library for H.264 encoding.
Go to @url{http://www.videolan.org/developers/x264.html} and follow the
instructions for installing the library. Then pass @code{--enable-libx264} to
configure to enable it.
@float NOTE
x264 is under the GNU Public License Version 2 or later
(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
details), you must upgrade FFmpeg's license to GPL in order to use it.
@end float
Note that OpenCORE is under the Apache License 2.0 (see
@url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
incompatible with the LGPL version 2.1 and GPL version 2. You have to
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
GPL components, GPL version 3) to use it.
@chapter Supported File Formats, Codecs or Features
@chapter Supported File Formats and Codecs
You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
@@ -108,15 +45,12 @@ library:
@item 4xm @tab @tab X
@tab 4X Technologies format, used in some games.
@item 8088flex TMV @tab @tab X
@item ACT Voice @tab @tab X
@tab contains G.729 audio
@item Adobe Filmstrip @tab X @tab X
@item Audio IFF (AIFF) @tab X @tab X
@item American Laser Games MM @tab @tab X
@tab Multimedia format used in games like Mad Dog McCree.
@item 3GPP AMR @tab X @tab X
@item Apple HTTP Live Streaming @tab @tab X
@item Artworx Data Format @tab @tab X
@item ASF @tab X @tab X
@item AVI @tab X @tab X
@item AVISynth @tab @tab X
@@ -126,17 +60,12 @@ library:
@tab Audio and video format used in some games by Beam Software.
@item Bethesda Softworks VID @tab @tab X
@tab Used in some games from Bethesda Softworks.
@item Binary text @tab @tab X
@item Bink @tab @tab X
@tab Multimedia format used by many games.
@item Bitmap Brothers JV @tab @tab X
@tab Used in Z and Z95 games.
@item Brute Force & Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels.
@item BWF @tab X @tab X
@item CRI ADX @tab X @tab X
@tab Audio-only format used in console video games.
@item Discworld II BMV @tab @tab X
@item Interplay C93 @tab @tab X
@tab Used in the game Cyberia from Interplay.
@item Delphine Software International CIN @tab @tab X
@@ -172,19 +101,13 @@ library:
@item framecrc testing format @tab X @tab
@item FunCom ISS @tab @tab X
@tab Audio format used in various games from FunCom like The Longest Journey.
@item G.723.1 @tab X @tab X
@item G.729 BIT @tab X @tab X
@item G.729 raw @tab @tab X
@item GIF Animation @tab X @tab
@item GXF @tab X @tab X
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
playout servers.
@item iCEDraw File @tab @tab X
@item ICO @tab @tab X
@tab Microsoft Windows ICO
@item id Quake II CIN video @tab @tab X
@item id RoQ @tab X @tab X
@tab Used in Quake III, Jedi Knight 2 and other computer games.
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item IEC61937 encapsulation @tab X @tab X
@item IFF @tab @tab X
@tab Interchange File Format
@@ -194,11 +117,8 @@ library:
@tab A format generated by IndigoVision 8000 video server.
@item IVF (On2) @tab X @tab X
@tab A format used by libvpx
@item LATM @tab X @tab X
@item LMLM4 @tab @tab X
@tab Used by Linux Media Labs MPEG-4 PCI boards
@item LOAS @tab @tab X
@tab contains LATM multiplexed AAC audio
@item LXF @tab @tab X
@tab VR native stream format, used by Leitch/Harris' video servers.
@item Matroska @tab X @tab X
@@ -307,7 +227,6 @@ library:
@item RTP @tab X @tab X
@item RTSP @tab X @tab X
@item SAP @tab X @tab X
@item SBG @tab @tab X
@item SDP @tab @tab X
@item Sega FILM/CPK @tab @tab X
@tab Used in many Sega Saturn console games.
@@ -317,9 +236,7 @@ library:
@tab Used in Sierra CD-ROM games.
@item Smacker @tab @tab X
@tab Multimedia format used by many games.
@item SMJPEG @tab X @tab X
@tab Used in certain Loki game ports.
@item Sony OpenMG (OMA) @tab X @tab X
@item Sony OpenMG (OMA) @tab @tab X
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
@item Sony PlayStation STR @tab @tab X
@item Sony Wave64 (W64) @tab @tab X
@@ -335,18 +252,15 @@ library:
@item WAV @tab X @tab X
@item WavPack @tab @tab X
@item WebM @tab X @tab X
@item Windows Televison (WTV) @tab X @tab X
@item Windows Televison (WTV) @tab @tab X
@item Wing Commander III movie @tab @tab X
@tab Multimedia format used in Origin's Wing Commander III computer game.
@item Westwood Studios audio @tab @tab X
@tab Multimedia format used in Westwood Studios games.
@item Westwood Studios VQA @tab @tab X
@tab Multimedia format used in Westwood Studios games.
@item XMV @tab @tab X
@tab Microsoft video container used in Xbox games.
@item xWMA @tab @tab X
@tab Microsoft audio container used by XAudio 2.
@item eXtended BINary text (XBIN) @tab @tab X
@item YUV4MPEG pipe @tab X @tab X
@item Psygnosis YOP @tab @tab X
@end multitable
@@ -387,6 +301,7 @@ following image formats are supported:
@item PIC @tab @tab X
@tab Pictor/PC Paint
@item PNG @tab X @tab X
@tab 2/4 bpp not supported yet
@item PPM @tab X @tab X
@tab Portable PixelMap image
@item PTX @tab @tab X
@@ -399,8 +314,6 @@ following image formats are supported:
@tab YUV, JPEG and some extension is not supported yet.
@item Truevision Targa @tab X @tab X
@tab Targa (.TGA) image format
@item XWD @tab X @tab X
@tab X Window Dump image format
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@@ -420,11 +333,10 @@ following image formats are supported:
@tab Creates video suitable to be played on a commodore 64 (multicolor mode).
@item American Laser Games MM @tab @tab X
@tab Used in games like Mad Dog McCree.
@item AMV Video @tab X @tab X
@item AMV Video @tab @tab X
@tab Used in Chinese MP3 players.
@item ANSI/ASCII art @tab @tab X
@item Apple MJPEG-B @tab @tab X
@item Apple ProRes @tab X @tab X
@item Apple QuickDraw @tab @tab X
@tab fourcc: qdrw
@item Asus v1 @tab X @tab X
@@ -440,8 +352,6 @@ following image formats are supported:
@item Autodesk Animator Flic video @tab @tab X
@item Autodesk RLE @tab @tab X
@tab fourcc: AASC
@item Avid 1:1 10-bit RGB Packer @tab X @tab X
@tab fourcc: AVrp
@item AVS (Audio Video Standard) video @tab @tab X
@tab Video encoding used by the Creature Shock game.
@item Beam Software VB @tab @tab X
@@ -449,7 +359,6 @@ following image formats are supported:
@tab Used in some games from Bethesda Softworks.
@item Bink Video @tab @tab X
@item Bitmap Brothers JV video @tab @tab X
@item y41p Brooktree uncompressed 4:1:1 12-bit @tab X @tab X
@item Brute Force & Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels.
@item C93 video @tab @tab X
@@ -462,14 +371,13 @@ following image formats are supported:
@tab AVS1-P2, JiZhun profile, encoding through external library libxavs
@item Delphine Software International CIN video @tab @tab X
@tab Codec used in Delphine Software International games.
@item Discworld II BMV Video @tab @tab X
@item Cinepak @tab @tab X
@item Cirrus Logic AccuPak @tab X @tab X
@item Cirrus Logic AccuPak @tab @tab X
@tab fourcc: CLJR
@item Creative YUV (CYUV) @tab @tab X
@item DFA @tab @tab X
@tab Codec used in Chronomaster game.
@item Dirac @tab E @tab X
@item Dirac @tab E @tab E
@tab supported through external libdirac/libschroedinger libraries
@item Deluxe Paint Animation @tab @tab X
@item DNxHD @tab X @tab X
@@ -479,7 +387,6 @@ following image formats are supported:
@item Duck TrueMotion 2.0 @tab @tab X
@tab fourcc: TM20
@item DV (Digital Video) @tab X @tab X
@item Dxtory capture format @tab @tab X
@item Feeble Files/ScummVM DXA @tab @tab X
@tab Codec originally used in Feeble Files game.
@item Electronic Arts CMV video @tab @tab X
@@ -489,12 +396,11 @@ following image formats are supported:
@item Electronic Arts TGQ video @tab @tab X
@item Electronic Arts TQI video @tab @tab X
@item Escape 124 @tab @tab X
@item Escape 130 @tab @tab X
@item FFmpeg video codec #1 @tab X @tab X
@tab experimental lossless codec (fourcc: FFV1)
@item Flash Screen Video v1 @tab X @tab X
@tab fourcc: FSV1
@item Flash Screen Video v2 @tab X @tab X
@item Flash Screen Video v2 @tab X
@item Flash Video (FLV) @tab X @tab X
@tab Sorenson H.263 used in Flash
@item Fraps @tab @tab X
@@ -513,19 +419,17 @@ following image formats are supported:
@item id RoQ video @tab X @tab X
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item IFF ILBM @tab @tab X
@tab IFF interleaved bitmap
@tab IFF interlaved bitmap
@item IFF ByteRun1 @tab @tab X
@tab IFF run length encoded bitmap
@item Intel H.263 @tab @tab X
@item Intel Indeo 2 @tab @tab X
@item Intel Indeo 3 @tab @tab X
@item Intel Indeo 4 @tab @tab X
@item Intel Indeo 5 @tab @tab X
@item Interplay C93 @tab @tab X
@tab Used in the game Cyberia from Interplay.
@item Interplay MVE video @tab @tab X
@tab Used in Interplay .MVE files.
@item J2K @tab X @tab X
@item Karl Morton's video codec @tab @tab X
@tab Codec used in Worms games.
@item Kega Game Video (KGV1) @tab @tab X
@@ -549,7 +453,7 @@ following image formats are supported:
@item MPEG-1/2 video (VDPAU acceleration) @tab @tab X
@item MPEG-2 video @tab X @tab X
@item MPEG-4 part 2 @tab X @tab X
@tab libxvidcore can be used alternatively for encoding.
@ libxvidcore can be used alternatively for encoding.
@item MPEG-4 part 2 Microsoft variant version 1 @tab @tab X
@item MPEG-4 part 2 Microsoft variant version 2 @tab X @tab X
@item MPEG-4 part 2 Microsoft variant version 3 @tab X @tab X
@@ -566,8 +470,6 @@ following image formats are supported:
@tab fourcc: VP80, encoding supported through external library libvpx
@item planar RGB @tab @tab X
@tab fourcc: 8BPS
@item Prores @tab @tab X
@tab fourcc: apch,apcn,apcs,apco
@item Q-team QPEG @tab @tab X
@tab fourccs: QPEG, Q1.0, Q1.1
@item QuickTime 8BPS video @tab @tab X
@@ -577,8 +479,8 @@ following image formats are supported:
@tab fourcc: 'smc '
@item QuickTime video (RPZA) @tab @tab X
@tab fourcc: rpza
@item R10K AJA Kona 10-bit RGB Codec @tab X @tab X
@item R210 Quicktime Uncompressed RGB 10-bit @tab X @tab X
@item R10K AJA Kona 10-bit RGB Codec @tab @tab X
@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X
@item Raw Video @tab X @tab X
@item RealVideo 1.0 @tab X @tab X
@item RealVideo 2.0 @tab X @tab X
@@ -609,15 +511,10 @@ following image formats are supported:
@tab encoding supported through external library libtheora
@item Tiertex Limited SEQ video @tab @tab X
@tab Codec used in DOS CD-ROM FlashBack game.
@item Ut Video @tab @tab X
@item v210 QuickTime uncompressed 4:2:2 10-bit @tab X @tab X
@item v308 QuickTime uncompressed 4:4:4 @tab X @tab X
@item v410 QuickTime uncompressed 4:4:4 10-bit @tab X @tab X
@item VBLE Lossless Codec @tab @tab X
@item V210 Quicktime Uncompressed 4:2:2 10-bit @tab X @tab X
@item VMware Screen Codec / VMware Video @tab @tab X
@tab Codec used in videos captured by VMware.
@item Westwood Studios VQA (Vector Quantized Animation) video @tab @tab X
@item Windows Media Image @tab @tab X
@item Windows Media Video 7 @tab X @tab X
@item Windows Media Video 8 @tab X @tab X
@item Windows Media Video 9 @tab @tab X
@@ -630,8 +527,6 @@ following image formats are supported:
@item WMV7 @tab X @tab X
@item YAMAHA SMAF @tab X @tab X
@item Psygnosis YOP Video @tab @tab X
@item yuv4 @tab X @tab X
@tab libquicktime uncompressed packed 4:2:0
@item ZLIB @tab X @tab X
@tab part of LCL, encoder experimental
@item Zip Motion Blocks Video @tab X @tab X
@@ -647,8 +542,6 @@ following image formats are supported:
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item 8SVX audio @tab @tab X
@item AAC+ @tab E @tab X
@tab encoding supported through external library libaacplus
@item AAC @tab E @tab X
@tab encoding supported through external library libfaac and libvo-aacenc
@item AC-3 @tab IX @tab X
@@ -706,16 +599,15 @@ following image formats are supported:
@item Atrac 3 @tab @tab X
@item Bink Audio @tab @tab X
@tab Used in Bink and Smacker files in many games.
@item CELT @tab @tab E
@item CELT (Opus) @tab @tab E
@tab decoding supported through external library libcelt
@item Delphine Software International CIN audio @tab @tab X
@tab Codec used in Delphine Software International games.
@item Discworld II BMV Audio @tab @tab X
@item COOK @tab @tab X
@tab All versions except 5.1 are supported.
@item DCA (DTS Coherent Acoustics) @tab X @tab X
@item DPCM id RoQ @tab X @tab X
@tab Used in Quake III, Jedi Knight 2 and other computer games.
@tab Used in Quake III, Jedi Knight 2, other computer games.
@item DPCM Interplay @tab @tab X
@tab Used in various Interplay computer games.
@item DPCM Sierra Online @tab @tab X
@@ -727,8 +619,6 @@ following image formats are supported:
@item DV audio @tab @tab X
@item Enhanced AC-3 @tab X @tab X
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
@item G.723.1 @tab X @tab X
@item G.729 @tab @tab X
@item GSM @tab E @tab X
@tab encoding supported through external library libgsm
@item GSM Microsoft variant @tab E @tab X
@@ -771,7 +661,7 @@ following image formats are supported:
@item PCM unsigned 24-bit little-endian @tab X @tab X
@item PCM unsigned 32-bit big-endian @tab X @tab X
@item PCM unsigned 32-bit little-endian @tab X @tab X
@item PCM Zork @tab @tab X
@item PCM Zork @tab X @tab X
@item QCELP / PureVoice @tab @tab X
@item QDesign Music Codec 2 @tab @tab X
@tab There are still some distortions.
@@ -791,7 +681,7 @@ following image formats are supported:
@tab experimental codec
@item Sonic lossless @tab X @tab X
@tab experimental codec
@item Speex @tab E @tab E
@item Speex @tab @tab E
@tab supported through external library libspeex
@item True Audio (TTA) @tab @tab X
@item TrueHD @tab @tab X
@@ -857,7 +747,6 @@ performance on systems without hardware floating point support).
@item JACK @tab X @tab
@item LIBDC1394 @tab X @tab
@item OSS @tab X @tab X
@item Pulseaudio @tab X @tab
@item Video4Linux @tab X @tab
@item Video4Linux2 @tab X @tab
@item VfW capture @tab X @tab
@@ -866,15 +755,342 @@ performance on systems without hardware floating point support).
@code{X} means that input/output is supported.
@section Timecode
@multitable @columnfractions .4 .1 .1
@item Codec/format @tab Read @tab Write
@item DV @tab X @tab X
@item GXF @tab X @tab X
@item MOV @tab X @tab
@item MPEG1/2 @tab X @tab X
@item MXF @tab @tab X
@end multitable
@chapter Platform Specific information
@section DOS
Using a cross-compiler is preferred for various reasons.
@section OS/2
For information about compiling FFmpeg on OS/2 see
@url{http://www.edm2.com/index.php/FFmpeg}.
@section Unix-like
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
assembler which is still provided by a few AMD64 distributions. To
make sure your compiler really uses the required version of gas
after a binutils upgrade, run:
@example
$(gcc -print-prog-name=as) --version
@end example
If not, then you should install a different compiler that has no
hard-coded path to gas. In the worst case pass @code{--disable-asm}
to configure.
@subsection BSD
BSD make will not build FFmpeg, you need to install and use GNU Make
(@file{gmake}).
@subsection (Open)Solaris
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
standard Solaris Make will not work. When building with a non-c99 front-end
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
since the libc is not c99-compliant by default. The probes performed by
configure may raise an exception leading to the death of configure itself
due to a bug in the system shell. Simply invoke a different shell such as
bash directly to work around this:
@example
bash ./configure
@end example
@subsection Darwin (MacOS X, iPhone)
MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Just download the Perl script and put it somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
@section Windows
To get help and instructions for building FFmpeg under Windows, check out
the FFmpeg Windows Help Forum at
@url{http://ffmpeg.arrozcru.org/}.
@subsection Native Windows compilation
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
You can find detailed installation
instructions in the download section and the FAQ.
FFmpeg does not build out-of-the-box with the packages the automated MinGW
installer provides. It also requires coreutils to be installed and many other
packages updated to the latest version. The minimum version for some packages
are listed below:
@itemize
@item bash 3.1
@item msys-make 3.81-2 (note: not mingw32-make)
@item w32api 3.13
@item mingw-runtime 3.15
@end itemize
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
Notes:
@itemize
@item Building natively using MSYS can be sped up by disabling implicit rules
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
speed up is close to non-existent for normal one-off builds and is only
noticeable when running make for a second time (for example in
@code{make install}).
@item In order to compile FFplay, you must have the MinGW development library
of SDL. Get it from @url{http://www.libsdl.org}.
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
where SDL was installed. Verify that @file{sdl-config} can be launched from
the MSYS command line.
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
you can build libavutil, libavcodec and libavformat as DLLs.
@end itemize
@subsection Microsoft Visual C++ compatibility
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
want to use the libav* libraries in your own applications, you can still
compile those applications using MSVC++. But the libav* libraries you link
to @emph{must} be built with MinGW. However, you will not be able to debug
inside the libav* libraries, since MSVC++ does not recognize the debug
symbols generated by GCC.
We strongly recommend you to move over from MSVC++ to MinGW tools.
This description of how to use the FFmpeg libraries with MSVC++ is based on
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
you might have to modify the procedures slightly.
@subsubsection Using static libraries
Assuming you have just built and installed FFmpeg in @file{/usr/local}.
@enumerate
@item Create a new console application ("File / New / Project") and then
select "Win32 Console Application". On the appropriate page of the
Application Wizard, uncheck the "Precompiled headers" option.
@item Write the source code for your application, or, for testing, just
copy the code from an existing sample application into the source file
that MSVC++ has already created for you. For example, you can copy
@file{libavformat/output-example.c} from the FFmpeg distribution.
@item Open the "Project / Properties" dialog box. In the "Configuration"
combo box, select "All Configurations" so that the changes you make will
affect both debug and release builds. In the tree view on the left hand
side, select "C/C++ / General", then edit the "Additional Include
Directories" setting to contain the path where the FFmpeg includes were
installed (i.e. @file{c:\msys\1.0\local\include}).
Do not add MinGW's include directory here, or the include files will
conflict with MSVC's.
@item Still in the "Project / Properties" dialog box, select
"Linker / General" from the tree view and edit the
"Additional Library Directories" setting to contain the @file{lib}
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
and the directory where MinGW's GCC libs are installed
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
to the end of "Additional Dependencies".
@item Now, select "C/C++ / Code Generation" from the tree view. Select
"Debug" in the "Configuration" combo box. Make sure that "Runtime
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
the "Configuration" combo box and make sure that "Runtime Library" is
set to "Multi-threaded DLL".
@item Click "OK" to close the "Project / Properties" dialog box.
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
and install it in MSVC++'s include directory
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
@item MSVC++ also does not understand the @code{inline} keyword used by
FFmpeg, so you must add this line before @code{#include}ing libav*:
@example
#define inline _inline
@end example
@item Build your application, everything should work.
@end enumerate
@subsubsection Using shared libraries
This is how to create DLL and LIB files that are compatible with MSVC++:
@enumerate
@item Add a call to @file{vcvars32.bat} (which sets up the environment
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
The standard location for @file{vcvars32.bat} is
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
If this corresponds to your setup, add the following line as the first line
of @file{msys.bat}:
@example
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
@end example
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
and run @file{c:\msys\1.0\msys.bat} from there.
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
from @file{Microsoft (R) Library Manager}, this means your environment
variables are set up correctly, the @file{Microsoft (R) Library Manager}
is on the path and will be used by FFmpeg to create
MSVC++-compatible import libraries.
@item Build FFmpeg with
@example
./configure --enable-shared
make
make install
@end example
Your install path (@file{/usr/local/} by default) should now have the
necessary DLL and LIB files under the @file{bin} directory.
@end enumerate
To use those files with MSVC++, do the same as you would do with
the static libraries, as described above. But in Step 4,
you should only need to add the directory where the LIB files are installed
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
installed in the @file{bin} directory. And instead of adding the static
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
(@file{avcodec.lib}, @file{avformat.lib}, and
@file{avutil.lib}). Note that you should not use the GCC import
libraries (@file{libxxx.dll.a} files), as these will give you undefined
reference errors. There should be no need for @file{libmingwex.a},
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
statically linked into the DLLs. The @file{bin} directory contains a bunch
of DLL files, but the ones that are actually used to run your application
are the ones with a major version number in their filenames
(i.e. @file{avcodec-51.dll}).
FFmpeg headers do not declare global data for Windows DLLs through the usual
dllexport/dllimport interface. Such data will be exported properly while
building, but to use them in your MSVC++ code you will have to edit the
appropriate headers and mark the data as dllimport. For example, in
libavutil/pixdesc.h you should have:
@example
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
@end example
Note that using import libraries created by dlltool requires
the linker optimization option to be set to
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
the resulting binaries will fail during runtime. This isn't
required when using import libraries generated by lib.exe.
This issue is reported upstream at
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
@subsection Cross compilation for Windows with Linux
You must use the MinGW cross compilation tools available at
@url{http://www.mingw.org/}.
Then configure FFmpeg with the following options:
@example
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
@end example
(you can change the cross-prefix according to the prefix chosen for the
MinGW tools).
Then you can easily test FFmpeg with Wine
(@url{http://www.winehq.com/}).
@subsection Compilation under Cygwin
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
llrint() in its C library.
Install your Cygwin with all the "Base" packages, plus the
following "Devel" ones:
@example
binutils, gcc4-core, make, git, mingw-runtime, texi2html
@end example
And the following "Utils" one:
@example
diffutils
@end example
Then run
@example
./configure
@end example
to make a static build.
The current @code{gcc4-core} package is buggy and needs this flag to build
shared libraries:
@example
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
@end example
If you want to build FFmpeg with additional libraries, download Cygwin
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
@example
libogg-devel, libvorbis-devel
@end example
These library packages are only available from Cygwin Ports
(@url{http://sourceware.org/cygwinports/}) :
@example
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
libxvidcore-devel
@end example
The recommendation for libnut and x264 is to build them from source by
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
@subsection Crosscompilation for Windows under Cygwin
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
Just install your Cygwin as explained before, plus these additional
"Devel" packages:
@example
gcc-mingw-core, mingw-runtime, mingw-zlib
@end example
and add some special flags to your configure invocation.
For a static build run
@example
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
and for a build with shared libraries
@example
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
@bye

View File

@@ -1,344 +0,0 @@
\input texinfo @c -*- texinfo -*-
@settitle Using git to develop FFmpeg
@titlepage
@center @titlefont{Using git to develop FFmpeg}
@end titlepage
@top
@contents
@chapter Introduction
This document aims in giving some quick references on a set of useful git
commands. You should always use the extensive and detailed documentation
provided directly by git:
@example
git --help
man git
@end example
shows you the available subcommands,
@example
git <command> --help
man git-<command>
@end example
shows information about the subcommand <command>.
Additional information could be found on the
@url{http://gitref.org, Git Reference} website
For more information about the Git project, visit the
@url{http://git-scm.com/, Git website}
Consult these resources whenever you have problems, they are quite exhaustive.
What follows now is a basic introduction to Git and some FFmpeg-specific
guidelines to ease the contribution to the project
@chapter Basics Usage
@section Get GIT
You can get git from @url{http://git-scm.com/}
Most distribution and operating system provide a package for it.
@section Cloning the source tree
@example
git clone git://source.ffmpeg.org/ffmpeg <target>
@end example
This will put the FFmpeg sources into the directory @var{<target>}.
@example
git clone git@@source.ffmpeg.org:ffmpeg <target>
@end example
This will put the FFmpeg sources into the directory @var{<target>} and let
you push back your changes to the remote repository.
@section Updating the source tree to the latest revision
@example
git pull (--rebase)
@end example
pulls in the latest changes from the tracked branch. The tracked branch
can be remote. By default the master branch tracks the branch master in
the remote origin.
@float IMPORTANT
@command{--rebase} (see below) is recommended.
@end float
@section Rebasing your local branches
@example
git pull --rebase
@end example
fetches the changes from the main repository and replays your local commits
over it. This is required to keep all your local changes at the top of
FFmpeg's master tree. The master tree will reject pushes with merge commits.
@section Adding/removing files/directories
@example
git add [-A] <filename/dirname>
git rm [-r] <filename/dirname>
@end example
GIT needs to get notified of all changes you make to your working
directory that makes files appear or disappear.
Line moves across files are automatically tracked.
@section Showing modifications
@example
git diff <filename(s)>
@end example
will show all local modifications in your working directory as unified diff.
@section Inspecting the changelog
@example
git log <filename(s)>
@end example
You may also use the graphical tools like gitview or gitk or the web
interface available at http://source.ffmpeg.org/
@section Checking source tree status
@example
git status
@end example
detects all the changes you made and lists what actions will be taken in case
of a commit (additions, modifications, deletions, etc.).
@section Committing
@example
git diff --check
@end example
to double check your changes before committing them to avoid trouble later
on. All experienced developers do this on each and every commit, no matter
how small.
Every one of them has been saved from looking like a fool by this many times.
It's very easy for stray debug output or cosmetic modifications to slip in,
please avoid problems through this extra level of scrutiny.
For cosmetics-only commits you should get (almost) empty output from
@example
git diff -w -b <filename(s)>
@end example
Also check the output of
@example
git status
@end example
to make sure you don't have untracked files or deletions.
@example
git add [-i|-p|-A] <filenames/dirnames>
@end example
Make sure you have told git your name and email address
@example
git config --global user.name "My Name"
git config --global user.email my@@email.invalid
@end example
Use @var{--global} to set the global configuration for all your git checkouts.
Git will select the changes to the files for commit. Optionally you can use
the interactive or the patch mode to select hunk by hunk what should be
added to the commit.
@example
git commit
@end example
Git will commit the selected changes to your current local branch.
You will be prompted for a log message in an editor, which is either
set in your personal configuration file through
@example
git config --global core.editor
@end example
or set by one of the following environment variables:
@var{GIT_EDITOR}, @var{VISUAL} or @var{EDITOR}.
Log messages should be concise but descriptive. Explain why you made a change,
what you did will be obvious from the changes themselves most of the time.
Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
levels look at and educate themselves while reading through your code. Don't
include filenames in log messages, Git provides that information.
Possibly make the commit message have a terse, descriptive first line, an
empty line and then a full description. The first line will be used to name
the patch by git format-patch.
@section Preparing a patchset
@example
git format-patch <commit> [-o directory]
@end example
will generate a set of patches for each commit between @var{<commit>} and
current @var{HEAD}. E.g.
@example
git format-patch origin/master
@end example
will generate patches for all commits on current branch which are not
present in upstream.
A useful shortcut is also
@example
git format-patch -n
@end example
which will generate patches from last @var{n} commits.
By default the patches are created in the current directory.
@section Sending patches for review
@example
git send-email <commit list|directory>
@end example
will send the patches created by @command{git format-patch} or directly
generates them. All the email fields can be configured in the global/local
configuration or overridden by command line.
Note that this tool must often be installed separately (e.g. @var{git-email}
package on Debian-based distros).
@section Renaming/moving/copying files or contents of files
Git automatically tracks such changes, making those normal commits.
@example
mv/cp path/file otherpath/otherfile
git add [-A] .
git commit
@end example
@chapter FFmpeg specific
@section Reverting broken commits
@example
git reset <commit>
@end example
@command{git reset} will uncommit the changes till @var{<commit>} rewriting
the current branch history.
@example
git commit --amend
@end example
allows to amend the last commit details quickly.
@example
git rebase -i origin/master
@end example
will replay local commits over the main repository allowing to edit, merge
or remove some of them in the process.
@float NOTE
@command{git reset}, @command{git commit --amend} and @command{git rebase}
rewrite history, so you should use them ONLY on your local or topic branches.
The main repository will reject those changes.
@end float
@example
git revert <commit>
@end example
@command{git revert} will generate a revert commit. This will not make the
faulty commit disappear from the history.
@section Pushing changes to remote trees
@example
git push
@end example
Will push the changes to the default remote (@var{origin}).
Git will prevent you from pushing changes if the local and remote trees are
out of sync. Refer to and to sync the local tree.
@example
git remote add <name> <url>
@end example
Will add additional remote with a name reference, it is useful if you want
to push your local branch for review on a remote host.
@example
git push <remote> <refspec>
@end example
Will push the changes to the @var{<remote>} repository.
Omitting @var{<refspec>} makes @command{git push} update all the remote
branches matching the local ones.
@section Finding a specific svn revision
Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
based on a regular expression. see man gitrevisions
@example
git show :/'as revision 23456'
@end example
will show the svn changeset @var{r23456}. With older git versions searching in
the @command{git log} output is the easiest option (especially if a pager with
search capabilities is used).
This commit can be checked out with
@example
git checkout -b svn_23456 :/'as revision 23456'
@end example
or for git < 1.7.1 with
@example
git checkout -b svn_23456 $SHA1
@end example
where @var{$SHA1} is the commit hash from the @command{git log} output.
@chapter Server Issues
Contact the project admins @email{root@@ffmpeg.org} if you have technical
problems with the GIT server.

View File

@@ -39,17 +39,16 @@ I. BASICS:
0. Get GIT:
Most distributions have a git package, if not
You can get git from http://git-scm.com/
1. Cloning the source tree:
git clone git://source.ffmpeg.org/ffmpeg <target>
git clone git://git.videolan.org/ffmpeg <target>
This will put the FFmpeg sources into the directory <target>.
git clone git@source.ffmpeg.org:ffmpeg <target>
git clone git@git.videolan.org:ffmpeg <target>
This will put the FFmpeg sources into the directory <target> and let
you push back your changes to the remote repository.
@@ -98,7 +97,7 @@ I. BASICS:
git log <filename(s)>
You may also use the graphical tools like gitview or gitk or the web
interface available at http://source.ffmpeg.org
interface available at http://git.videolan.org
6. Checking source tree status:
@@ -206,19 +205,8 @@ I. BASICS:
git format-patch <commit> [-o directory]
will generate a set of patches for each commit between <commit> and
current HEAD. E.g.
git format-patch origin/master
will generate patches for all commits on current branch which are not
present in upstream.
A useful shortcut is also
git format-patch -n
which will generate patches from last n commits.
By default the patches are created in the current directory.
will generate a set of patches out of the current branch starting from
commit. By default the patches are created in the current directory.
11. Sending patches for review
@@ -227,8 +215,6 @@ I. BASICS:
will send the patches created by git format-patch or directly generates
them. All the email fields can be configured in the global/local
configuration or overridden by command line.
Note that this tool must often be installed separately (e.g. git-email
package on Debian-based distros).
12. Pushing changes to remote trees

View File

@@ -42,7 +42,7 @@ specify card number or identifier, device number and subdevice number
To see the list of cards currently recognized by your system check the
files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
For example to capture with @command{ffmpeg} from an ALSA device with
For example to capture with @file{ffmpeg} from an ALSA device with
card id 0, you may run the command:
@example
ffmpeg -f alsa -i hw:0 alsaout.wav
@@ -55,101 +55,6 @@ For more information see:
BSD video input device.
@section dshow
Windows DirectShow input device.
DirectShow support is enabled when FFmpeg is built with mingw-w64.
Currently only audio and video devices are supported.
Multiple devices may be opened as separate inputs, but they may also be
opened on the same input, which should improve synchronism between them.
The input name should be in the format:
@example
@var{TYPE}=@var{NAME}[:@var{TYPE}=@var{NAME}]
@end example
where @var{TYPE} can be either @var{audio} or @var{video},
and @var{NAME} is the device's name.
@subsection Options
If no options are specified, the device's defaults are used.
If the device does not support the requested options, it will
fail to open.
@table @option
@item video_size
Set the video size in the captured video.
@item framerate
Set the framerate in the captured video.
@item sample_rate
Set the sample rate (in Hz) of the captured audio.
@item sample_size
Set the sample size (in bits) of the captured audio.
@item channels
Set the number of channels in the captured audio.
@item list_devices
If set to @option{true}, print a list of devices and exit.
@item list_options
If set to @option{true}, print a list of selected device's options
and exit.
@item video_device_number
Set video device number for devices with same name (starts at 0,
defaults to 0).
@item audio_device_number
Set audio device number for devices with same name (starts at 0,
defaults to 0).
@end table
@subsection Examples
@itemize
@item
Print the list of DirectShow supported devices and exit:
@example
$ ffmpeg -list_devices true -f dshow -i dummy
@end example
@item
Open video device @var{Camera}:
@example
$ ffmpeg -f dshow -i video="Camera"
@end example
@item
Open second video device with name @var{Camera}:
@example
$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
@end example
@item
Open video device @var{Camera} and audio device @var{Microphone}:
@example
$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
@end example
@item
Print the list of supported options in selected device and exit:
@example
$ ffmpeg -list_options true -f dshow -i video="Camera"
@end example
@end itemize
@section dv1394
Linux DV 1394 input device.
@@ -167,14 +72,14 @@ For more detailed information read the file
Documentation/fb/framebuffer.txt included in the Linux source tree.
To record from the framebuffer device @file{/dev/fb0} with
@command{ffmpeg}:
@file{ffmpeg}:
@example
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
@end example
You can take a single screenshot image with the command:
@example
ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
@end example
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
@@ -196,15 +101,15 @@ device.
Once you have created one or more JACK readable clients, you need to
connect them to one or more JACK writable clients.
To connect or disconnect JACK clients you can use the @command{jack_connect}
and @command{jack_disconnect} programs, or do it through a graphical interface,
for example with @command{qjackctl}.
To connect or disconnect JACK clients you can use the
@file{jack_connect} and @file{jack_disconnect} programs, or do it
through a graphical interface, for example with @file{qjackctl}.
To list the JACK clients and their properties you can invoke the command
@command{jack_lsp}.
@file{jack_lsp}.
Follows an example which shows how to capture a JACK readable client
with @command{ffmpeg}.
with @file{ffmpeg}.
@example
# Create a JACK writable client with name "ffmpeg".
$ ffmpeg -f jack -i ffmpeg -y out.wav
@@ -228,165 +133,10 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
For more information read:
@url{http://jackaudio.org/}
@section lavfi
Libavfilter input virtual device.
This input device reads data from the open output pads of a libavfilter
filtergraph.
For each filtergraph open output, the input device will create a
corresponding stream which is mapped to the generated output. Currently
only video data is supported. The filtergraph is specified through the
option @option{graph}.
@subsection Options
@table @option
@item graph
Specify the filtergraph to use as input. Each video open output must be
labelled by a unique string of the form "out@var{N}", where @var{N} is a
number starting from 0 corresponding to the mapped input stream
generated by the device.
The first unlabelled output is automatically assigned to the "out0"
label, but all the others need to be specified explicitly.
If not specified defaults to the filename specified for the input
device.
@end table
@subsection Examples
@itemize
@item
Create a color video stream and play it back with @command{ffplay}:
@example
ffplay -f lavfi -graph "color=pink [out0]" dummy
@end example
@item
As the previous example, but use filename for specifying the graph
description, and omit the "out0" label:
@example
ffplay -f lavfi color=pink
@end example
@item
Create three different video test filtered sources and play them:
@example
ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
@end example
@item
Read an audio stream from a file using the amovie source and play it
back with @command{ffplay}:
@example
ffplay -f lavfi "amovie=test.wav"
@end example
@item
Read an audio stream and a video stream and play it back with
@command{ffplay}:
@example
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end example
@end itemize
@section libdc1394
IIDC1394 input device, based on libdc1394 and libraw1394.
@section openal
The OpenAL input device provides audio capture on all systems with a
working OpenAL 1.1 implementation.
To enable this input device during configuration, you need OpenAL
headers and libraries installed on your system, and need to configure
FFmpeg with @code{--enable-openal}.
OpenAL headers and libraries should be provided as part of your OpenAL
implementation, or as an additional download (an SDK). Depending on your
installation you may need to specify additional flags via the
@code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
system to locate the OpenAL headers and libraries.
An incomplete list of OpenAL implementations follows:
@table @strong
@item Creative
The official Windows implementation, providing hardware acceleration
with supported devices and software fallback.
See @url{http://openal.org/}.
@item OpenAL Soft
Portable, open source (LGPL) software implementation. Includes
backends for the most common sound APIs on the Windows, Linux,
Solaris, and BSD operating systems.
See @url{http://kcat.strangesoft.net/openal.html}.
@item Apple
OpenAL is part of Core Audio, the official Mac OS X Audio interface.
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
@end table
This device allows to capture from an audio input device handled
through OpenAL.
You need to specify the name of the device to capture in the provided
filename. If the empty string is provided, the device will
automatically select the default device. You can get the list of the
supported devices by using the option @var{list_devices}.
@subsection Options
@table @option
@item channels
Set the number of channels in the captured audio. Only the values
@option{1} (monaural) and @option{2} (stereo) are currently supported.
Defaults to @option{2}.
@item sample_size
Set the sample size (in bits) of the captured audio. Only the values
@option{8} and @option{16} are currently supported. Defaults to
@option{16}.
@item sample_rate
Set the sample rate (in Hz) of the captured audio.
Defaults to @option{44.1k}.
@item list_devices
If set to @option{true}, print a list of devices and exit.
Defaults to @option{false}.
@end table
@subsection Examples
Print the list of OpenAL supported devices and exit:
@example
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
@end example
Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
@example
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
@end example
Capture from the default device (note the empty string '' as filename):
@example
$ ffmpeg -f openal -i '' out.ogg
@end example
Capture from two devices simultaneously, writing to two different files,
within the same @command{ffmpeg} command:
@example
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
@end example
Note: not all OpenAL implementations support multiple simultaneous capture -
try the latest OpenAL Soft if the above does not work.
@section oss
Open Sound System input device.
@@ -395,7 +145,7 @@ The filename to provide to the input device is the device node
representing the OSS input device, and is usually set to
@file{/dev/dsp}.
For example to grab from @file{/dev/dsp} using @command{ffmpeg} use the
For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the
command:
@example
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
@@ -404,89 +154,6 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
For more information about OSS see:
@url{http://manuals.opensound.com/usersguide/dsp.html}
@section pulse
pulseaudio input device.
To enable this input device during configuration you need libpulse-simple
installed in your system.
The filename to provide to the input device is a source device or the
string "default"
To list the pulse source devices and their properties you can invoke
the command @command{pactl list sources}.
@example
ffmpeg -f pulse -i default /tmp/pulse.wav
@end example
@subsection @var{server} AVOption
The syntax is:
@example
-server @var{server name}
@end example
Connects to a specific server.
@subsection @var{name} AVOption
The syntax is:
@example
-name @var{application name}
@end example
Specify the application name pulse will use when showing active clients,
by default it is the LIBAVFORMAT_IDENT string
@subsection @var{stream_name} AVOption
The syntax is:
@example
-stream_name @var{stream name}
@end example
Specify the stream name pulse will use when showing active streams,
by default it is "record"
@subsection @var{sample_rate} AVOption
The syntax is:
@example
-sample_rate @var{samplerate}
@end example
Specify the samplerate in Hz, by default 48kHz is used.
@subsection @var{channels} AVOption
The syntax is:
@example
-channels @var{N}
@end example
Specify the channels in use, by default 2 (stereo) is set.
@subsection @var{frame_size} AVOption
The syntax is:
@example
-frame_size @var{bytes}
@end example
Specify the number of byte per frame, by default it is set to 1024.
@subsection @var{fragment_size} AVOption
The syntax is:
@example
-fragment_size @var{bytes}
@end example
Specify the minimal buffering fragment in pulseaudio, it will affect the
audio latency. By default it is unset.
@section sndio
sndio input device.
@@ -498,7 +165,7 @@ The filename to provide to the input device is the device node
representing the sndio input device, and is usually set to
@file{/dev/audio0}.
For example to grab from @file{/dev/audio0} using @command{ffmpeg} use the
For example to grab from @file{/dev/audio0} using @file{ffmpeg} use the
command:
@example
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
@@ -516,20 +183,17 @@ the device.
Video4Linux and Video4Linux2 devices only support a limited set of
@var{width}x@var{height} sizes and framerates. You can check which are
supported for example with the command @command{dov4l} for Video4Linux
devices and using @command{-list_formats all} for Video4Linux2 devices.
supported for example with the command @file{dov4l} for Video4Linux
devices and the command @file{v4l-info} for Video4Linux2 devices.
If the size for the device is set to 0x0, the input device will
try to auto-detect the size to use.
try to autodetect the size to use.
Only for the video4linux2 device, if the frame rate is set to 0/0 the
input device will use the frame rate value already set in the driver.
Video4Linux support is deprecated since Linux 2.6.30, and will be
dropped in later versions.
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
option), it will always be used.
Follow some usage examples of the video4linux devices with the ff*
tools.
@example
@@ -537,18 +201,15 @@ tools.
# to the default of 25/1.
ffplay -s 320x240 -f video4linux /dev/video0
# Grab and show the input of a video4linux2 device, auto-adjust size.
# Grab and show the input of a video4linux2 device, autoadjust size.
ffplay -f video4linux2 /dev/video0
# Grab and record the input of a video4linux2 device, auto-adjust size,
# Grab and record the input of a video4linux2 device, autoadjust size,
# frame rate value defaults to 0/0 so it is read from the video4linux2
# driver.
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
@end example
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
"video4linux2".
@section vfwcap
VfW (Video for Windows) capture input device.
@@ -570,7 +231,7 @@ The filename passed as input has the syntax:
@var{hostname}:@var{display_number}.@var{screen_number} specifies the
X11 display name of the screen to grab from. @var{hostname} can be
omitted, and defaults to "localhost". The environment variable
ommitted, and defaults to "localhost". The environment variable
@env{DISPLAY} contains the default display name.
@var{x_offset} and @var{y_offset} specify the offsets of the grabbed
@@ -579,54 +240,15 @@ default to 0.
Check the X11 documentation (e.g. man X) for more detailed information.
Use the @command{dpyinfo} program for getting basic information about the
Use the @file{dpyinfo} program for getting basic information about the
properties of your X11 display (e.g. grep for "name" or "dimensions").
For example to grab from @file{:0.0} using @command{ffmpeg}:
For example to grab from @file{:0.0} using @file{ffmpeg}:
@example
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
# Grab at position 10,20.
ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
@end example
@subsection @var{follow_mouse} AVOption
The syntax is:
@example
-follow_mouse centered|@var{PIXELS}
@end example
When it is specified with "centered", the grabbing region follows the mouse
pointer and keeps the pointer at the center of region; otherwise, the region
follows only when the mouse pointer reaches within @var{PIXELS} (greater than
zero) to the edge of region.
For example:
@example
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
# Follows only when the mouse pointer reaches within 100 pixels to edge
ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
@end example
@subsection @var{show_region} AVOption
The syntax is:
@example
-show_region 1
@end example
If @var{show_region} AVOption is specified with @var{1}, then the grabbing
region will be indicated on screen. With this option, it's easy to know what is
being grabbed if only a portion of the screen is grabbed.
For example:
@example
ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
# With follow_mouse
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
@end example
@c man end INPUT DEVICES

View File

@@ -5,42 +5,32 @@ NOTE: This is a draft.
Overview:
---------
FFmpeg uses Trac for tracking issues, new issues and changes to
existing issues can be done through a web interface.
Issues can be different kinds of things we want to keep track of
but that do not belong into the source tree itself. This includes
bug reports, patches, feature requests and license violations. We
might add more items to this list in the future, so feel free to
propose a new `type of issue' on the ffmpeg-devel mailing list if
you feel it is worth tracking.
It is possible to subscribe to individual issues by adding yourself to the
Cc list or to subscribe to the ffmpeg-trac mailing list which receives
a mail for every change to every issue.
nosy list or to subscribe to the ffmpeg-issues mailing list which receives
a mail for every change to every issue. Replies to such mails will also
be properly added to the respective issue.
(the above does all work already after light testing)
The subscription URL for the ffmpeg-trac list is:
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
The URL of the webinterface of the tracker is:
http(s)://trac.ffmpeg.org
http(s)://ffmpeg.org/trac/ffmpeg
NOTE: issue = (bug report || patch || feature request)
Type:
-----
bug / defect
bug
An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
prevents it from behaving as intended.
feature request / enhancement
feature request
Request of support for encoding or decoding of a new codec, container
or variant.
Request of support for more, less or plain different output or behavior
where the current implementation cannot be considered wrong.
license violation
ticket to keep track of (L)GPL violations of ffmpeg by others
patch
A patch as generated by diff which conforms to the patch submission and
development policy.
@@ -61,8 +51,6 @@ important
the separation to normal is somewhat fuzzy.
For feature requests this priority would be used for things many people
want.
Regressions also should be marked as important, regressions are bugs that
don't exist in a past revision or another branch.
normal
@@ -92,17 +80,6 @@ closed
final state
Analyzed flag:
--------------
Bugs which have been analyzed and where it is understood what causes them
and which exact chain of events triggers them. This analysis should be
available as a message in the bug report.
Note, do not change the status to analyzed without also providing a clear
and understandable analysis.
This state implicates that the bug either has been reproduced or that
reproduction is not needed as the bug is already understood.
Type/Status/Substatus:
----------
*/new/new
@@ -130,6 +107,24 @@ Type/Status/Substatus:
Issues for which some information has been requested by the developers,
but which has not been provided by anyone within reasonable time.
bug/open/reproduced
Bugs which have been reproduced.
bug/open/analyzed
Bugs which have been analyzed and where it is understood what causes them
and which exact chain of events triggers them. This analysis should be
available as a message in the bug report.
Note, do not change the status to analyzed without also providing a clear
and understandable analysis.
This state implicates that the bug either has been reproduced or that
reproduction is not needed as the bug is already understood.
bug/open/needs_more_info
Bug reports which are incomplete and or where more information is needed
from the submitter or another person who can provide it.
This state implicates that the bug has not been analyzed or reproduced.
Note, the idea behind needs_more_info is to offload work from the
developers to the users whenever possible.
bug/closed/fixed
Bugs which have to the best of our knowledge been fixed.
@@ -163,6 +158,10 @@ patch/closed/applied
patch/closed/rejected
Patches which have been rejected.
feature_request/open/needs_more_info
Feature requests where it is not clear what exactly is wanted
(these also could be closed as invalid ...).
feature_request/closed/implemented
Feature requests which have been implemented.
@@ -174,10 +173,12 @@ Note, please do not use type-status-substatus combinations other than the
above without asking on ffmpeg-dev first!
Note2, if you provide the requested info do not forget to remove the
needs_more_info substatus.
needs_more_info substate.
Component:
----------
Topic:
------
A topic is a tag you should add to your issue in order to make grouping them
easier.
avcodec
issues in libavcodec/*
@@ -197,9 +198,6 @@ ffmpeg
ffplay
issues in or related to ffplay.c
ffprobe
issues in or related to ffprobe.c
ffserver
issues in or related to ffserver.c
@@ -207,7 +205,7 @@ build system
issues in or related to configure/Makefile
regression
bugs which were not present in a past revision
bugs which were working in a past revision
trac
roundup
issues related to our issue tracker

View File

@@ -14,8 +14,20 @@
Libavfilter is the filtering API of FFmpeg. It is the substitute of the
now deprecated 'vhooks' and started as a Google Summer of Code project.
Audio filtering integration into the main FFmpeg repository is a work in
progress, so audio API and ABI should not be considered stable yet.
Integrating libavfilter into the main FFmpeg repository is a work in
progress. If you wish to try the unfinished development code of
libavfilter then check it out from the libavfilter repository into
some directory of your choice by:
@example
svn checkout svn://svn.ffmpeg.org/soc/libavfilter
@end example
And then read the README file in the top directory to learn how to
integrate it into ffmpeg and ffplay.
But note that there may still be serious bugs in the code and its API
and ABI should not be considered stable yet!
@chapter Tutorial
@@ -36,20 +48,21 @@ and the vflip filter before merging it back with the other stream by
overlaying it on top. You can use the following command to achieve this:
@example
ffmpeg -i input -vf "[in] split [T1], fifo, [T2] overlay=0:H/2 [out]; [T1] fifo, crop=iw:ih/2:0:ih/2, vflip [T2]" output
./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
@end example
The result will be that in output the top half of the video is mirrored
where input_video.avi has a vertical resolution of 480 pixels. The
result will be that in output the top half of the video is mirrored
onto the bottom half.
Video filters are loaded using the @var{-vf} option passed to
@command{ffmpeg} or to @command{ffplay}. Filters in the same linear
chain are separated by commas. In our example, @var{split, fifo,
overlay} are in one linear chain, and @var{fifo, crop, vflip} are in
another. The points where the linear chains join are labeled by names
enclosed in square brackets. In our example, that is @var{[T1]} and
@var{[T2]}. The magic labels @var{[in]} and @var{[out]} are the points
where video is input and output.
ffmpeg or to ffplay. Filters in the same linear chain are separated by
commas. In our example, @var{split, fifo, overlay} are in one linear
chain, and @var{fifo, crop, vflip} are in another. The points where
the linear chains join are labeled by names enclosed in square
brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
labels @var{[in]} and @var{[out]} are the points where video is input
and output.
Some filters take in input a list of parameters: they are specified
after the filter name and an equal sign, and are separated each other

View File

@@ -43,15 +43,15 @@ You can print the CRC to stdout with the command:
ffmpeg -i INPUT -f crc -
@end example
You can select the output format of each frame with @command{ffmpeg} by
You can select the output format of each frame with @file{ffmpeg} by
specifying the audio and video codec and format. For example to
compute the CRC of the input audio converted to PCM unsigned 8-bit
and the input video converted to MPEG-2 video, use the command:
@example
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
@end example
See also the @ref{framecrc} muxer.
See also the @code{framecrc} muxer (@pxref{framecrc}).
@anchor{framecrc}
@section framecrc
@@ -79,18 +79,17 @@ You can print the CRC of each decoded frame to stdout with the command:
ffmpeg -i INPUT -f framecrc -
@end example
You can select the output format of each frame with @command{ffmpeg} by
You can select the output format of each frame with @file{ffmpeg} by
specifying the audio and video codec and format. For example, to
compute the CRC of each decoded input audio frame converted to PCM
unsigned 8-bit and of each decoded input video frame converted to
MPEG-2 video, use the command:
@example
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
@end example
See also the @ref{crc} muxer.
See also the @code{crc} muxer (@pxref{crc}).
@anchor{image2}
@section image2
Image file muxer.
@@ -120,26 +119,26 @@ The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
etc.
The following example shows how to use @command{ffmpeg} for creating a
The following example shows how to use @file{ffmpeg} for creating a
sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
taking one image every second from the input video:
@example
ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
@end example
Note that with @command{ffmpeg}, if the format is not specified with the
Note that with @file{ffmpeg}, if the format is not specified with the
@code{-f} option and the output filename specifies an image file
format, the image2 muxer is automatically selected, so the previous
command can be written as:
@example
ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
@end example
Note also that the pattern must not necessarily contain "%d" or
"%0@var{N}d", for example to create a single image file
@file{img.jpeg} from the input video you can employ the command:
@example
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
@end example
The image muxer supports the .Y.U.V image file format. This format is
@@ -148,18 +147,6 @@ each of the YUV420P components. To read or write this image file format,
specify the name of the '.Y' file. The muxer will automatically open the
'.U' and '.V' files as required.
@section mov
MOV / MP4 muxer
The muxer options are:
@table @option
@item -moov_size @var{bytes}
Reserves space for the moov atom at the beginning of the file instead of placing the
moov atom at the end. If the space reserved is insufficient, muxing will fail.
@end table
@section mpegts
MPEG transport stream muxer.
@@ -190,7 +177,7 @@ and @code{service_name}. If they are not set the default for
@code{service_name} is "Service01".
@example
ffmpeg -i file.mpg -c copy \
ffmpeg -i file.mpg -acodec copy -vcodec copy \
-mpegts_original_network_id 0x1122 \
-mpegts_transport_stream_id 0x3344 \
-mpegts_service_id 0x5566 \
@@ -208,14 +195,14 @@ Null muxer.
This muxer does not generate any output file, it is mainly useful for
testing or benchmarking purposes.
For example to benchmark decoding with @command{ffmpeg} you can use the
For example to benchmark decoding with @file{ffmpeg} you can use the
command:
@example
ffmpeg -benchmark -i INPUT -f null out.null
@end example
Note that the above command does not read or write the @file{out.null}
file, but specifying the output file is required by the @command{ffmpeg}
file, but specifying the output file is required by the @file{ffmpeg}
syntax.
Alternatively you can write the command as:
@@ -283,38 +270,7 @@ Both eyes laced in one Block, Right-eye view is first
For example a 3D WebM clip can be created using the following command line:
@example
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
@end example
@section segment
Basic stream segmenter.
The segmenter muxer outputs streams to a number of separate files of nearly
fixed duration. Output filename pattern can be set in a fashion similar to
@ref{image2}.
Every segment starts with a video keyframe, if a video stream is present.
The segment muxer works best with a single constant frame rate video.
Optionally it can generate a flat list of the created segments, one segment
per line.
@table @option
@item segment_format @var{format}
Override the inner container format, by default it is guessed by the filename
extension.
@item segment_time @var{t}
Set segment duration to @var{t} seconds.
@item segment_list @var{name}
Generate also a listfile named @var{name}.
@item segment_list_size @var{size}
Overwrite the listfile once it reaches @var{size} entries.
@end table
@example
ffmpeg -i in.mkv -c copy -map 0 -f segment -list out.list out%03d.nut
@end example
@c man end MUXERS

View File

@@ -28,7 +28,7 @@ OSS (Open Sound System) output device.
@section sdl
SDL (Simple DirectMedia Layer) output device.
SDL (Simple Directmedia Layer) output device.
This output devices allows to show a video stream in an SDL
window. Only one SDL window is allowed per application, so you can
@@ -60,7 +60,7 @@ If not specified it defaults to the size of the input video.
@subsection Examples
The following command shows the @command{ffmpeg} output is an
The following command shows the @file{ffmpeg} output is an
SDL window, forcing its size to the qcif format:
@example
ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"

View File

@@ -1,391 +0,0 @@
\input texinfo @c -*- texinfo -*-
@settitle Platform Specific information
@titlepage
@center @titlefont{Platform Specific information}
@end titlepage
@top
@contents
@chapter Unix-like
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
assembler which is still provided by a few AMD64 distributions. To
make sure your compiler really uses the required version of gas
after a binutils upgrade, run:
@example
$(gcc -print-prog-name=as) --version
@end example
If not, then you should install a different compiler that has no
hard-coded path to gas. In the worst case pass @code{--disable-asm}
to configure.
@section BSD
BSD make will not build FFmpeg, you need to install and use GNU Make
(@file{gmake}).
@section (Open)Solaris
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
standard Solaris Make will not work. When building with a non-c99 front-end
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
since the libc is not c99-compliant by default. The probes performed by
configure may raise an exception leading to the death of configure itself
due to a bug in the system shell. Simply invoke a different shell such as
bash directly to work around this:
@example
bash ./configure
@end example
@anchor{Darwin}
@section Darwin (Mac OS X, iPhone)
The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{https://github.com/FFmpeg/gas-preprocessor} or
@url{https://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Put the Perl script somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
optimized assembler functions. @uref{http://www.finkproject.org/, Fink},
@uref{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix},
@uref{https://mxcl.github.com/homebrew/, Homebrew}
or @uref{http://www.macports.org, MacPorts} can easily provide it.
@chapter DOS
Using a cross-compiler is preferred for various reasons.
@url{http://www.delorie.com/howto/djgpp/linux-x-djgpp.html}
@chapter OS/2
For information about compiling FFmpeg on OS/2 see
@url{http://www.edm2.com/index.php/FFmpeg}.
@chapter Windows
To get help and instructions for building FFmpeg under Windows, check out
the FFmpeg Windows Help Forum at
@url{http://ffmpeg.arrozcru.org/}.
@section Native Windows compilation
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
You can find detailed installation instructions in the download
section and the FAQ.
FFmpeg does not build out-of-the-box with the packages the automated MinGW
installer provides. It also requires coreutils to be installed and many other
packages updated to the latest version. The minimum version for some packages
are listed below:
@itemize
@item bash 3.1
@item msys-make 3.81-2 (note: not mingw32-make)
@item w32api 3.13
@item mingw-runtime 3.15
@end itemize
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
Notes:
@itemize
@item Building natively using MSYS can be sped up by disabling implicit rules
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
speed up is close to non-existent for normal one-off builds and is only
noticeable when running make for a second time (for example in
@code{make install}).
@item In order to compile FFplay, you must have the MinGW development library
of @uref{http://www.libsdl.org/, SDL}.
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
where SDL was installed. Verify that @file{sdl-config} can be launched from
the MSYS command line.
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
libavformat) as DLLs.
@end itemize
@section Microsoft Visual C++ compatibility
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
want to use the libav* libraries in your own applications, you can still
compile those applications using MSVC++. But the libav* libraries you link
to @emph{must} be built with MinGW. However, you will not be able to debug
inside the libav* libraries, since MSVC++ does not recognize the debug
symbols generated by GCC.
We strongly recommend you to move over from MSVC++ to MinGW tools.
This description of how to use the FFmpeg libraries with MSVC++ is based on
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
you might have to modify the procedures slightly.
@subsection Using static libraries
Assuming you have just built and installed FFmpeg in @file{/usr/local}.
@enumerate
@item Create a new console application ("File / New / Project") and then
select "Win32 Console Application". On the appropriate page of the
Application Wizard, uncheck the "Precompiled headers" option.
@item Write the source code for your application, or, for testing, just
copy the code from an existing sample application into the source file
that MSVC++ has already created for you. For example, you can copy
@file{libavformat/output-example.c} from the FFmpeg distribution.
@item Open the "Project / Properties" dialog box. In the "Configuration"
combo box, select "All Configurations" so that the changes you make will
affect both debug and release builds. In the tree view on the left hand
side, select "C/C++ / General", then edit the "Additional Include
Directories" setting to contain the path where the FFmpeg includes were
installed (i.e. @file{c:\msys\1.0\local\include}).
Do not add MinGW's include directory here, or the include files will
conflict with MSVC's.
@item Still in the "Project / Properties" dialog box, select
"Linker / General" from the tree view and edit the
"Additional Library Directories" setting to contain the @file{lib}
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
and the directory where MinGW's GCC libs are installed
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
to the end of "Additional Dependencies".
@item Now, select "C/C++ / Code Generation" from the tree view. Select
"Debug" in the "Configuration" combo box. Make sure that "Runtime
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
the "Configuration" combo box and make sure that "Runtime Library" is
set to "Multi-threaded DLL".
@item Click "OK" to close the "Project / Properties" dialog box.
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
and install it in MSVC++'s include directory
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
@item MSVC++ also does not understand the @code{inline} keyword used by
FFmpeg, so you must add this line before @code{#include}ing libav*:
@example
#define inline _inline
@end example
@item Build your application, everything should work.
@end enumerate
@subsection Using shared libraries
This is how to create DLL and LIB files that are compatible with MSVC++:
@enumerate
@item Add a call to @file{vcvars32.bat} (which sets up the environment
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
The standard location for @file{vcvars32.bat} is
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
If this corresponds to your setup, add the following line as the first line
of @file{msys.bat}:
@example
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
@end example
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
and run @file{c:\msys\1.0\msys.bat} from there.
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
from @file{Microsoft (R) Library Manager}, this means your environment
variables are set up correctly, the @file{Microsoft (R) Library Manager}
is on the path and will be used by FFmpeg to create
MSVC++-compatible import libraries.
@item Build FFmpeg with
@example
./configure --enable-shared
make
make install
@end example
Your install path (@file{/usr/local/} by default) should now have the
necessary DLL and LIB files under the @file{bin} directory.
@end enumerate
Alternatively, build the libraries with a cross compiler, according to
the instructions below in @ref{Cross compilation for Windows with Linux}.
To use those files with MSVC++, do the same as you would do with
the static libraries, as described above. But in Step 4,
you should only need to add the directory where the LIB files are installed
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
installed in the @file{bin} directory. And instead of adding the static
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
(@file{avcodec.lib}, @file{avformat.lib}, and
@file{avutil.lib}). Note that you should not use the GCC import
libraries (@file{libxxx.dll.a} files), as these will give you undefined
reference errors. There should be no need for @file{libmingwex.a},
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
statically linked into the DLLs.
FFmpeg headers do not declare global data for Windows DLLs through the usual
dllexport/dllimport interface. Such data will be exported properly while
building, but to use them in your MSVC++ code you will have to edit the
appropriate headers and mark the data as dllimport. For example, in
libavutil/pixdesc.h you should have:
@example
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
@end example
Note that using import libraries created by dlltool requires
the linker optimization option to be set to
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
the resulting binaries will fail during runtime. This isn't
required when using import libraries generated by lib.exe.
This issue is reported upstream at
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
To create import libraries that work with the @code{/OPT:REF} option
(which is enabled by default in Release mode), follow these steps:
@enumerate
@item Open @file{Visual Studio 2005 Command Prompt}.
Alternatively, in a normal command line prompt, call @file{vcvars32.bat}
which sets up the environment variables for the Visual C++ tools
(the standard location for this file is
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}).
@item Enter the @file{bin} directory where the created LIB and DLL files
are stored.
@item Generate new import libraries with @file{lib.exe}:
@example
lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib
lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib
lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib
lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib
lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib
lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib
@end example
@end enumerate
@anchor{Cross compilation for Windows with Linux}
@section Cross compilation for Windows with Linux
You must use the MinGW cross compilation tools available at
@url{http://www.mingw.org/}.
Then configure FFmpeg with the following options:
@example
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
@end example
(you can change the cross-prefix according to the prefix chosen for the
MinGW tools).
Then you can easily test FFmpeg with @uref{http://www.winehq.com/, Wine}.
@section Compilation under Cygwin
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
llrint() in its C library.
Install your Cygwin with all the "Base" packages, plus the
following "Devel" ones:
@example
binutils, gcc4-core, make, git, mingw-runtime, texi2html
@end example
And the following "Utils" one:
@example
diffutils
@end example
Then run
@example
./configure
@end example
to make a static build.
The current @code{gcc4-core} package is buggy and needs this flag to build
shared libraries:
@example
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
@end example
If you want to build FFmpeg with additional libraries, download Cygwin
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
@example
libogg-devel, libvorbis-devel
@end example
These library packages are only available from
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
@example
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libaacplus-devel, libgsm-devel,
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
libxvidcore-devel
@end example
The recommendation for libnut and x264 is to build them from source by
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
of the @code{libgetaddrinfo-devel} package, available at Cygwin Ports.
@section Crosscompilation for Windows under Cygwin
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
Just install your Cygwin as explained before, plus these additional
"Devel" packages:
@example
gcc-mingw-core, mingw-runtime, mingw-zlib
@end example
and add some special flags to your configure invocation.
For a static build run
@example
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
and for a build with shared libraries
@example
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
@end example
@bye

View File

@@ -52,7 +52,7 @@ resource to be concatenated, each one possibly specifying a distinct
protocol.
For example to read a sequence of files @file{split1.mpeg},
@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the
@file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the
command:
@example
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
@@ -67,7 +67,7 @@ File access protocol.
Allow to read from or read to a file.
For example to read from a file @file{input.mpeg} with @command{ffmpeg}
For example to read from a file @file{input.mpeg} with @file{ffmpeg}
use the command:
@example
ffmpeg -i file:input.mpeg output.mpeg
@@ -134,14 +134,14 @@ pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number}
is not specified, by default the stdout file descriptor will be used
for writing, stdin for reading.
For example to read from stdin with @command{ffmpeg}:
For example to read from stdin with @file{ffmpeg}:
@example
cat test.wav | ffmpeg -i pipe:0
# ...this is the same as...
cat test.wav | ffmpeg -i pipe:
@end example
For writing to stdout with @command{ffmpeg}:
For writing to stdout with @file{ffmpeg}:
@example
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
# ...this is the same as...
@@ -155,8 +155,8 @@ be seekable, so they will fail with the pipe output protocol.
Real-Time Messaging Protocol.
The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
content across a TCP/IP network.
The Real-Time Messaging Protocol (RTMP) is used for streaming multime
dia content across a TCP/IP network.
The required syntax is:
@example
@@ -183,7 +183,7 @@ application specified in @var{app}, may be prefixed by "mp4:".
@end table
For example to read with @command{ffplay} a multimedia resource named
For example to read with @file{ffplay} a multimedia resource named
"sample" from the application "vod" from an RTMP server "myserver":
@example
ffplay rtmp://myserver/vod/sample
@@ -195,7 +195,7 @@ Real-Time Messaging Protocol and its variants supported through
librtmp.
Requires the presence of the librtmp headers and library during
configuration. You need to explicitly configure the build with
configuration. You need to explicitely configure the build with
"--enable-librtmp". If enabled this will replace the native RTMP
protocol.
@@ -219,12 +219,12 @@ meaning as specified for the RTMP native protocol.
See the librtmp manual page (man 3 librtmp) for more information.
For example, to stream a file in real-time to an RTMP server using
@command{ffmpeg}:
@file{ffmpeg}:
@example
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
@end example
To play the same stream using @command{ffplay}:
To play the same stream using @file{ffplay}:
@example
ffplay "rtmp://myserver/live/mystream live=1"
@end example
@@ -242,19 +242,16 @@ data transferred over RDT).
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
@uref{https://github.com/revmischa/rtsp-server, RTSP server}).
RTSP server, @url{http://github.com/revmischa/rtsp-server}).
The required syntax for a RTSP url is:
@example
rtsp://@var{hostname}[:@var{port}]/@var{path}
rtsp://@var{hostname}[:@var{port}]/@var{path}[?@var{options}]
@end example
The following options (set on the @command{ffmpeg}/@command{ffplay} command
line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
@var{options} is a @code{&}-separated list. The following options
are supported:
Flags for @code{rtsp_transport}:
@table @option
@item udp
@@ -264,31 +261,27 @@ Use UDP as lower transport protocol.
Use TCP (interleaving within the RTSP control channel) as lower
transport protocol.
@item udp_multicast
@item multicast
Use UDP multicast as lower transport protocol.
@item http
Use HTTP tunneling as lower transport protocol, which is useful for
passing proxies.
@item filter_src
Accept packets only from negotiated peer address and port.
@end table
Multiple lower transport protocols may be specified, in that case they are
tried one at a time (if the setup of one fails, the next one is tried).
For the muxer, only the @code{tcp} and @code{udp} options are supported.
Flags for @code{rtsp_flags}:
@table @option
@item filter_src
Accept packets only from negotiated peer address and port.
@end table
When receiving data over UDP, the demuxer tries to reorder received packets
(since they may arrive out of order, or packets may get lost totally). In
order for this to be enabled, a maximum delay must be specified in the
@code{max_delay} field of AVFormatContext.
When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the
When watching multi-bitrate Real-RTSP streams with @file{ffplay}, the
streams to display can be chosen with @code{-vst} @var{n} and
@code{-ast} @var{n} for video and audio respectively, and can be switched
on the fly by pressing @code{v} and @code{a}.
@@ -298,13 +291,13 @@ Example command lines:
To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
@example
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
ffplay -max_delay 500000 rtsp://server/video.mp4?udp
@end example
To watch a stream tunneled over HTTP:
@example
ffplay -rtsp_transport http rtsp://server/video.mp4
ffplay rtsp://server/video.mp4?http
@end example
To send a stream in realtime to a RTSP server, for others to watch:
@@ -365,13 +358,13 @@ To broadcast a stream on the local subnet, for watching in VLC:
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
@end example
Similarly, for watching in @command{ffplay}:
Similarly, for watching in ffplay:
@example
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
@end example
And for watching in @command{ffplay}, over IPv6:
And for watching in ffplay, over IPv6:
@example
ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
@@ -446,11 +439,6 @@ set the UDP buffer size in bytes
@item localport=@var{port}
override the local UDP port to bind with
@item localaddr=@var{addr}
Choose the local IP address. This is useful e.g. if sending multicast
and the host has multiple interfaces, where the user can choose
which interface to send on by specifying the IP address of that interface.
@item pkt_size=@var{size}
set the size in bytes of UDP packets
@@ -472,7 +460,7 @@ For receiving, this gives the benefit of only receiving packets from
the specified peer address/port.
@end table
Some usage examples of the udp protocol with @command{ffmpeg} follow.
Some usage examples of the udp protocol with @file{ffmpeg} follow.
To stream over UDP to a remote endpoint:
@example

View File

@@ -18,7 +18,7 @@ essential that changes to their codebase are publicly visible, clean and
easy reviewable that again leads us to:
* use of a revision control system like git
* separation of cosmetic from non-cosmetic changes (this is almost entirely
ignored by mentors and students in soc 2006 which might lead to a surprise
ignored by mentors and students in soc 2006 which might lead to a suprise
when the code will be reviewed at the end before a possible inclusion in
FFmpeg, individual changes were generally not reviewable due to cosmetics).
* frequent commits, so that comments can be provided early

View File

@@ -1,46 +0,0 @@
The official guide to swresample for confused developers.
=========================================================
Current (simplified) Architecture:
---------------------------------
Input
v
__________________/|\___________
/ | \
/ input sample format convert v
/ | ___________/
| |/
| v
| ___________/|\___________ _____________
| / | \ | |
| Rematrix | resample <---->| Buffers |
| \___________ | ___________/ |_____________|
v \|/
Special Converter v
v ___________/|\___________ _____________
| / | \ | |
| Rematrix | resample <---->| Buffers |
| \___________ | ___________/ |_____________|
| \|/
| v
| |\___________
\ | \
\ output sample format convert v
\_________________ | ___________/
\|/
v
Output
Planar/Packed convertion is done when needed during sample format convertion
Every step can be skiped without memcpy when its not needed.
Either Resampling and Rematrixing can be performed first depending on which
way its faster.
The Buffers are needed for resampling due to resamplng being a process that
requires future and past data, it thus also introduces inevitably a delay when
used.
Internally 32bit float and 16bit int is supported currently, other formats can
easily be added
Externally all sample formats in packed and planar configuration are supported
Its also trivial to add special converters for common cases
If only sample format and or packed/planar convertion is needed it
is performed from input to output directly in a single pass with no intermediates.

View File

@@ -1,161 +1,15 @@
# no horiz rules between sections
$end_section = \&FFmpeg_end_section;
sub FFmpeg_end_section($$)
$end_section = \&FFMPEG_end_section;
sub FFMPEG_end_section($$)
{
}
$EXTRA_HEAD =
'<link rel="icon" href="favicon.png" type="image/png" />
<link rel="stylesheet" type="text/css" href="default.css" />
';
$CSS_LINES = <<EOT;
<style type="text/css">
<!--
a.summary-letter { text-decoration: none }
a { color: #2D6198; }
a:visited { color: #884488; }
h1 a, h2 a, h3 a { text-decoration: inherit; color: inherit; }
p { margin-left: 1em; margin-right: 1em; }
table { margin-left: 2em; }
pre { margin-left: 2em; }
#footer { text-align: center; }
#body { margin-left: 1em; margin-right: 1em; }
body { background-color: #313131; margin: 0; }
#container {
background-color: white;
color: #202020;
margin-left: 1em;
margin-right: 1em;
}
h1 {
background-color: #7BB37B;
border: 1px solid #6A996A;
color: #151515;
font-size: 1.2em;
padding-bottom: 0.2em;
padding-left: 0.4em;
padding-top: 0.2em;
}
h2 {
color: #313131;
font-size: 1.2em;
}
h3 {
color: #313131;
font-size: 0.8em;
margin-bottom: -8px;
}
.note {
margin: 1em;
border: 1px solid #bbc9d8;
background-color: #dde1e1;
}
.important {
margin: 1em;
border: 1px solid #d26767;
background-color: #f8e1e1;
}
-->
</style>
EOT
my $FFMPEG_NAVBAR = $ENV{"FFMPEG_NAVBAR"} || '';
$AFTER_BODY_OPEN =
'<div id="container">' .
"\n$FFMPEG_NAVBAR\n" .
'<div id="body">';
$PRE_BODY_CLOSE = '</div></div>';
$SMALL_RULE = '';
$BODYTEXT = '';
$print_page_foot = \&FFmpeg_print_page_foot;
sub FFmpeg_print_page_foot($$)
$print_page_foot = \&FFMPEG_print_page_foot;
sub FFMPEG_print_page_foot($$)
{
my $fh = shift;
print $fh '<div id="footer">' . "\n";
print $fh "$SMALL_RULE\n";
T2H_DEFAULT_print_page_foot($fh);
print $fh "</div>\n";
}
$float = \&FFmpeg_float;
sub FFmpeg_float($$$$)
{
my $text = shift;
my $float = shift;
my $caption = shift;
my $shortcaption = shift;
my $label = '';
if (exists($float->{'id'}))
{
$label = &$anchor($float->{'id'});
}
my $class = '';
my $subject = '';
if ($caption =~ /NOTE/)
{
$class = "note";
}
elsif ($caption =~ /IMPORTANT/)
{
$class = "important";
}
return '<div class="float ' . $class . '">' . "$label\n" . $text . '</div>';
}
$print_page_head = \&FFmpeg_print_page_head;
sub FFmpeg_print_page_head($$)
{
my $fh = shift;
my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}";
$longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
my $description = $DOCUMENT_DESCRIPTION;
$description = $longtitle if (!defined($description));
$description = "<meta name=\"description\" content=\"$description\">" if
($description ne '');
$description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'}));
my $encoding = '';
$encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$ENCODING\">" if (defined($ENCODING) and ($ENCODING ne ''));
$longtitle =~ s/Documentation.*//g;
$longtitle = "FFmpeg documentation : " . $longtitle;
print $fh <<EOT;
$DOCTYPE
<html>
$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
<!--
$Texi2HTML::THISDOC{program_authors}
-->
<head>
<title>$longtitle</title>
$description
<meta name="keywords" content="$longtitle">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
$encoding
$CSS_LINES
$EXTRA_HEAD
</head>
<body $BODYTEXT>
$AFTER_BODY_OPEN
EOT
}
# no navigation elements

View File

@@ -352,7 +352,6 @@ sub postprocess
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
s/\@ref\{([^\}]*)\}/$1/g;
s/\@noindent\s*//g;
s/\@refill//g;
s/\@gol//g;

6232
ffmpeg.c

File diff suppressed because it is too large Load Diff

1403
ffplay.c

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
coder=0
bf=0
flags2=-wpred-dct8x8
wpredp=0

View File

@@ -0,0 +1,7 @@
coder=0
bf=0
flags2=-wpred-dct8x8
level=13
maxrate=768000
bufsize=3000000
wpredp=0

View File

@@ -0,0 +1,8 @@
coder=0
bf=0
refs=1
flags2=-wpred-dct8x8
level=30
maxrate=10000000
bufsize=10000000
wpredp=0

View File

@@ -0,0 +1,20 @@
coder=0
flags=+loop+cgop
cmp=+chroma
partitions=-parti8x8+parti4x4+partp8x8-partp4x4-partb8x8
me_method=hex
subq=3
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
directpred=1
flags2=+fastpskip
cqp=0
wpredp=0

View File

@@ -0,0 +1,21 @@
coder=1
flags=+loop+cgop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
me_method=esa
subq=8
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
refs=16
directpred=1
flags2=+mixed_refs+dct8x8+fastpskip
cqp=0
wpredp=2

View File

@@ -0,0 +1,20 @@
coder=1
flags=+loop+cgop
cmp=+chroma
partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
me_method=hex
subq=5
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
directpred=1
flags2=+fastpskip
cqp=0
wpredp=2

View File

@@ -0,0 +1,21 @@
coder=1
flags=+loop+cgop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
me_method=umh
subq=6
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
refs=2
directpred=1
flags2=+dct8x8+fastpskip
cqp=0
wpredp=2

View File

@@ -0,0 +1,21 @@
coder=1
flags=+loop+cgop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
me_method=umh
subq=8
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
refs=4
directpred=1
flags2=+mixed_refs+dct8x8+fastpskip
cqp=0
wpredp=2

View File

@@ -0,0 +1,19 @@
coder=0
flags=+loop+cgop
cmp=+chroma
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
me_method=dia
subq=0
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=0
qmax=69
qdiff=4
directpred=1
flags2=+fastpskip
cqp=0

1742
ffprobe.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,7 @@
/*
* Multiple format streaming server
* copyright (c) 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -15,16 +18,11 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FFMPEG_FFSERVER_H
#define FFMPEG_FFSERVER_H
#ifndef AVCODEC_X86_DWT_H
#define AVCODEC_X86_DWT_H
/* interface between ffserver and modules */
#include "libavcodec/dwt.h"
void ffserver_module_init(void);
void ff_horizontal_compose_dd97i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
void ff_horizontal_compose_haar1i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
void ff_horizontal_compose_haar0i_end_c(IDWTELEM *b, IDWTELEM *tmp, int w2, int x);
void ff_spatial_idwt_init_mmx(DWTContext *d, enum dwt_type type);
#endif
#endif /* FFMPEG_FFSERVER_H */

View File

@@ -25,7 +25,6 @@
*/
#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
#include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
@@ -133,8 +132,8 @@ typedef struct FourXContext{
AVFrame current_picture, last_picture;
GetBitContext pre_gb; ///< ac/dc prefix
GetBitContext gb;
GetByteContext g;
GetByteContext g2;
const uint8_t *bytestream;
const uint16_t *wordstream;
int mv[256];
VLC pre_vlc;
int last_dc;
@@ -278,7 +277,7 @@ static void init_mv(FourXContext *f){
}
#endif
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, unsigned dc){
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){
int i;
dc*= 0x10001;
@@ -329,11 +328,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
assert(code>=0 && code<=6);
if(code == 0){
if (f->g.buffer_end - f->g.buffer < 1){
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
return;
}
src += f->mv[ *f->g.buffer++ ];
src += f->mv[ *f->bytestream++ ];
if(start > src || src > end){
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
@@ -348,47 +343,23 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
decode_p_block(f, dst , src , log2w, log2h, stride);
decode_p_block(f, dst + (1<<log2w), src + (1<<log2w), log2w, log2h, stride);
}else if(code == 3 && f->version<2){
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
}
mcdc(dst, src, log2w, h, stride, 1, 0);
}else if(code == 4){
if (f->g.buffer_end - f->g.buffer < 1){
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
return;
}
src += f->mv[ *f->g.buffer++ ];
src += f->mv[ *f->bytestream++ ];
if(start > src || src > end){
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
}
if (f->g2.buffer_end - f->g2.buffer < 1){
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
}
mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16(&f->g2));
mcdc(dst, src, log2w, h, stride, 1, av_le2ne16(*f->wordstream++));
}else if(code == 5){
if (f->g2.buffer_end - f->g2.buffer < 1){
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
}
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
}
mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16(&f->g2));
mcdc(dst, src, log2w, h, stride, 0, av_le2ne16(*f->wordstream++));
}else if(code == 6){
if (f->g2.buffer_end - f->g2.buffer < 2){
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
}
if(log2w){
dst[0] = bytestream2_get_le16(&f->g2);
dst[1] = bytestream2_get_le16(&f->g2);
dst[0] = av_le2ne16(*f->wordstream++);
dst[1] = av_le2ne16(*f->wordstream++);
}else{
dst[0 ] = bytestream2_get_le16(&f->g2);
dst[stride] = bytestream2_get_le16(&f->g2);
dst[0 ] = av_le2ne16(*f->wordstream++);
dst[stride] = av_le2ne16(*f->wordstream++);
}
}
}
@@ -400,14 +371,10 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
uint16_t *src= (uint16_t*)f->last_picture.data[0];
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
const int stride= f->current_picture.linesize[0]>>1;
unsigned int bitstream_size, bytestream_size, wordstream_size, extra, bytestream_offset, wordstream_offset;
unsigned int bitstream_size, bytestream_size, wordstream_size, extra;
if(f->version>1){
if (length < 20)
return AVERROR_INVALIDDATA;
extra=20;
if (length < extra)
return -1;
bitstream_size= AV_RL32(buf+8);
wordstream_size= AV_RL32(buf+12);
bytestream_size= AV_RL32(buf+16);
@@ -418,10 +385,11 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
bytestream_size= FFMAX(length - bitstream_size - wordstream_size, 0);
}
if (bitstream_size > length ||
bytestream_size > length - bitstream_size ||
wordstream_size > length - bytestream_size - bitstream_size ||
extra > length - bytestream_size - bitstream_size - wordstream_size){
if(bitstream_size+ bytestream_size+ wordstream_size + extra != length
|| bitstream_size > (1<<26)
|| bytestream_size > (1<<26)
|| wordstream_size > (1<<26)
){
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
bitstream_size+ bytestream_size+ wordstream_size - length);
return -1;
@@ -431,13 +399,10 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
if (!f->bitstream_buffer)
return AVERROR(ENOMEM);
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
memset((uint8_t*)f->bitstream_buffer + bitstream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
wordstream_offset = extra + bitstream_size;
bytestream_offset = extra + bitstream_size + wordstream_size;
bytestream2_init(&f->g2, buf + wordstream_offset, length - wordstream_offset);
bytestream2_init(&f->g, buf + bytestream_offset, length - bytestream_offset);
f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
f->bytestream= buf + extra + bitstream_size + wordstream_size;
init_mv(f);
@@ -449,6 +414,15 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
dst += 8*stride;
}
if( bitstream_size != (get_bits_count(&f->gb)+31)/32*4
|| (((const char*)f->wordstream - (const char*)buf + 2)&~2) != extra + bitstream_size + wordstream_size
|| (((const char*)f->bytestream - (const char*)buf + 3)&~3) != extra + bitstream_size + wordstream_size + bytestream_size)
av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
-(((const char*)f->bytestream - (const char*)buf + 3)&~3) + (extra + bitstream_size + wordstream_size + bytestream_size),
-(((const char*)f->wordstream - (const char*)buf + 2)&~2) + (extra + bitstream_size + wordstream_size)
);
return 0;
}
@@ -459,11 +433,6 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
static int decode_i_block(FourXContext *f, DCTELEM *block){
int code, i, j, level, val;
if(get_bits_left(&f->gb) < 2){
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
return -1;
}
/* DC coef */
val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
if (val>>4){
@@ -562,10 +531,7 @@ static int decode_i_mb(FourXContext *f){
return 0;
}
static const uint8_t *read_huffman_tables(FourXContext *f,
const uint8_t * const buf,
int buf_size)
{
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf){
int frequency[512];
uint8_t flag[512];
int up[512];
@@ -573,7 +539,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
int bits_tab[257];
int start, end;
const uint8_t *ptr= buf;
const uint8_t *ptr_end = buf + buf_size;
int j;
memset(frequency, 0, sizeof(frequency));
@@ -584,11 +549,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
for(;;){
int i;
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
return NULL;
if (end < start || buf_size < 0)
return NULL;
for(i=start; i<=end; i++){
frequency[i]= *ptr++;
}
@@ -641,10 +601,9 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
len_tab[j]= len;
}
if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
len_tab , 1, 1,
bits_tab, 4, 4, 0))
return NULL;
init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
len_tab , 1, 1,
bits_tab, 4, 4, 0);
return ptr;
}
@@ -660,35 +619,24 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
int x, y, x2, y2;
const int width= f->avctx->width;
const int height= f->avctx->height;
const int mbs = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
const int stride= f->current_picture.linesize[0]>>1;
const uint8_t *buf_end = buf + length;
GetByteContext g3;
if(length < mbs * 8) {
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
return AVERROR_INVALIDDATA;
}
bytestream2_init(&g3, buf, length);
for(y=0; y<height; y+=16){
for(x=0; x<width; x+=16){
unsigned int color[4], bits;
if (buf_end - buf < 8)
return -1;
memset(color, 0, sizeof(color));
//warning following is purely guessed ...
color[0]= bytestream2_get_le16u(&g3);
color[1]= bytestream2_get_le16u(&g3);
color[0]= bytestream_get_le16(&buf);
color[1]= bytestream_get_le16(&buf);
if(color[0]&0x8000) av_log(f->avctx, AV_LOG_ERROR, "unk bit 1\n");
if(color[1]&0x8000) av_log(f->avctx, AV_LOG_ERROR, "unk bit 2\n");
if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
color[2]= mix(color[0], color[1]);
color[3]= mix(color[1], color[0]);
bits= bytestream2_get_le32u(&g3);
bits= bytestream_get_le32(&buf);
for(y2=0; y2<16; y2++){
for(x2=0; x2<16; x2++){
int index= 2*(x2>>2) + 8*(y2>>2);
@@ -697,7 +645,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
}
dst+=16;
}
dst += 16 * stride - x;
dst += 16*stride - width;
}
return 0;
@@ -707,34 +655,21 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
int x, y;
const int width= f->avctx->width;
const int height= f->avctx->height;
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
const int stride= f->current_picture.linesize[0]>>1;
const unsigned int bitstream_size= AV_RL32(buf);
unsigned int prestream_size;
const uint8_t *prestream;
if (bitstream_size > (1 << 26))
return AVERROR_INVALIDDATA;
if (length < bitstream_size + 12) {
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
return AVERROR_INVALIDDATA;
}
prestream_size = 4 * AV_RL32(buf + bitstream_size + 4);
prestream = buf + bitstream_size + 12;
const int token_count av_unused = AV_RL32(buf + bitstream_size + 8);
unsigned int prestream_size= 4*AV_RL32(buf + bitstream_size + 4);
const uint8_t *prestream= buf + bitstream_size + 12;
if(prestream_size + bitstream_size + 12 != length
|| bitstream_size > (1<<26)
|| prestream_size > (1<<26)){
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
return -1;
}
prestream = read_huffman_tables(f, prestream, prestream_size);
if (!prestream) {
av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
return AVERROR_INVALIDDATA;
}
av_assert0(prestream <= buf + length);
prestream= read_huffman_tables(f, prestream);
init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
@@ -744,7 +679,6 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
if (!f->bitstream_buffer)
return AVERROR(ENOMEM);
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
memset((uint8_t*)f->bitstream_buffer + prestream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
f->last_dc= 0*128*8*8;
@@ -756,6 +690,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
idct_put(f, x, y);
}
dst += 16*stride;
}
if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
@@ -775,35 +710,18 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *p, temp;
int i, frame_4cc, frame_size;
if (buf_size < 20)
return AVERROR_INVALIDDATA;
if (avctx->width % 16 || avctx->height % 16) {
av_log(avctx, AV_LOG_ERROR,
"Dimensions non-multiple of 16 are invalid.\n");
return AVERROR_INVALIDDATA;
frame_4cc= AV_RL32(buf);
if(buf_size != AV_RL32(buf+4)+8 || buf_size < 20){
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, AV_RL32(buf+4));
}
if (buf_size < AV_RL32(buf + 4) + 8) {
av_log(f->avctx, AV_LOG_ERROR,
"size mismatch %d %d\n", buf_size, AV_RL32(buf + 4));
}
frame_4cc = AV_RL32(buf);
if(frame_4cc == AV_RL32("cfrm")){
int free_index=-1;
int id, whole_size;
const int data_size = buf_size - 20;
const int data_size= buf_size - 20;
const int id= AV_RL32(buf+12);
const int whole_size= AV_RL32(buf+16);
CFrameBuffer *cfrm;
id = AV_RL32(buf + 12);
whole_size = AV_RL32(buf + 16);
if (data_size < 0 || whole_size < 0){
av_log(f->avctx, AV_LOG_ERROR, "sizes invalid\n");
return AVERROR_INVALIDDATA;
}
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
@@ -820,8 +738,6 @@ static int decode_frame(AVCodecContext *avctx,
}
cfrm= &f->cfrm[i];
if (data_size > UINT_MAX - cfrm->size - FF_INPUT_BUFFER_PADDING_SIZE)
return AVERROR_INVALIDDATA;
cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL
av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
@@ -839,9 +755,6 @@ static int decode_frame(AVCodecContext *avctx,
av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", id, avctx->frame_number);
}
if (f->version <= 1)
return AVERROR_INVALIDDATA;
cfrm->size= cfrm->id= 0;
frame_4cc= AV_RL32("pfrm");
}else
@@ -860,7 +773,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use our own buffer management
p->reference= 3;
p->reference= 1;
if (avctx->reget_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return -1;
@@ -868,31 +781,24 @@ static int decode_frame(AVCodecContext *avctx,
if(frame_4cc == AV_RL32("ifr2")){
p->pict_type= AV_PICTURE_TYPE_I;
if(decode_i2_frame(f, buf-4, frame_size + 4) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
if(decode_i2_frame(f, buf-4, frame_size) < 0)
return -1;
}
}else if(frame_4cc == AV_RL32("ifrm")){
p->pict_type= AV_PICTURE_TYPE_I;
if(decode_i_frame(f, buf, frame_size) < 0){
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
if(decode_i_frame(f, buf, frame_size) < 0)
return -1;
}
}else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
if(!f->last_picture.data[0]){
f->last_picture.reference= 3;
f->last_picture.reference= 1;
if(avctx->get_buffer(avctx, &f->last_picture) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
memset(f->last_picture.data[0], 0, avctx->height * FFABS(f->last_picture.linesize[0]));
}
p->pict_type= AV_PICTURE_TYPE_P;
if(decode_p_frame(f, buf, frame_size) < 0){
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
if(decode_p_frame(f, buf, frame_size) < 0)
return -1;
}
}else if(frame_4cc == AV_RL32("snd_")){
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
}else{
@@ -925,10 +831,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
return 1;
}
if((avctx->width % 16) || (avctx->height % 16)) {
av_log(avctx, AV_LOG_ERROR, "unsupported width/height\n");
return AVERROR_INVALIDDATA;
}
avcodec_get_frame_defaults(&f->current_picture);
avcodec_get_frame_defaults(&f->last_picture);
@@ -953,7 +855,7 @@ static av_cold int decode_end(AVCodecContext *avctx){
av_freep(&f->cfrm[i].data);
f->cfrm[i].allocated_size= 0;
}
ff_free_vlc(&f->pre_vlc);
free_vlc(&f->pre_vlc);
if(f->current_picture.data[0])
avctx->release_buffer(avctx, &f->current_picture);
if(f->last_picture.data[0])
@@ -963,14 +865,15 @@ static av_cold int decode_end(AVCodecContext *avctx){
}
AVCodec ff_fourxm_decoder = {
.name = "4xm",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_4XM,
.priv_data_size = sizeof(FourXContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
"4xm",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_4XM,
sizeof(FourXContext),
decode_init,
NULL,
decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
};

View File

@@ -27,7 +27,7 @@
*
* Supports: PAL8 (RGB 8bpp, paletted)
* : BGR24 (RGB 24bpp) (can also output it as RGB32)
* : RGB32 (RGB 32bpp, 4th plane is alpha)
* : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
*
*/
@@ -50,8 +50,6 @@ typedef struct EightBpsContext {
unsigned char planes;
unsigned char planemap[4];
uint32_t pal[256];
} EightBpsContext;
@@ -69,8 +67,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
unsigned char *pixptr, *pixptr_end;
unsigned int height = avctx->height; // Real image height
unsigned int dlen, p, row;
const unsigned char *lp, *dp, *ep;
const unsigned char *lp, *dp;
unsigned char count;
unsigned int px_inc;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
@@ -84,11 +83,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
return -1;
}
ep = encoded + buf_size;
/* Set data pointer after line lengths */
dp = encoded + planes * (height << 1);
/* Ignore alpha plane, don't know what to do with it */
if (planes == 4)
planes--;
px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
for (p = 0; p < planes; p++) {
/* Lines length pointer for this plane */
lp = encoded + p * (height << 1);
@@ -97,29 +100,27 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
for(row = 0; row < height; row++) {
pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
pixptr_end = pixptr + c->pic.linesize[0];
if (ep - lp < row * 2 + 2)
return AVERROR_INVALIDDATA;
dlen = av_be2ne16(*(const unsigned short *)(lp+row*2));
/* Decode a row of this plane */
while(dlen > 0) {
if(ep - dp <= 1) return -1;
if(dp + 1 >= buf+buf_size) return -1;
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
if (pixptr + count * planes > pixptr_end)
if (pixptr + count * px_inc > pixptr_end)
break;
if(ep - dp < count) return -1;
if(dp + count > buf+buf_size) return -1;
while(count--) {
*pixptr = *dp++;
pixptr += planes;
pixptr += px_inc;
}
} else {
count = 257 - count;
if (pixptr + count * planes > pixptr_end)
if (pixptr + count * px_inc > pixptr_end)
break;
while(count--) {
*pixptr = *dp;
pixptr += planes;
pixptr += px_inc;
}
dp++;
dlen -= 2;
@@ -128,16 +129,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
}
if (avctx->bits_per_coded_sample <= 8) {
const uint8_t *pal = av_packet_get_side_data(avpkt,
AV_PKT_DATA_PALETTE,
NULL);
if (pal) {
if (avctx->palctrl) {
memcpy (c->pic.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
if (avctx->palctrl->palette_changed) {
c->pic.palette_has_changed = 1;
memcpy(c->pal, pal, AVPALETTE_SIZE);
}
memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE);
avctx->palctrl->palette_changed = 0;
} else
c->pic.palette_has_changed = 0;
}
*data_size = sizeof(AVFrame);
@@ -167,6 +165,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_PAL8;
c->planes = 1;
c->planemap[0] = 0; // 1st plane is palette indexes
if (avctx->palctrl == NULL) {
av_log(avctx, AV_LOG_ERROR, "Error: PAL8 format but no palette from demuxer.\n");
return -1;
}
break;
case 24:
avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
@@ -182,12 +184,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->planemap[0] = 1; // 1st plane is red
c->planemap[1] = 2; // 2nd plane is green
c->planemap[2] = 3; // 3rd plane is blue
c->planemap[3] = 0; // 4th plane is alpha
c->planemap[3] = 0; // 4th plane is alpha???
#else
c->planemap[0] = 2; // 1st plane is red
c->planemap[1] = 1; // 2nd plane is green
c->planemap[2] = 0; // 3rd plane is blue
c->planemap[3] = 3; // 4th plane is alpha
c->planemap[3] = 3; // 4th plane is alpha???
#endif
break;
default:
@@ -219,13 +221,14 @@ static av_cold int decode_end(AVCodecContext *avctx)
AVCodec ff_eightbps_decoder = {
.name = "8bps",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_8BPS,
.priv_data_size = sizeof(EightBpsContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
"8bps",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_8BPS,
sizeof(EightBpsContext),
decode_init,
NULL,
decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
};

View File

@@ -22,8 +22,6 @@
/**
* @file
* 8svx audio decoder
* @author Jaikrishnan Menon
*
* supports: fibonacci delta encoding
* : exponential encoding
*
@@ -38,17 +36,15 @@
*/
#include "avcodec.h"
#include "internal.h"
/** decoder context */
typedef struct EightSvxContext {
AVFrame frame;
const int8_t *table;
/* buffer used to store the whole audio decoded/interleaved chunk,
* which is sent with the first packet */
uint8_t *samples;
int64_t samples_size;
size_t samples_size;
int samples_idx;
} EightSvxContext;
@@ -101,19 +97,18 @@ static int delta_decode(int8_t *dst, const uint8_t *src, int src_size,
return dst-dst0;
}
/** decode a frame */
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt)
{
EightSvxContext *esc = avctx->priv_data;
int n, out_data_size, ret;
int out_data_size, n;
uint8_t *src, *dst;
/* decode and interleave the first packet */
if (!esc->samples && avpkt) {
uint8_t *deinterleaved_samples, *p = NULL;
uint8_t *deinterleaved_samples;
esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW || avctx->codec->id ==CODEC_ID_PCM_S8_PLANAR?
esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW ?
avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2;
if (!(esc->samples = av_malloc(esc->samples_size)))
return AVERROR(ENOMEM);
@@ -124,13 +119,8 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
int buf_size = avpkt->size;
int n = esc->samples_size;
if (buf_size < 2) {
av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
return AVERROR(EINVAL);
}
if (!(deinterleaved_samples = av_mallocz(n)))
return AVERROR(ENOMEM);
p = deinterleaved_samples;
/* the uncompressed starting value is contained in the first byte */
if (avctx->channels == 2) {
@@ -147,25 +137,21 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
interleave_stereo(esc->samples, deinterleaved_samples, esc->samples_size);
else
memcpy(esc->samples, deinterleaved_samples, esc->samples_size);
av_freep(&p);
}
/* get output buffer */
esc->frame.nb_samples = (FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx) +avctx->channels-1) / avctx->channels;
if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
/* return single packed with fixed size */
out_data_size = FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx);
if (*data_size < out_data_size) {
av_log(avctx, AV_LOG_ERROR, "Provided buffer with size %d is too small.\n", *data_size);
return AVERROR(EINVAL);
}
*got_frame_ptr = 1;
*(AVFrame *)data = esc->frame;
dst = esc->frame.data[0];
*data_size = out_data_size;
dst = data;
src = esc->samples + esc->samples_idx;
out_data_size = esc->frame.nb_samples * avctx->channels;
for (n = out_data_size; n > 0; n--)
*dst++ = *src++ + 128;
esc->samples_idx += out_data_size;
esc->samples_idx += *data_size;
return avctx->codec->id == CODEC_ID_8SVX_FIB || avctx->codec->id == CODEC_ID_8SVX_EXP ?
(avctx->frame_number == 0)*2 + out_data_size / 2 :
@@ -176,7 +162,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
{
EightSvxContext *esc = avctx->priv_data;
if (avctx->channels < 1 || avctx->channels > 2) {
if (avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
return AVERROR_INVALIDDATA;
}
@@ -184,7 +170,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
switch (avctx->codec->id) {
case CODEC_ID_8SVX_FIB: esc->table = fibonacci; break;
case CODEC_ID_8SVX_EXP: esc->table = exponential; break;
case CODEC_ID_PCM_S8_PLANAR:
case CODEC_ID_8SVX_RAW: esc->table = NULL; break;
default:
av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
@@ -192,9 +177,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
}
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
avcodec_get_frame_defaults(&esc->frame);
avctx->coded_frame = &esc->frame;
return 0;
}
@@ -217,7 +199,6 @@ AVCodec ff_eightsvx_fib_decoder = {
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
};
@@ -229,18 +210,16 @@ AVCodec ff_eightsvx_exp_decoder = {
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
};
AVCodec ff_pcm_s8_planar_decoder = {
.name = "pcm_s8_planar",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_PCM_S8_PLANAR,
.priv_data_size = sizeof(EightSvxContext),
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
.decode = eightsvx_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("PCM signed 8-bit planar"),
AVCodec ff_eightsvx_raw_decoder = {
.name = "8svx_raw",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_8SVX_RAW,
.priv_data_size = sizeof(EightSvxContext),
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
.long_name = NULL_IF_CONFIG_SMALL("8SVX rawaudio"),
};

View File

@@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak
NAME = avcodec
FFLIBS = avutil
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vda.h vdpau.h version.h xvmc.h
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h version.h xvmc.h
OBJS = allcodecs.o \
audioconvert.o \
@@ -15,6 +15,7 @@ OBJS = allcodecs.o \
fmtconvert.o \
imgconvert.o \
jrevdct.o \
opt.o \
options.o \
parser.o \
raw.o \
@@ -49,7 +50,6 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SINEWIN) += sinewin.o
OBJS-$(CONFIG_VAAPI) += vaapi.o
OBJS-$(CONFIG_VDA) += vda.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
# decoders/encoders/hardware accelerators
@@ -63,9 +63,9 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
mpeg4audio.o kbdwin.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_combined.o ac3enc_fixed.o ac3enc_float.o ac3tab.o ac3.o kbdwin.o ac3enc.o
OBJS-$(CONFIG_AC3_FLOAT_ENCODER) += ac3enc_float.o ac3tab.o ac3tab.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3tab.o ac3tab.o ac3.o ac3enc.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
@@ -91,19 +91,14 @@ OBJS-$(CONFIG_ATRAC1_DECODER) += atrac1.o atrac.o
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o
OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o
OBJS-$(CONFIG_AVS_DECODER) += avs.o
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkdsp.o
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkidct.o
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o
OBJS-$(CONFIG_BINTEXT_DECODER) += bintext.o cga_data.o
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
OBJS-$(CONFIG_BMV_VIDEO_DECODER) += bmv.o
OBJS-$(CONFIG_BMV_AUDIO_DECODER) += bmv.o
OBJS-$(CONFIG_C93_DECODER) += c93.o
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
mpeg12data.o mpegvideo.o
@@ -116,8 +111,6 @@ OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
OBJS-$(CONFIG_DCA_DECODER) += dca.o synth_filter.o dcadsp.o
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
dirac_arith.o mpeg12data.o dwt.o
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o \
@@ -135,10 +128,9 @@ OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc.o ac3enc_float.o \
ac3tab.o ac3.o kbdwin.o eac3_data.o
ac3tab.o ac3.o kbdwin.o
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
mpeg12data.o mpegvideo.o \
@@ -153,26 +145,19 @@ OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
OBJS-$(CONFIG_EIGHTSVX_RAW_DECODER) += 8svx.o
OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o
OBJS-$(CONFIG_FFV1_DECODER) += ffv1.o rangecoder.o
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o rangecoder.o
OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o vorbis_data.o
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
OBJS-$(CONFIG_FLASHSV2_DECODER) += flashsv.o
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
celp_filters.o celp_math.o
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
OBJS-$(CONFIG_GSM_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
@@ -200,22 +185,19 @@ OBJS-$(CONFIG_H264_DECODER) += h264.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
OBJS-$(CONFIG_IDF_DECODER) += bintext.o cga_data.o
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
OBJS-$(CONFIG_IMC_DECODER) += imc.o
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi_common.o ivi_dsp.o
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi_common.o ivi_dsp.o
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
OBJS-$(CONFIG_JPEG2000_DECODER) += j2kdec.o mqcdec.o mqc.o j2k.o j2k_dwt.o
OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o j2k.o j2k_dwt.o
#OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o j2k.o j2k_dwt.o
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
mjpegdec.o mjpeg.o
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
@@ -278,7 +260,6 @@ OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
timecode.o \
motion_est.o ratecontrol.o \
mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
@@ -287,7 +268,6 @@ OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
timecode.o \
motion_est.o ratecontrol.o \
mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
@@ -325,9 +305,6 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc.o
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o celp_math.o \
celp_filters.o acelp_vectors.o \
@@ -340,9 +317,7 @@ OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o
OBJS-$(CONFIG_R10K_DECODER) += r210dec.o
OBJS-$(CONFIG_R10K_ENCODER) += r210enc.o
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
OBJS-$(CONFIG_R210_ENCODER) += r210enc.o
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
@@ -358,9 +333,9 @@ OBJS-$(CONFIG_RV10_DECODER) += rv10.o
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o \
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o \
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
@@ -373,12 +348,12 @@ OBJS-$(CONFIG_SIPR_DECODER) += sipr.o acelp_pitch_delay.o \
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
OBJS-$(CONFIG_SMC_DECODER) += smc.o
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o rangecoder.o
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o rangecoder.o \
motion_est.o ratecontrol.o \
h263.o mpegvideo.o \
error_resilience.o ituh263enc.o \
mpegvideo_enc.o mpeg12data.o
OBJS-$(CONFIG_SNOW_DECODER) += snow.o rangecoder.o
OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o \
ratecontrol.o h263.o \
mpegvideo.o error_resilience.o \
ituh263enc.o mpegvideo_enc.o \
mpeg12data.o
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
@@ -416,16 +391,10 @@ OBJS-$(CONFIG_TTA_DECODER) += tta.o
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o celp_math.o
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideo.o
OBJS-$(CONFIG_V210_DECODER) += v210dec.o
OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
OBJS-$(CONFIG_V308_DECODER) += v308dec.o
OBJS-$(CONFIG_V308_ENCODER) += v308enc.o
OBJS-$(CONFIG_V410_DECODER) += v410dec.o
OBJS-$(CONFIG_V410_ENCODER) += v410enc.o
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
OBJS-$(CONFIG_VB_DECODER) += vb.o
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
msmpeg4.o msmpeg4data.o \
intrax8.o intrax8dsp.o
@@ -448,7 +417,6 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma.o
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o
OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o aactab.o
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o aactab.o
@@ -469,17 +437,10 @@ OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
OBJS-$(CONFIG_XBIN_DECODER) += bintext.o cga_data.o
OBJS-$(CONFIG_XL_DECODER) += xl.o
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
OBJS-$(CONFIG_XWD_DECODER) += xwddec.o
OBJS-$(CONFIG_XWD_ENCODER) += xwdenc.o
OBJS-$(CONFIG_Y41P_DECODER) += y41pdec.o
OBJS-$(CONFIG_Y41P_ENCODER) += y41penc.o
OBJS-$(CONFIG_YOP_DECODER) += yop.o
OBJS-$(CONFIG_YUV4_DECODER) += yuv4dec.o
OBJS-$(CONFIG_YUV4_ENCODER) += yuv4enc.o
OBJS-$(CONFIG_ZLIB_DECODER) += lcldec.o
OBJS-$(CONFIG_ZLIB_ENCODER) += lclenc.o
OBJS-$(CONFIG_ZMBV_DECODER) += zmbv.o
@@ -504,7 +465,6 @@ OBJS-$(CONFIG_PCM_MULAW_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_MULAW_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_S8_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S8_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_S8_PLANAR_DECODER) += 8svx.o
OBJS-$(CONFIG_PCM_S16BE_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S16BE_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_S16LE_DECODER) += pcm.o
@@ -535,71 +495,66 @@ OBJS-$(CONFIG_PCM_U32BE_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_U32LE_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_U32LE_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_ZORK_ENCODER) += pcm.o
OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_G722_DECODER) += g722.o g722dec.o
OBJS-$(CONFIG_ADPCM_G722_ENCODER) += g722.o g722enc.o
OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_R1_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_R2_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_R3_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_G722_DECODER) += g722.o
OBJS-$(CONFIG_ADPCM_G722_ENCODER) += g722.o
OBJS-$(CONFIG_ADPCM_G726_DECODER) += g726.o
OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o
# libavformat dependencies
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
ac3tab.o
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_DV_DEMUXER) += dvdata.o
OBJS-$(CONFIG_DV_MUXER) += dvdata.o timecode.o
OBJS-$(CONFIG_DV_MUXER) += dvdata.o
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o vorbis_data.o
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o vorbis_data.o \
flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
flacdec.o flacdata.o flac.o \
mpegaudiodata.o vorbis_data.o
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o timecode.o
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o
OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MXF_MUXER) += timecode.o
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o \
dirac.o mpeg12data.o vorbis_data.o
@@ -613,7 +568,6 @@ OBJS-$(CONFIG_WEBM_MUXER) += xiph.o mpeg4audio.o \
OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
# external codec libraries
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
@@ -626,8 +580,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpeg.o
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
libschroedinger.o \
libdirac_libschro.o
@@ -635,10 +588,7 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
libschroedinger.o \
libdirac_libschro.o
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
OBJS-$(CONFIG_LIBUTVIDEO_DECODER) += libutvideo.o
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o vorbis_data.o
@@ -653,7 +603,6 @@ OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
aacadtsdec.o mpeg4audio.o
OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
aac_ac3_parser.o
OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
@@ -662,7 +611,6 @@ 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 \
@@ -684,8 +632,6 @@ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o
OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
msmpeg4.o msmpeg4data.o mpeg4video.o \
h263.o mpegvideo.o error_resilience.o
@@ -711,8 +657,7 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
# thread libraries
OBJS-$(HAVE_PTHREADS) += pthread.o
OBJS-$(HAVE_W32THREADS) += pthread.o
OBJS-$(HAVE_OS2THREADS) += pthread.o
OBJS-$(HAVE_W32THREADS) += w32thread.o
OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
@@ -722,6 +667,8 @@ OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
# well.
OBJS-$(!CONFIG_SMALL) += inverse.o
-include $(SUBDIR)$(ARCH)/Makefile
SKIPHEADERS += %_tablegen.h \
%_tables.h \
aac_tablegen_decl.h \
@@ -732,12 +679,10 @@ SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_LIBDIRAC) += libdirac.h
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
SKIPHEADERS-$(CONFIG_VDA) += vda_internal.h
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
SKIPHEADERS-$(HAVE_W32THREADS) += w32pthreads.h
TESTPROGS = cabac dct fft fft-fixed h264 iirfilter rangecoder snowenc
TESTPROGS = cabac dct fft fft-fixed h264 iirfilter rangecoder snow
TESTPROGS-$(HAVE_MMX) += motion
TESTOBJS = dctref.o
@@ -749,6 +694,8 @@ DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
include $(SUBDIR)../subdir.mak
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
TRIG_TABLES = cos cos_fixed sin
@@ -783,10 +730,3 @@ $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
endif
CODEC_NAMES_SH := $(SRC_PATH)/$(SUBDIR)codec_names.sh
AVCODEC_H := $(SRC_PATH)/$(SUBDIR)avcodec.h
$(SUBDIR)codec_names.h: $(CODEC_NAMES_SH) config.h $(AVCODEC_H)
$(CC) $(CPPFLAGS) $(CFLAGS) -E $(AVCODEC_H) | \
$(CODEC_NAMES_SH) config.h $@
$(SUBDIR)utils.o: $(SUBDIR)codec_names.h

View File

@@ -55,13 +55,9 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
if(x < width && y < height) {
if (x + 1 < width) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
} else {
luma = src[(x + y * p->linesize[0])];
}
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
/* write blocks as linear data now so they are suitable for elbg */
dest[0] = luma;
}

View File

@@ -84,7 +84,6 @@ enum BandType {
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
enum ChannelPosition {
AAC_CHANNEL_OFF = 0,
AAC_CHANNEL_FRONT = 1,
AAC_CHANNEL_SIDE = 2,
AAC_CHANNEL_BACK = 3,
@@ -105,11 +104,11 @@ enum CouplingPoint {
* Output configuration status
*/
enum OCStatus {
OC_NONE, ///< Output unconfigured
OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE
OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked
OC_LOCKED, ///< Output configuration locked in place
OC_NONE, //< Output unconfigured
OC_TRIAL_PCE, //< Output configuration under trial specified by an inband PCE
OC_TRIAL_FRAME, //< Output configuration under trial specified by a frame header
OC_GLOBAL_HDR, //< Output configuration set in a global header but not yet locked
OC_LOCKED, //< Output configuration locked in place
};
/**
@@ -252,7 +251,6 @@ typedef struct {
*/
typedef struct {
AVCodecContext *avctx;
AVFrame frame;
MPEG4AudioConfig m4ac;
@@ -301,7 +299,6 @@ typedef struct {
DECLARE_ALIGNED(32, float, temp)[128];
enum OCStatus output_configured;
int warned_num_aac_frames;
} AACContext;
#endif /* AVCODEC_AAC_H */

View File

@@ -28,13 +28,13 @@
#include "parser.h"
typedef enum {
AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a,
AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,
AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,
AAC_AC3_PARSE_ERROR_SYNC = -1,
AAC_AC3_PARSE_ERROR_BSID = -2,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -4,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -5,
AAC_AC3_PARSE_ERROR_CRC = -6,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7,
} AACAC3ParseError;
typedef struct AACAC3ParseContext {
@@ -48,7 +48,7 @@ typedef struct AACAC3ParseContext {
int sample_rate;
int bit_rate;
int samples;
uint64_t channel_layout;
int64_t channel_layout;
int service_type;
int remaining_size;

View File

@@ -55,7 +55,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
if (show_bits(&gb, 12) != 0xfff)
return 0;
if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
if (ff_aac_parse_header(&gb, &hdr) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
return -1;
}
@@ -72,13 +72,13 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
int pce_size = 0;
uint8_t pce_data[MAX_PCE_SIZE];
if (!hdr.chan_config) {
init_get_bits(&gb, buf, buf_size * 8);
init_get_bits(&gb, buf, buf_size);
if (get_bits(&gb, 3) != 5) {
av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
return -1;
}
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
pce_size = avpriv_copy_pce_data(&pb, &gb)/8;
pce_size = ff_copy_pce_data(&pb, &gb)/8;
flush_put_bits(&pb);
buf_size -= get_bits_count(&gb)/8;
buf += get_bits_count(&gb)/8;

View File

@@ -34,13 +34,13 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size;
union {
uint64_t u64;
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
uint8_t u8[8];
} tmp;
tmp.u64 = av_be2ne64(state);
init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0)
if ((size = ff_aac_parse_header(&bits, &hdr)) < 0)
return 0;
*need_next_header = 0;
*new_frame_start = 1;
@@ -61,9 +61,9 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)
AVCodecParser ff_aac_parser = {
.codec_ids = { CODEC_ID_AAC },
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = aac_parse_init,
.parser_parse = ff_aac_ac3_parse,
.parser_close = ff_parse_close,
{ CODEC_ID_AAC },
sizeof(AACAC3ParseContext),
aac_parse_init,
ff_aac_ac3_parse,
ff_parse_close,
};

View File

@@ -26,7 +26,7 @@
#include "get_bits.h"
#include "mpeg4audio.h"
int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
{
int size, rdb, ch, sr;
int aot, crc_abs;
@@ -39,7 +39,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
crc_abs = get_bits1(gbc); /* protection_absent */
aot = get_bits(gbc, 2); /* profile_objecttype */
sr = get_bits(gbc, 4); /* sample_frequency_index */
if(!avpriv_mpeg4audio_sample_rates[sr])
if(!ff_mpeg4audio_sample_rates[sr])
return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
skip_bits1(gbc); /* private_bit */
ch = get_bits(gbc, 3); /* channel_configuration */
@@ -62,7 +62,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
hdr->crc_absent = crc_abs;
hdr->num_aac_frames = rdb + 1;
hdr->sampling_index = sr;
hdr->sample_rate = avpriv_mpeg4audio_sample_rates[sr];
hdr->sample_rate = ff_mpeg4audio_sample_rates[sr];
hdr->samples = (rdb + 1) * 1024;
hdr->bit_rate = size * 8 * hdr->sample_rate / hdr->samples;

View File

@@ -49,6 +49,6 @@ typedef struct {
* -2 if the version element is invalid, -3 if the sample rate
* element is invalid, or -4 if the bit rate element is invalid.
*/
int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
#endif /* AVCODEC_AACADTSDEC_H */

View File

@@ -33,7 +33,7 @@
#include "libavutil/libm.h" // brought forward to work around cygwin header breakage
#include <float.h>
#include "libavutil/mathematics.h"
#include <math.h>
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
@@ -110,15 +110,14 @@ static av_always_inline float quantize_and_encode_band_cost_template(
int *bits, int BT_ZERO, int BT_UNSIGNED,
int BT_PAIR, int BT_ESC)
{
const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
const float Q = ff_aac_pow2sf_tab [q_idx];
const float Q34 = ff_aac_pow34sf_tab[q_idx];
const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
const float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
const float CLIPPED_ESCAPE = 165140.0f*IQ;
int i, j;
float cost = 0;
const int dim = BT_PAIR ? 2 : 4;
int resbits = 0;
const float Q34 = sqrtf(Q * sqrtf(Q));
const int range = aac_cb_range[cb];
const int maxval = aac_cb_maxval[cb];
int off;
@@ -347,7 +346,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
float cost_stay_here, cost_get_here;
float rd = 0.0f;
for (w = 0; w < group_len; w++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(win+w)*16+swb];
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
s->scoefs + start + w*128, size,
sce->sf_idx[(win+w)*16+swb], cb,
@@ -421,7 +420,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
const int run_esc = (1 << run_bits) - 1;
int idx, ppos, count;
int stackrun[120], stackcb[120], stack_len;
float next_minbits = INFINITY;
float next_minrd = INFINITY;
int next_mincb = 0;
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
@@ -434,32 +433,16 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
for (swb = 0; swb < max_sfb; swb++) {
size = sce->ics.swb_sizes[swb];
if (sce->zeroes[win*16 + swb]) {
float cost_stay_here = path[swb][0].cost;
float cost_get_here = next_minbits + run_bits + 4;
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
!= run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
cost_stay_here += run_bits;
if (cost_get_here < cost_stay_here) {
path[swb+1][0].prev_idx = next_mincb;
path[swb+1][0].cost = cost_get_here;
path[swb+1][0].run = 1;
} else {
path[swb+1][0].prev_idx = 0;
path[swb+1][0].cost = cost_stay_here;
path[swb+1][0].run = path[swb][0].run + 1;
}
next_minbits = path[swb+1][0].cost;
next_mincb = 0;
for (cb = 1; cb < 12; cb++) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
for (cb = 0; cb < 12; cb++) {
path[swb+1][cb].prev_idx = cb;
path[swb+1][cb].cost = path[swb][cb].cost;
path[swb+1][cb].run = path[swb][cb].run + 1;
}
} else {
float minbits = next_minbits;
float minrd = next_minrd;
int mincb = next_mincb;
int startcb = sce->band_type[win*16+swb];
next_minbits = INFINITY;
next_minrd = INFINITY;
next_mincb = 0;
for (cb = 0; cb < startcb; cb++) {
path[swb+1][cb].cost = 61450;
@@ -468,15 +451,15 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
}
for (cb = startcb; cb < 12; cb++) {
float cost_stay_here, cost_get_here;
float bits = 0.0f;
float rd = 0.0f;
for (w = 0; w < group_len; w++) {
bits += quantize_band_cost(s, sce->coeffs + start + w*128,
s->scoefs + start + w*128, size,
sce->sf_idx[(win+w)*16+swb], cb,
0, INFINITY, NULL);
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
s->scoefs + start + w*128, size,
sce->sf_idx[(win+w)*16+swb], cb,
0, INFINITY, NULL);
}
cost_stay_here = path[swb][cb].cost + bits;
cost_get_here = minbits + bits + run_bits + 4;
cost_stay_here = path[swb][cb].cost + rd;
cost_get_here = minrd + rd + run_bits + 4;
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
cost_stay_here += run_bits;
@@ -489,8 +472,8 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
path[swb+1][cb].cost = cost_stay_here;
path[swb+1][cb].run = path[swb][cb].run + 1;
}
if (path[swb+1][cb].cost < next_minbits) {
next_minbits = path[swb+1][cb].cost;
if (path[swb+1][cb].cost < next_minrd) {
next_minrd = path[swb+1][cb].cost;
next_mincb = cb;
}
}
@@ -627,7 +610,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
qmin = INT_MAX;
qmax = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;
@@ -656,7 +639,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
float dist = 0;
int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
q + q0, cb, lambda / band->threshold, INFINITY, NULL);
}
@@ -713,7 +696,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
const float lambda)
{
int start = 0, i, w, w2, g;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
float dists[128], uplims[128];
float maxvals[128];
int fflag, minscaler;
@@ -729,7 +712,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
int nz = 0;
float uplim = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
uplim += band->threshold;
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
@@ -1029,7 +1012,7 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
if (band->energy <= band->threshold) {
sce->sf_idx[(w+w2)*16+g] = 218;
sce->zeroes[(w+w2)*16+g] = 1;
@@ -1067,8 +1050,8 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
float dist1 = 0.0f, dist2 = 0.0f;
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g];
FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g];
float minthr = FFMIN(band0->threshold, band1->threshold);
float maxthr = FFMAX(band0->threshold, band1->threshold);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
@@ -1113,7 +1096,7 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
}
}
AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
AACCoefficientsEncoder ff_aac_coders[] = {
{
search_for_quantizers_faac,
encode_window_bands_info,

View File

@@ -98,7 +98,6 @@
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "aacadtsdec.h"
#include "libavutil/intfloat.h"
#include <assert.h>
#include <errno.h>
@@ -109,6 +108,11 @@
# include "arm/aac.h"
#endif
union float754 {
float f;
uint32_t i;
};
static VLC vlc_scalefactors;
static VLC vlc_spectral[11];
@@ -163,19 +167,6 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
}
}
static int count_channels(enum ChannelPosition che_pos[4][MAX_ELEM_ID])
{
int i, type, sum = 0;
for (i = 0; i < MAX_ELEM_ID; i++) {
for (type = 0; type < 4; type++) {
sum += (1 + (type == TYPE_CPE)) *
(che_pos[type][i] != AAC_CHANNEL_OFF &&
che_pos[type][i] != AAC_CHANNEL_CC);
}
}
return sum;
}
/**
* Check for the channel element in the current channel position configuration.
* If it exists, make sure the appropriate element is allocated and map the
@@ -192,14 +183,10 @@ static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
int type, int id, int *channels)
{
if (*channels >= MAX_CHANNELS)
return AVERROR_INVALIDDATA;
if (che_pos[type][id]) {
if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
return AVERROR(ENOMEM);
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
}
if (!ac->che[type][id] && !(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
return AVERROR(ENOMEM);
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
if (type != TYPE_CCE) {
ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret;
if (type == TYPE_CPE ||
@@ -273,23 +260,6 @@ static av_cold int output_configure(AACContext *ac,
return 0;
}
static void flush(AVCodecContext *avctx)
{
AACContext *ac= avctx->priv_data;
int type, i, j;
for (type = 3; type >= 0; type--) {
for (i = 0; i < MAX_ELEM_ID; i++) {
ChannelElement *che = ac->che[type][i];
if (che) {
for (j = 0; j <= 1; j++) {
memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
}
}
}
}
}
/**
* Decode an array of 4 bit element IDs, optionally interleaved with a stereo/mono switching bit.
*
@@ -362,7 +332,7 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
comment_len = get_bits(gb, 8) * 8;
if (get_bits_left(gb) < comment_len) {
av_log(avctx, AV_LOG_ERROR, overread_err);
return AVERROR_INVALIDDATA;
return -1;
}
skip_bits_long(gb, comment_len);
return 0;
@@ -383,7 +353,7 @@ static av_cold int set_default_channel_config(AVCodecContext *avctx,
if (channel_config < 1 || channel_config > 7) {
av_log(avctx, AV_LOG_ERROR, "invalid default channel configuration (%d)\n",
channel_config);
return AVERROR_INVALIDDATA;
return -1;
}
/* default channel configurations:
@@ -452,12 +422,6 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
if ((ret = set_default_channel_config(avctx, new_che_pos, channel_config)))
return ret;
}
if (count_channels(new_che_pos) > 1) {
m4ac->ps = 0;
} else if (m4ac->sbr == 1 && m4ac->ps == -1)
m4ac->ps = 1;
if (ac && (ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config, OC_GLOBAL_HDR)))
return ret;
@@ -488,35 +452,34 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
* @param ac pointer to AACContext, may be null
* @param avctx pointer to AVCCodecContext, used for logging
* @param m4ac pointer to MPEG4AudioConfig, used for parsing
* @param data pointer to buffer holding an audio specific config
* @param bit_size size of audio specific config or data in bits
* @param sync_extension look for an appended sync extension
* @param data pointer to AVCodecContext extradata
* @param data_size size of AVCCodecContext extradata
*
* @return Returns error status or number of consumed bits. <0 - error
*/
static int decode_audio_specific_config(AACContext *ac,
AVCodecContext *avctx,
MPEG4AudioConfig *m4ac,
const uint8_t *data, int bit_size,
int sync_extension)
const uint8_t *data, int data_size)
{
GetBitContext gb;
int i, ret;
int i;
av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
for (i = 0; i < avctx->extradata_size; i++)
av_dlog(avctx, "%02x ", avctx->extradata[i]);
av_dlog(avctx, "\n");
if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
return ret;
init_get_bits(&gb, data, data_size * 8);
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
return AVERROR_INVALIDDATA;
if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
return -1;
if (m4ac->sampling_index > 12) {
av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
return AVERROR_INVALIDDATA;
return -1;
}
if (m4ac->sbr == 1 && m4ac->ps == -1)
m4ac->ps = 1;
skip_bits_long(&gb, i);
@@ -524,14 +487,13 @@ static int decode_audio_specific_config(AACContext *ac,
case AOT_AAC_MAIN:
case AOT_AAC_LC:
case AOT_AAC_LTP:
if ((ret = decode_ga_specific_config(ac, avctx, &gb,
m4ac, m4ac->chan_config)) < 0)
return ret;
if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))
return -1;
break;
default:
av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n",
m4ac->sbr == 1? "SBR+" : "", m4ac->object_type);
return AVERROR(ENOSYS);
return -1;
}
av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
@@ -570,22 +532,6 @@ static void reset_all_predictors(PredictorState *ps)
reset_predict_state(&ps[i]);
}
static int sample_rate_idx (int rate)
{
if (92017 <= rate) return 0;
else if (75132 <= rate) return 1;
else if (55426 <= rate) return 2;
else if (46009 <= rate) return 3;
else if (37566 <= rate) return 4;
else if (27713 <= rate) return 5;
else if (23004 <= rate) return 6;
else if (18783 <= rate) return 7;
else if (13856 <= rate) return 8;
else if (11502 <= rate) return 9;
else if (9391 <= rate) return 10;
else return 11;
}
static void reset_predictor_group(PredictorState *ps, int group_num)
{
int i;
@@ -602,42 +548,16 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
static av_cold int aac_decode_init(AVCodecContext *avctx)
{
AACContext *ac = avctx->priv_data;
int ret;
float output_scale_factor;
ac->avctx = avctx;
ac->m4ac.sample_rate = avctx->sample_rate;
if (avctx->extradata_size > 0) {
if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
avctx->extradata,
avctx->extradata_size*8, 1)) < 0)
return ret;
} else {
int sr, i;
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
sr = sample_rate_idx(avctx->sample_rate);
ac->m4ac.sampling_index = sr;
ac->m4ac.channels = avctx->channels;
ac->m4ac.sbr = -1;
ac->m4ac.ps = -1;
for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
if (ff_mpeg4audio_channels[i] == avctx->channels)
break;
if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
i = 0;
}
ac->m4ac.chan_config = i;
if (ac->m4ac.chan_config) {
int ret = set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
if (!ret)
output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
else if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
avctx->extradata_size) < 0)
return -1;
}
if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
@@ -685,9 +605,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
cbrt_tableinit();
avcodec_get_frame_defaults(&ac->frame);
avctx->coded_frame = &ac->frame;
return 0;
}
@@ -705,7 +622,7 @@ static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
if (get_bits_left(gb) < 8 * count) {
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
return AVERROR_INVALIDDATA;
return -1;
}
skip_bits_long(gb, 8 * count);
return 0;
@@ -719,7 +636,7 @@ static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
ics->predictor_reset_group = get_bits(gb, 5);
if (ics->predictor_reset_group == 0 || ics->predictor_reset_group > 30) {
av_log(ac->avctx, AV_LOG_ERROR, "Invalid Predictor Reset Group.\n");
return AVERROR_INVALIDDATA;
return -1;
}
}
for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->m4ac.sampling_index]); sfb++) {
@@ -744,13 +661,16 @@ static void decode_ltp(AACContext *ac, LongTermPrediction *ltp,
/**
* Decode Individual Channel Stream info; reference: table 4.6.
*
* @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information.
*/
static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
GetBitContext *gb)
GetBitContext *gb, int common_window)
{
if (get_bits1(gb)) {
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
return AVERROR_INVALIDDATA;
memset(ics, 0, sizeof(IndividualChannelStream));
return -1;
}
ics->window_sequence[1] = ics->window_sequence[0];
ics->window_sequence[0] = get_bits(gb, 2);
@@ -785,11 +705,13 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
if (ics->predictor_present) {
if (ac->m4ac.object_type == AOT_AAC_MAIN) {
if (decode_prediction(ac, ics, gb)) {
return AVERROR_INVALIDDATA;
memset(ics, 0, sizeof(IndividualChannelStream));
return -1;
}
} else if (ac->m4ac.object_type == AOT_AAC_LC) {
av_log(ac->avctx, AV_LOG_ERROR, "Prediction is not allowed in AAC-LC.\n");
return AVERROR_INVALIDDATA;
memset(ics, 0, sizeof(IndividualChannelStream));
return -1;
} else {
if ((ics->ltp.present = get_bits(gb, 1)))
decode_ltp(ac, &ics->ltp, gb, ics->max_sfb);
@@ -801,7 +723,8 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
av_log(ac->avctx, AV_LOG_ERROR,
"Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
ics->max_sfb, ics->num_swb);
return AVERROR_INVALIDDATA;
memset(ics, 0, sizeof(IndividualChannelStream));
return -1;
}
return 0;
@@ -829,22 +752,21 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
int sect_band_type = get_bits(gb, 4);
if (sect_band_type == 12) {
av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
return AVERROR_INVALIDDATA;
return -1;
}
do {
sect_len_incr = get_bits(gb, bits);
while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1)
sect_end += sect_len_incr;
if (get_bits_left(gb) < 0) {
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
return AVERROR_INVALIDDATA;
}
if (sect_end > ics->max_sfb) {
av_log(ac->avctx, AV_LOG_ERROR,
"Number of bands (%d) exceeds limit (%d).\n",
sect_end, ics->max_sfb);
return AVERROR_INVALIDDATA;
}
} while (sect_len_incr == (1 << bits) - 1);
sect_end += sect_len_incr;
if (get_bits_left(gb) < 0) {
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
return -1;
}
if (sect_end > ics->max_sfb) {
av_log(ac->avctx, AV_LOG_ERROR,
"Number of bands (%d) exceeds limit (%d).\n",
sect_end, ics->max_sfb);
return -1;
}
for (; k < sect_end; k++) {
band_type [idx] = sect_band_type;
band_type_run_end[idx++] = sect_end;
@@ -914,7 +836,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
if (offset[0] > 255U) {
av_log(ac->avctx, AV_LOG_ERROR,
"%s (%d) out of range.\n", sf_str[0], offset[0]);
return AVERROR_INVALIDDATA;
return -1;
}
sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
}
@@ -972,7 +894,7 @@ static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
av_log(ac->avctx, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.\n",
tns->order[w][filt], tns_max_order);
tns->order[w][filt] = 0;
return AVERROR_INVALIDDATA;
return -1;
}
if (tns->order[w][filt]) {
tns->direction[w][filt] = get_bits1(gb);
@@ -1036,7 +958,7 @@ static inline float *VMUL4(float *dst, const float *v, unsigned idx,
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
union av_intfloat32 s0, s1;
union float754 s0, s1;
s0.f = s1.f = *scale;
s0.i ^= sign >> 1 << 31;
@@ -1054,8 +976,8 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
union av_intfloat32 s = { .f = *scale };
union av_intfloat32 t;
union float754 s = { .f = *scale };
union float754 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
@@ -1168,7 +1090,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = cb_vector_idx[code];
nnz = cb_idx >> 8 & 15;
bits = nnz ? GET_CACHE(re, gb) : 0;
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
LAST_SKIP_BITS(re, gb, nnz);
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
} while (len -= 4);
@@ -1208,7 +1130,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
GET_VLC(code, re, gb, vlc_tab, 8, 2);
cb_idx = cb_vector_idx[code];
nnz = cb_idx >> 8 & 15;
sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
sign = SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12);
LAST_SKIP_BITS(re, gb, nnz);
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
} while (len -= 2);
@@ -1255,7 +1177,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
if (b > 8) {
av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
return AVERROR_INVALIDDATA;
return -1;
}
SKIP_BITS(re, gb, b + 1);
@@ -1304,7 +1226,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
union float754 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
@@ -1312,7 +1234,7 @@ static av_always_inline float flt16_round(float pf)
static av_always_inline float flt16_even(float pf)
{
union av_intfloat32 tmp;
union float754 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
@@ -1320,7 +1242,7 @@ static av_always_inline float flt16_even(float pf)
static av_always_inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
union float754 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
@@ -1398,7 +1320,6 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
IndividualChannelStream *ics = &sce->ics;
float *out = sce->coeffs;
int global_gain, pulse_present = 0;
int ret;
/* This assignment is to silence a GCC warning about the variable being used
* uninitialized when in fact it always is.
@@ -1408,31 +1329,29 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
global_gain = get_bits(gb, 8);
if (!common_window && !scale_flag) {
if (decode_ics_info(ac, ics, gb) < 0)
return AVERROR_INVALIDDATA;
if (decode_ics_info(ac, ics, gb, 0) < 0)
return -1;
}
if ((ret = decode_band_types(ac, sce->band_type,
sce->band_type_run_end, gb, ics)) < 0)
return ret;
if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
sce->band_type, sce->band_type_run_end)) < 0)
return ret;
if (decode_band_types(ac, sce->band_type, sce->band_type_run_end, gb, ics) < 0)
return -1;
if (decode_scalefactors(ac, sce->sf, gb, global_gain, ics, sce->band_type, sce->band_type_run_end) < 0)
return -1;
pulse_present = 0;
if (!scale_flag) {
if ((pulse_present = get_bits1(gb))) {
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
av_log(ac->avctx, AV_LOG_ERROR, "Pulse tool not allowed in eight short sequence.\n");
return AVERROR_INVALIDDATA;
return -1;
}
if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
av_log(ac->avctx, AV_LOG_ERROR, "Pulse data corrupt or invalid.\n");
return AVERROR_INVALIDDATA;
return -1;
}
}
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
return AVERROR_INVALIDDATA;
return -1;
if (get_bits1(gb)) {
av_log_missing_feature(ac->avctx, "SSR", 1);
return -1;
@@ -1440,7 +1359,7 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
}
if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present, &pulse, ics, sce->band_type) < 0)
return AVERROR_INVALIDDATA;
return -1;
if (ac->m4ac.object_type == AOT_AAC_MAIN && !common_window)
apply_prediction(ac, sce);
@@ -1527,8 +1446,8 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
common_window = get_bits1(gb);
if (common_window) {
if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
return AVERROR_INVALIDDATA;
if (decode_ics_info(ac, &cpe->ch[0].ics, gb, 1))
return -1;
i = cpe->ch[1].ics.use_kb_window[0];
cpe->ch[1].ics = cpe->ch[0].ics;
cpe->ch[1].ics.use_kb_window[1] = i;
@@ -1538,7 +1457,7 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
ms_present = get_bits(gb, 2);
if (ms_present == 3) {
av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
return AVERROR_INVALIDDATA;
return -1;
} else if (ms_present)
decode_mid_side_stereo(cpe, gb, ms_present);
}
@@ -1774,7 +1693,7 @@ static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
int w, filt, m, i;
int bottom, top, order, start, end, size, inc;
float lpc[TNS_MAX_ORDER];
float tmp[TNS_MAX_ORDER + 1];
float tmp[TNS_MAX_ORDER];
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
@@ -1836,10 +1755,12 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
} else {
memset(in, 0, 448 * sizeof(float));
ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
memcpy(in + 576, in + 576, 448 * sizeof(float));
}
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
} else {
memcpy(in + 1024, in + 1024, 448 * sizeof(float));
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
memset(in + 1024 + 576, 0, 448 * sizeof(float));
}
@@ -2117,50 +2038,47 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
int size;
AACADTSHeaderInfo hdr_info;
size = avpriv_aac_parse_header(gb, &hdr_info);
size = ff_aac_parse_header(gb, &hdr_info);
if (size > 0) {
if (hdr_info.chan_config) {
if (ac->output_configured != OC_LOCKED && hdr_info.chan_config) {
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
ac->m4ac.chan_config = hdr_info.chan_config;
if (set_default_channel_config(ac->avctx, new_che_pos, hdr_info.chan_config))
return -7;
if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config,
FFMAX(ac->output_configured, OC_TRIAL_FRAME)))
if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config, OC_TRIAL_FRAME))
return -7;
} else if (ac->output_configured != OC_LOCKED) {
ac->m4ac.chan_config = 0;
ac->output_configured = OC_NONE;
}
if (ac->output_configured != OC_LOCKED) {
ac->m4ac.sbr = -1;
ac->m4ac.ps = -1;
ac->m4ac.sample_rate = hdr_info.sample_rate;
ac->m4ac.sampling_index = hdr_info.sampling_index;
ac->m4ac.object_type = hdr_info.object_type;
}
ac->m4ac.sample_rate = hdr_info.sample_rate;
ac->m4ac.sampling_index = hdr_info.sampling_index;
ac->m4ac.object_type = hdr_info.object_type;
if (!ac->avctx->sample_rate)
ac->avctx->sample_rate = hdr_info.sample_rate;
if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
// This is 2 for "VLB " audio in NSV files.
// See samples/nsv/vlb_audio.
if (hdr_info.num_aac_frames == 1) {
if (!hdr_info.crc_absent)
skip_bits(gb, 16);
} else {
av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame is", 0);
ac->warned_num_aac_frames = 1;
return -1;
}
if (!hdr_info.crc_absent)
skip_bits(gb, 16);
}
return size;
}
static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int *got_frame_ptr, GetBitContext *gb)
int *data_size, GetBitContext *gb)
{
AACContext *ac = avctx->priv_data;
ChannelElement *che = NULL, *che_prev = NULL;
enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
int err, elem_id;
int samples = 0, multiplier, audio_found = 0;
int err, elem_id, data_size_tmp;
int samples = 0, multiplier;
if (show_bits(gb, 12) == 0xfff) {
if (parse_adts_frame_header(ac, gb) < 0) {
@@ -2179,15 +2097,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
elem_id = get_bits(gb, 4);
if (elem_type < TYPE_DSE) {
if (!ac->tags_mapped && elem_type == TYPE_CPE && ac->m4ac.chan_config==1) {
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]= {0};
ac->m4ac.chan_config=2;
if (set_default_channel_config(ac->avctx, new_che_pos, 2)<0)
return -1;
if (output_configure(ac, ac->che_pos, new_che_pos, 2, OC_TRIAL_FRAME)<0)
return -1;
}
if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
elem_type, elem_id);
@@ -2200,12 +2109,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
case TYPE_SCE:
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
audio_found = 1;
break;
case TYPE_CPE:
err = decode_cpe(ac, gb, che);
audio_found = 1;
break;
case TYPE_CCE:
@@ -2214,7 +2121,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
case TYPE_LFE:
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
audio_found = 1;
break;
case TYPE_DSE:
@@ -2227,11 +2133,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if ((err = decode_pce(avctx, &ac->m4ac, new_che_pos, gb)))
break;
if (ac->output_configured > OC_TRIAL_PCE)
av_log(avctx, AV_LOG_INFO,
"Evaluating a further program_config_element.\n");
err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
if (!err)
ac->m4ac.chan_config = 0;
av_log(avctx, AV_LOG_ERROR,
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
else
err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
break;
}
@@ -2273,66 +2178,44 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
avctx->frame_size = samples;
}
if (samples) {
/* get output buffer */
ac->frame.nb_samples = samples;
if ((err = ff_get_buffer(avctx, &ac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return err;
}
data_size_tmp = samples * avctx->channels *
av_get_bytes_per_sample(avctx->sample_fmt);
if (*data_size < data_size_tmp) {
av_log(avctx, AV_LOG_ERROR,
"Output buffer too small (%d) or trying to output too many samples (%d) for this frame.\n",
*data_size, data_size_tmp);
return -1;
}
*data_size = data_size_tmp;
if (samples) {
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
ac->fmt_conv.float_interleave((float *)ac->frame.data[0],
(const float **)ac->output_data,
ac->fmt_conv.float_interleave(data, (const float **)ac->output_data,
samples, avctx->channels);
else
ac->fmt_conv.float_to_int16_interleave((int16_t *)ac->frame.data[0],
(const float **)ac->output_data,
ac->fmt_conv.float_to_int16_interleave(data, (const float **)ac->output_data,
samples, avctx->channels);
*(AVFrame *)data = ac->frame;
}
*got_frame_ptr = !!samples;
if (ac->output_configured && audio_found)
if (ac->output_configured)
ac->output_configured = OC_LOCKED;
return 0;
}
static int aac_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
int *data_size, AVPacket *avpkt)
{
AACContext *ac = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
GetBitContext gb;
int buf_consumed;
int buf_offset;
int err;
int new_extradata_size;
const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
AV_PKT_DATA_NEW_EXTRADATA,
&new_extradata_size);
if (new_extradata) {
av_free(avctx->extradata);
avctx->extradata = av_mallocz(new_extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
avctx->extradata_size = new_extradata_size;
memcpy(avctx->extradata, new_extradata, new_extradata_size);
if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac,
avctx->extradata,
avctx->extradata_size*8, 1) < 0)
return AVERROR_INVALIDDATA;
}
init_get_bits(&gb, buf, buf_size * 8);
if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
return err;
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb)) < 0)
if ((err = aac_decode_frame_int(avctx, data, data_size, &gb)) < 0)
return err;
buf_consumed = (get_bits_count(&gb) + 7) >> 3;
@@ -2383,44 +2266,29 @@ static inline uint32_t latm_get_value(GetBitContext *b)
}
static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
GetBitContext *gb, int asclen)
GetBitContext *gb)
{
AACContext *ac = &latmctx->aac_ctx;
AVCodecContext *avctx = ac->avctx;
MPEG4AudioConfig m4ac = {0};
int config_start_bit = get_bits_count(gb);
int sync_extension = 0;
int bits_consumed, esize;
if (asclen) {
sync_extension = 1;
asclen = FFMIN(asclen, get_bits_left(gb));
} else
asclen = get_bits_left(gb);
AVCodecContext *avctx = latmctx->aac_ctx.avctx;
MPEG4AudioConfig m4ac;
int config_start_bit = get_bits_count(gb);
int bits_consumed, esize;
if (config_start_bit % 8) {
av_log_missing_feature(latmctx->aac_ctx.avctx, "audio specific "
"config not byte aligned.\n", 1);
return AVERROR_INVALIDDATA;
}
if (asclen <= 0)
return AVERROR_INVALIDDATA;
bits_consumed = decode_audio_specific_config(NULL, avctx, &m4ac,
} else {
bits_consumed =
decode_audio_specific_config(NULL, avctx, &m4ac,
gb->buffer + (config_start_bit / 8),
asclen, sync_extension);
get_bits_left(gb) / 8);
if (bits_consumed < 0)
return AVERROR_INVALIDDATA;
if (ac->m4ac.sample_rate != m4ac.sample_rate ||
ac->m4ac.chan_config != m4ac.chan_config) {
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
latmctx->initialized = 0;
if (bits_consumed < 0)
return AVERROR_INVALIDDATA;
esize = (bits_consumed+7) / 8;
if (avctx->extradata_size < esize) {
if (avctx->extradata_size <= esize) {
av_free(avctx->extradata);
avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
@@ -2430,8 +2298,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
avctx->extradata_size = esize;
memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
skip_bits_long(gb, bits_consumed);
}
skip_bits_long(gb, bits_consumed);
return bits_consumed;
}
@@ -2470,11 +2339,11 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
// for all but first stream: use_same_config = get_bits(gb, 1);
if (!audio_mux_version) {
if ((ret = latm_decode_audio_specific_config(latmctx, gb, 0)) < 0)
if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0)
return ret;
} else {
int ascLen = latm_get_value(gb);
if ((ret = latm_decode_audio_specific_config(latmctx, gb, ascLen)) < 0)
if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0)
return ret;
ascLen -= ret;
skip_bits_long(gb, ascLen);
@@ -2568,15 +2437,17 @@ static int read_audio_mux_element(struct LATMContext *latmctx,
}
static int latm_decode_frame(AVCodecContext *avctx, void *out,
int *got_frame_ptr, AVPacket *avpkt)
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *out_size,
AVPacket *avpkt)
{
struct LATMContext *latmctx = avctx->priv_data;
int muxlength, err;
GetBitContext gb;
if ((err = init_get_bits(&gb, avpkt->data, avpkt->size * 8)) < 0)
return err;
if (avpkt->size == 0)
return 0;
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
// check for LOAS sync word
if (get_bits(&gb, 11) != LOAS_SYNC_WORD)
@@ -2592,12 +2463,11 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
if (!latmctx->initialized) {
if (!avctx->extradata) {
*got_frame_ptr = 0;
*out_size = 0;
return avpkt->size;
} else {
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.m4ac,
avctx->extradata, avctx->extradata_size*8, 1)) < 0)
aac_decode_close(avctx);
if ((err = aac_decode_init(avctx)) < 0)
return err;
latmctx->initialized = 1;
}
@@ -2610,7 +2480,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
return AVERROR_INVALIDDATA;
}
if ((err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb)) < 0)
if ((err = aac_decode_frame_int(avctx, out, out_size, &gb)) < 0)
return err;
return muxlength;
@@ -2619,28 +2489,33 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
av_cold static int latm_decode_init(AVCodecContext *avctx)
{
struct LATMContext *latmctx = avctx->priv_data;
int ret = aac_decode_init(avctx);
int ret;
if (avctx->extradata_size > 0)
ret = aac_decode_init(avctx);
if (avctx->extradata_size > 0) {
latmctx->initialized = !ret;
} else {
latmctx->initialized = 0;
}
return ret;
}
AVCodec ff_aac_decoder = {
.name = "aac",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
.decode = aac_decode_frame,
"aac",
AVMEDIA_TYPE_AUDIO,
CODEC_ID_AAC,
sizeof(AACContext),
aac_decode_init,
NULL,
aac_decode_close,
aac_decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
};
@@ -2661,7 +2536,5 @@ AVCodec ff_aac_latm_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
.flush = flush,
};

View File

@@ -90,7 +90,7 @@ static const uint8_t aac_channel_layout_map[7][5][2] = {
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, },
};
static const uint64_t aac_channel_layout[8] = {
static const int64_t aac_channel_layout[8] = {
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_SURROUND,

View File

@@ -46,14 +46,6 @@
#define AAC_MAX_CHANNELS 6
#define ERROR_IF(cond, ...) \
if (cond) { \
av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
return AVERROR(EINVAL); \
}
float ff_aac_pow34sf_tab[428];
static const uint8_t swb_size_1024_96[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
@@ -143,10 +135,7 @@ static const uint8_t aac_chan_configs[6][5] = {
{4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
};
/**
* Table to remap channels from Libav's default order to AAC order.
*/
static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
static const uint8_t channel_maps[][AAC_MAX_CHANNELS] = {
{ 0 },
{ 0, 1 },
{ 2, 0, 1 },
@@ -164,10 +153,10 @@ static void put_audio_specific_config(AVCodecContext *avctx)
PutBitContext pb;
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
put_bits(&pb, 5, 2); //object type - AAC-LC
put_bits(&pb, 4, s->samplerate_index); //sample rate index
put_bits(&pb, 4, s->channels);
put_bits(&pb, 4, avctx->channels);
//GASpecificConfig
put_bits(&pb, 1, 0); //frame length - 1024 samples
put_bits(&pb, 1, 0); //does not depend on core coder
@@ -180,80 +169,113 @@ static void put_audio_specific_config(AVCodecContext *avctx)
flush_put_bits(&pb);
}
#define WINDOW_FUNC(type) \
static void apply_ ##type ##_window(DSPContext *dsp, SingleChannelElement *sce, const float *audio)
WINDOW_FUNC(only_long)
{
const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
float *out = sce->ret;
dsp->vector_fmul (out, audio, lwindow, 1024);
dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
}
WINDOW_FUNC(long_start)
{
const float *lwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
float *out = sce->ret;
dsp->vector_fmul(out, audio, lwindow, 1024);
memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
}
WINDOW_FUNC(long_stop)
{
const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *swindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
float *out = sce->ret;
memset(out, 0, sizeof(out[0]) * 448);
dsp->vector_fmul(out + 448, audio + 448, swindow, 128);
memcpy(out + 576, audio + 576, sizeof(out[0]) * 448);
dsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
}
WINDOW_FUNC(eight_short)
{
const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *in = audio + 448;
float *out = sce->ret;
for (int w = 0; w < 8; w++) {
dsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
out += 128;
in += 128;
dsp->vector_fmul_reverse(out, in, swindow, 128);
out += 128;
}
}
static void (*const apply_window[4])(DSPContext *dsp, SingleChannelElement *sce, const float *audio) = {
[ONLY_LONG_SEQUENCE] = apply_only_long_window,
[LONG_START_SEQUENCE] = apply_long_start_window,
[EIGHT_SHORT_SEQUENCE] = apply_eight_short_window,
[LONG_STOP_SEQUENCE] = apply_long_stop_window
};
static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
float *audio)
static av_cold int aac_encode_init(AVCodecContext *avctx)
{
AACEncContext *s = avctx->priv_data;
int i;
const uint8_t *sizes[2];
int lengths[2];
avctx->frame_size = 1024;
for (i = 0; i < 16; i++)
if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i])
break;
if (i == 16) {
av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", avctx->sample_rate);
return -1;
}
if (avctx->channels > AAC_MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels);
return -1;
}
if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) {
av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
return -1;
}
if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
return -1;
}
s->samplerate_index = i;
dsputil_init(&s->dsp, avctx);
ff_mdct_init(&s->mdct1024, 11, 0, 1.0);
ff_mdct_init(&s->mdct128, 8, 0, 1.0);
// window init
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
ff_init_ff_sine_windows(10);
ff_init_ff_sine_windows(7);
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
avctx->extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
avctx->extradata_size = 5;
put_audio_specific_config(avctx);
sizes[0] = swb_size_1024[i];
sizes[1] = swb_size_128[i];
lengths[0] = ff_aac_num_swb_1024[i];
lengths[1] = ff_aac_num_swb_128[i];
ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[2];
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
ff_aac_tableinit();
return 0;
}
static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce, short *audio)
{
int i, k;
const int chans = avctx->channels;
const float * lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float * swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
const float * pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
float *output = sce->ret;
apply_window[sce->ics.window_sequence[0]](&s->dsp, sce, audio);
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
memcpy(output, sce->saved, sizeof(float)*1024);
if (sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE) {
memset(output, 0, sizeof(output[0]) * 448);
for (i = 448; i < 576; i++)
output[i] = sce->saved[i] * pwindow[i - 448];
for (i = 576; i < 704; i++)
output[i] = sce->saved[i];
}
if (sce->ics.window_sequence[0] != LONG_START_SEQUENCE) {
for (i = 0; i < 1024; i++) {
output[i+1024] = audio[i * chans] * lwindow[1024 - i - 1];
sce->saved[i] = audio[i * chans] * lwindow[i];
}
} else {
for (i = 0; i < 448; i++)
output[i+1024] = audio[i * chans];
for (; i < 576; i++)
output[i+1024] = audio[i * chans] * swindow[576 - i - 1];
memset(output+1024+576, 0, sizeof(output[0]) * 448);
for (i = 0; i < 1024; i++)
sce->saved[i] = audio[i * chans];
}
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
else
for (i = 0; i < 1024; i += 128)
s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + i, output + i*2);
memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024);
} else {
for (k = 0; k < 1024; k += 128) {
for (i = 448 + k; i < 448 + k + 256; i++)
output[i - 448 - k] = (i < 1024)
? sce->saved[i]
: audio[(i-1024)*chans];
s->dsp.vector_fmul (output, output, k ? swindow : pwindow, 128);
s->dsp.vector_fmul_reverse(output+128, output+128, swindow, 128);
s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + k, output);
}
for (i = 0; i < 1024; i++)
sce->saved[i] = audio[i * chans];
}
}
/**
@@ -350,7 +372,7 @@ static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, in
if (msc == 0 || ics0->max_sfb == 0)
cpe->ms_mode = 0;
else
cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2;
cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;
}
}
@@ -462,75 +484,70 @@ static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
put_bits(&s->pb, 3, TYPE_FIL);
put_bits(&s->pb, 4, FFMIN(namelen, 15));
if (namelen >= 15)
put_bits(&s->pb, 8, namelen - 14);
put_bits(&s->pb, 8, namelen - 16);
put_bits(&s->pb, 4, 0); //extension type - filler
padbits = -put_bits_count(&s->pb) & 7;
avpriv_align_put_bits(&s->pb);
padbits = 8 - (put_bits_count(&s->pb) & 7);
align_put_bits(&s->pb);
for (i = 0; i < namelen - 2; i++)
put_bits(&s->pb, 8, name[i]);
put_bits(&s->pb, 12 - padbits, 0);
}
/*
* Deinterleave input samples.
* Channels are reordered from Libav's default order to AAC order.
*/
static void deinterleave_input_samples(AACEncContext *s,
const float *samples)
{
int ch, i;
const int sinc = s->channels;
const uint8_t *channel_map = aac_chan_maps[sinc - 1];
/* deinterleave and remap input samples */
for (ch = 0; ch < sinc; ch++) {
const float *sptr = samples + channel_map[ch];
/* copy last 1024 samples of previous frame to the start of the current frame */
memcpy(&s->planar_samples[ch][1024], &s->planar_samples[ch][2048], 1024 * sizeof(s->planar_samples[0][0]));
/* deinterleave */
for (i = 2048; i < 3072; i++) {
s->planar_samples[ch][i] = *sptr;
sptr += sinc;
}
}
}
static int aac_encode_frame(AVCodecContext *avctx,
uint8_t *frame, int buf_size, void *data)
{
AACEncContext *s = avctx->priv_data;
float **samples = s->planar_samples, *samples2, *la, *overlap;
int16_t *samples = s->samples, *samples2, *la;
ChannelElement *cpe;
int i, ch, w, g, chans, tag, start_ch;
const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
int chan_el_counter[4];
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
if (s->last_frame)
return 0;
if (data) {
deinterleave_input_samples(s, data);
if (s->psypp)
ff_psy_preprocess(s->psypp, s->planar_samples, s->channels);
if (!s->psypp) {
if (avctx->channels <= 2) {
memcpy(s->samples + 1024 * avctx->channels, data,
1024 * avctx->channels * sizeof(s->samples[0]));
} else {
for (i = 0; i < 1024; i++)
for (ch = 0; ch < avctx->channels; ch++)
s->samples[(i + 1024) * avctx->channels + ch] =
((int16_t*)data)[i * avctx->channels +
channel_maps[avctx->channels-1][ch]];
}
} else {
start_ch = 0;
samples2 = s->samples + 1024 * avctx->channels;
for (i = 0; i < chan_map[0]; i++) {
tag = chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
ff_psy_preprocess(s->psypp,
(uint16_t*)data + channel_maps[avctx->channels-1][start_ch],
samples2 + start_ch, start_ch, chans);
start_ch += chans;
}
}
}
if (!avctx->frame_number) {
memcpy(s->samples, s->samples + 1024 * avctx->channels,
1024 * avctx->channels * sizeof(s->samples[0]));
return 0;
}
if (!avctx->frame_number)
return 0;
start_ch = 0;
for (i = 0; i < s->chan_map[0]; i++) {
for (i = 0; i < chan_map[0]; i++) {
FFPsyWindowInfo* wi = windows + start_ch;
tag = s->chan_map[i+1];
tag = chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
for (ch = 0; ch < chans; ch++) {
IndividualChannelStream *ics = &cpe->ch[ch].ics;
int cur_channel = start_ch + ch;
overlap = &samples[cur_channel][0];
samples2 = overlap + 1024;
la = samples2 + (448+64);
samples2 = samples + cur_channel;
la = samples2 + (448+64) * avctx->channels;
if (!data)
la = NULL;
if (tag == TYPE_LFE) {
@@ -538,12 +555,6 @@ static int aac_encode_frame(AVCodecContext *avctx,
wi[ch].window_shape = 0;
wi[ch].num_windows = 1;
wi[ch].grouping[0] = 1;
/* Only the lowest 12 coefficients are used in a LFE channel.
* The expression below results in only the bottom 8 coefficients
* being used for 11.025kHz to 16kHz sample rates.
*/
ics->num_swb = s->samplerate_index >= 8 ? 1 : 3;
} else {
wi[ch] = s->psy.model->window(&s->psy, samples2, la, cur_channel,
ics->window_sequence[0]);
@@ -554,11 +565,11 @@ static int aac_encode_frame(AVCodecContext *avctx,
ics->use_kb_window[0] = wi[ch].window_shape;
ics->num_windows = wi[ch].num_windows;
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
ics->num_swb = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
ics->num_swb = tag == TYPE_LFE ? 12 : s->psy.num_bands[ics->num_windows == 8];
for (w = 0; w < ics->num_windows; w++)
ics->group_len[w] = wi[ch].grouping[w];
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
apply_window_and_mdct(avctx, s, &cpe->ch[ch], samples2);
}
start_ch += chans;
}
@@ -569,19 +580,16 @@ static int aac_encode_frame(AVCodecContext *avctx,
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
start_ch = 0;
memset(chan_el_counter, 0, sizeof(chan_el_counter));
for (i = 0; i < s->chan_map[0]; i++) {
for (i = 0; i < chan_map[0]; i++) {
FFPsyWindowInfo* wi = windows + start_ch;
const float *coeffs[2];
tag = s->chan_map[i+1];
tag = chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
put_bits(&s->pb, 3, tag);
put_bits(&s->pb, 4, chan_el_counter[tag]++);
for (ch = 0; ch < chans; ch++)
coeffs[ch] = cpe->ch[ch].coeffs;
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
for (ch = 0; ch < chans; ch++) {
s->cur_channel = start_ch * 2 + ch;
s->cur_channel = start_ch + ch;
s->psy.model->analyze(&s->psy, s->cur_channel, cpe->ch[ch].coeffs, &wi[ch]);
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
}
cpe->common_window = 0;
@@ -597,7 +605,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
}
}
s->cur_channel = start_ch * 2;
s->cur_channel = start_ch;
if (s->options.stereo_mode && cpe->common_window) {
if (s->options.stereo_mode > 0) {
IndividualChannelStream *ics = &cpe->ch[0].ics;
@@ -624,8 +632,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
frame_bits = put_bits_count(&s->pb);
if (frame_bits <= 6144 * s->channels - 3) {
s->psy.bitres.bits = frame_bits / s->channels;
if (frame_bits <= 6144 * avctx->channels - 3) {
s->psy.bitres.bits = frame_bits / avctx->channels;
break;
}
@@ -646,7 +654,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
if (!data)
s->last_frame = 1;
memcpy(s->samples, s->samples + 1024 * avctx->channels,
1024 * avctx->channels * sizeof(s->samples[0]));
return put_bits_count(&s->pb)>>3;
}
@@ -657,116 +666,18 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
ff_mdct_end(&s->mdct1024);
ff_mdct_end(&s->mdct128);
ff_psy_end(&s->psy);
if (s->psypp)
ff_psy_preprocess_end(s->psypp);
av_freep(&s->buffer.samples);
ff_psy_preprocess_end(s->psypp);
av_freep(&s->samples);
av_freep(&s->cpe);
return 0;
}
static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
{
int ret = 0;
dsputil_init(&s->dsp, avctx);
// window init
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
ff_init_ff_sine_windows(10);
ff_init_ff_sine_windows(7);
if (ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0))
return ret;
if (ret = ff_mdct_init(&s->mdct128, 8, 0, 32768.0))
return ret;
return 0;
}
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
{
FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
for(int ch = 0; ch < s->channels; ch++)
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
return 0;
alloc_fail:
return AVERROR(ENOMEM);
}
static av_cold int aac_encode_init(AVCodecContext *avctx)
{
AACEncContext *s = avctx->priv_data;
int i, ret = 0;
const uint8_t *sizes[2];
uint8_t grouping[AAC_MAX_CHANNELS];
int lengths[2];
avctx->frame_size = 1024;
for (i = 0; i < 16; i++)
if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i])
break;
s->channels = avctx->channels;
ERROR_IF(i == 16,
"Unsupported sample rate %d\n", avctx->sample_rate);
ERROR_IF(s->channels > AAC_MAX_CHANNELS,
"Unsupported number of channels: %d\n", s->channels);
ERROR_IF(avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW,
"Unsupported profile %d\n", avctx->profile);
ERROR_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
"Too many bits per frame requested\n");
s->samplerate_index = i;
s->chan_map = aac_chan_configs[s->channels-1];
if (ret = dsp_init(avctx, s))
goto fail;
if (ret = alloc_buffers(avctx, s))
goto fail;
avctx->extradata_size = 5;
put_audio_specific_config(avctx);
sizes[0] = swb_size_1024[i];
sizes[1] = swb_size_128[i];
lengths[0] = ff_aac_num_swb_1024[i];
lengths[1] = ff_aac_num_swb_128[i];
for (i = 0; i < s->chan_map[0]; i++)
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
if (ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping))
goto fail;
s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[s->options.aac_coder];
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
ff_aac_tableinit();
for (i = 0; i < 428; i++)
ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
return 0;
fail:
aac_encode_end(avctx);
return ret;
}
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static const AVOption aacenc_options[] = {
{"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), AV_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
{"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_off", "Disable Mid/Side coding", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, AV_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"aac_coder", "", offsetof(AACEncContext, options.aac_coder), AV_OPT_TYPE_INT, {.dbl = 2}, 0, AAC_CODER_NB-1, AACENC_FLAGS},
{"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), FF_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
{"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_off", "Disable Mid/Side coding", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{NULL}
};
@@ -778,15 +689,15 @@ static const AVClass aacenc_class = {
};
AVCodec ff_aac_encoder = {
.name = "aac",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_AAC,
.priv_data_size = sizeof(AACEncContext),
.init = aac_encode_init,
.encode = aac_encode_frame,
.close = aac_encode_end,
"aac",
AVMEDIA_TYPE_AUDIO,
CODEC_ID_AAC,
sizeof(AACEncContext),
aac_encode_init,
aac_encode_frame,
aac_encode_end,
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE},
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
.priv_class = &aacenc_class,
};

View File

@@ -30,11 +30,8 @@
#include "psymodel.h"
#define AAC_CODER_NB 4
typedef struct AACEncOptions {
int stereo_mode;
int aac_coder;
} AACEncOptions;
struct AACEncContext;
@@ -61,11 +58,9 @@ typedef struct AACEncContext {
FFTContext mdct1024; ///< long (1024 samples) frame transform context
FFTContext mdct128; ///< short (128 samples) frame transform context
DSPContext dsp;
float *planar_samples[6]; ///< saved preprocessed input
int16_t *samples; ///< saved preprocessed input
int samplerate_index; ///< MPEG-4 samplerate index
int channels; ///< channel count
const uint8_t *chan_map; ///< channel configuration map
ChannelElement *cpe; ///< channel elements
FFPsyContext psy;
@@ -76,12 +71,6 @@ typedef struct AACEncContext {
float lambda;
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
struct {
float *samples;
} buffer;
} AACEncContext;
extern float ff_aac_pow34sf_tab[428];
#endif /* AVCODEC_AACENC_H */

View File

@@ -28,9 +28,9 @@
#include "aacps_tablegen.h"
#include "aacpsdata.c"
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
///< Baseline implies 10 or 20 stereo bands,
///< mixing mode A, and no ipd/opd
#define PS_BASELINE 0 //< Operate in Baseline PS mode
//< Baseline implies 10 or 20 stereo bands,
//< mixing mode A, and no ipd/opd
#define numQMFSlots 32 //numTimeSlots * RATE
@@ -69,19 +69,19 @@ static const int huff_iid[] = {
static VLC vlc_ps[10];
/**
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/
* Inter-channel Phase Difference/Overall Phase Difference parameters from the
* bitstream.
*
* @param avctx contains the current codec context
* @param gb pointer to the input bitstream
* @param ps pointer to the Parametric Stereo context
* @param par pointer to the parameter to be read
* @param e envelope to decode
* @param dt 1: time delta-coded, 0: frequency delta-coded
*/
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
/** \
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
* Inter-channel Phase Difference/Overall Phase Difference parameters from the \
* bitstream. \
* \
* @param avctx contains the current codec context \
* @param gb pointer to the input bitstream \
* @param ps pointer to the Parametric Stereo context \
* @param PAR pointer to the parameter to be read \
* @param e envelope to decode \
* @param dt 1: time delta-coded, 0: frequency delta-coded \
*/ \
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
{ \
@@ -223,7 +223,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps
cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
}
if (cnt < 0) {
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d", cnt);
goto err;
}
skip_bits(gb, cnt);
@@ -275,10 +275,6 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps
err:
ps->start = 0;
skip_bits_long(gb_host, bits_left);
memset(ps->iid_par, 0, sizeof(ps->iid_par));
memset(ps->icc_par, 0, sizeof(ps->icc_par));
memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
memset(ps->opd_par, 0, sizeof(ps->opd_par));
return bits_left;
}
@@ -658,7 +654,7 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
const float peak_decay_factor = 0.76592833836465f;
const float transient_impact = 1.5f;
const float a_smooth = 0.25f; ///< Smoothing coefficient
const float a_smooth = 0.25f; //< Smoothing coefficient
int i, k, m, n;
int n0 = 0, nL = 32;
static const int link_delay[] = { 3, 4, 5 };
@@ -817,17 +813,14 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
//Remapping
if (ps->num_env_old) {
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
}
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
if (is34) {
remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);

View File

@@ -52,11 +52,11 @@ typedef struct {
int num_env;
int enable_ipdopd;
int border_position[PS_MAX_NUM_ENV+1];
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Intensity Difference Parameters
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-Channel Coherence Parameters
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Intensity Difference Parameters
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-Channel Coherence Parameters
/* ipd/opd is iid/icc sized so that the same functions can handle both */
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Phase Difference Parameters
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Phase Difference Parameters
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Overall Phase Difference Parameters
int is34bands;
int is34bands_old;

View File

@@ -139,7 +139,7 @@ static void ps_tableinit(void)
}
for (iid = 0; iid < 46; iid++) {
float c = iid_par_dequant[iid]; ///< Linear Inter-channel Intensity Difference
float c = iid_par_dequant[iid]; //<Linear Inter-channel Intensity Difference
float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
float c2 = c * c1;
for (icc = 0; icc < 8; icc++) {

View File

@@ -216,7 +216,7 @@ static const float psy_fir_coeffs[] = {
};
/**
* Calculate the ABR attack threshold from the above LAME psymodel table.
* calculates the attack threshold for ABR from the above table for the LAME psy model
*/
static float lame_calc_attack_threshold(int bitrate)
{
@@ -377,10 +377,9 @@ static const uint8_t window_grouping[9] = {
* Tell encoder which window types to use.
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
*/
static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
const int16_t *audio,
const int16_t *la,
int channel, int prev_type)
static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
const int16_t *audio, const int16_t *la,
int channel, int prev_type)
{
int i, j;
int br = ctx->avctx->bit_rate / ctx->avctx->channels;
@@ -400,7 +399,7 @@ static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
int stay_short = 0;
for (i = 0; i < 8; i++) {
for (j = 0; j < 128; j++) {
v = iir_filter(la[i*128+j], pch->iir_state);
v = iir_filter(la[(i*128+j)*ctx->avctx->channels], pch->iir_state);
sum += v*v;
}
s[i] = sum;
@@ -557,8 +556,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
/**
* Calculate band thresholds as suggested in 3GPP TS26.403
*/
static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
const float *coefs, const FFPsyWindowInfo *wi)
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
const float *coefs, const FFPsyWindowInfo *wi)
{
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
AacPsyChannel *pch = &pctx->ch[channel];
@@ -627,7 +626,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
}
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
ctx->ch[channel].entropy = pe;
ctx->pe[channel] = pe;
desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
/* NOTE: PE correction is kept simple. During initial testing it had very
@@ -731,7 +730,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
for (w = 0; w < wi->num_windows*16; w += 16) {
for (g = 0; g < num_bands; g++) {
AacPsyBand *band = &pch->band[w+g];
FFPsyBand *psy_band = &ctx->ch[channel].psy_bands[w+g];
FFPsyBand *psy_band = &ctx->psy_bands[channel*PSY_MAX_BANDS+w+g];
psy_band->threshold = band->thr;
psy_band->energy = band->energy;
@@ -741,16 +740,6 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
}
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
const float **coeffs, const FFPsyWindowInfo *wi)
{
int ch;
FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
for (ch = 0; ch < group->num_ch; ch++)
psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
}
static av_cold void psy_3gpp_end(FFPsyContext *apc)
{
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
@@ -776,8 +765,9 @@ static void lame_apply_block_type(AacPsyChannel *ctx, FFPsyWindowInfo *wi, int u
ctx->next_window_seq = blocktype;
}
static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
const float *la, int channel, int prev_type)
static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx,
const int16_t *audio, const int16_t *la,
int channel, int prev_type)
{
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
AacPsyChannel *pch = &pctx->ch[channel];
@@ -794,20 +784,20 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
const float *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN);
int chans = ctx->avctx->channels;
const int16_t *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans;
int j, att_sum = 0;
/* LAME comment: apply high pass filter of fs/4 */
for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {
float sum1, sum2;
sum1 = firbuf[i + (PSY_LAME_FIR_LEN - 1) / 2];
sum1 = firbuf[(i + ((PSY_LAME_FIR_LEN - 1) / 2)) * chans];
sum2 = 0.0;
for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {
sum1 += psy_fir_coeffs[j] * (firbuf[i + j] + firbuf[i + PSY_LAME_FIR_LEN - j]);
sum2 += psy_fir_coeffs[j + 1] * (firbuf[i + j + 1] + firbuf[i + PSY_LAME_FIR_LEN - j - 1]);
sum1 += psy_fir_coeffs[j] * (firbuf[(i + j) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j) * chans]);
sum2 += psy_fir_coeffs[j + 1] * (firbuf[(i + j + 1) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j - 1) * chans]);
}
/* NOTE: The LAME psymodel expects it's input in the range -32768 to 32768. Tuning this for normalized floats would be difficult. */
hpfsmpl[i] = (sum1 + sum2) * 32768.0f;
hpfsmpl[i] = sum1 + sum2;
}
/* Calculate the energies of each sub-shortblock */
@@ -822,15 +812,16 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);
float p = 1.0f;
for (; pf < pfe; pf++)
p = FFMAX(p, fabsf(*pf));
if (p < fabsf(*pf))
p = fabsf(*pf);
pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
/* NOTE: The indexes below are [i + 3 - 2] in the LAME source.
* Obviously the 3 and 2 have some significance, or this would be just [i + 1]
* (which is what we use here). What the 3 stands for is ambiguous, as it is both
* number of short blocks, and the number of sub-short blocks.
* It seems that LAME is comparing each sub-block to sub-block + 1 in the
* previous block.
/* FIXME: The indexes below are [i + 3 - 2] in the LAME source.
* Obviously the 3 and 2 have some significance, or this would be just [i + 1]
* (which is what we use here). What the 3 stands for is ambigious, as it is both
* number of short blocks, and the number of sub-short blocks.
* It seems that LAME is comparing each sub-block to sub-block + 1 in the
* previous block.
*/
if (p > energy_subshort[i + 1])
p = p / energy_subshort[i + 1];

View File

@@ -33,7 +33,6 @@
#include "fft.h"
#include "aacps.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"
#include <stdint.h>
#include <float.h>
@@ -131,8 +130,6 @@ av_cold void ff_aac_sbr_init(void)
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
{
float mdct_scale;
if(sbr->mdct.mdct_bits)
return;
sbr->kx[0] = sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
@@ -542,7 +539,7 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
k = sbr->n_master;
} while (sb != sbr->kx[1] + sbr->m[1]);
if (sbr->num_patches > 1 && sbr->patch_num_subbands[sbr->num_patches-1] < 3)
if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1)
sbr->num_patches--;
return 0;
@@ -1185,15 +1182,14 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
{
int i, n;
const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
const int step = 128 >> div;
float *v;
for (i = 0; i < 32; i++) {
if (*v_off < step) {
if (*v_off == 0) {
int saved_samples = (1280 - 128) >> div;
memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
*v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
*v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - (128 >> div);
} else {
*v_off -= step;
*v_off -= 128 >> div;
}
v = v0 + *v_off;
if (div) {
@@ -1461,7 +1457,6 @@ static void sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
int k;
av_assert0(sbr->kx[1] <= table[0]);
for (i = 0; i < ilim; i++)
for (m = table[i]; m < table[i + 1]; m++)
sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];

View File

@@ -34,10 +34,17 @@
typedef struct AascContext {
AVCodecContext *avctx;
GetByteContext gb;
AVFrame frame;
} AascContext;
#define FETCH_NEXT_STREAM_BYTE() \
if (stream_ptr >= buf_size) \
{ \
av_log(s->avctx, AV_LOG_ERROR, " AASC: stream ptr just went out of bounds (fetch)\n"); \
break; \
} \
stream_byte = buf[stream_ptr++];
static av_cold int aasc_decode_init(AVCodecContext *avctx)
{
AascContext *s = avctx->priv_data;
@@ -58,7 +65,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
AascContext *s = avctx->priv_data;
int compr, i, stride;
s->frame.reference = 3;
s->frame.reference = 1;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if (avctx->reget_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
@@ -72,18 +79,12 @@ static int aasc_decode_frame(AVCodecContext *avctx,
case 0:
stride = (avctx->width * 3 + 3) & ~3;
for(i = avctx->height - 1; i >= 0; i--){
if(avctx->width*3 > buf_size){
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
break;
}
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
buf += stride;
buf_size -= stride;
}
break;
case 1:
bytestream2_init(&s->gb, buf - 4, buf_size + 4);
ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, &s->gb);
ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, buf - 4, buf_size + 4);
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);
@@ -109,13 +110,14 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx)
}
AVCodec ff_aasc_decoder = {
.name = "aasc",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_AASC,
.priv_data_size = sizeof(AascContext),
.init = aasc_decode_init,
.close = aasc_decode_end,
.decode = aasc_decode_frame,
.capabilities = CODEC_CAP_DR1,
"aasc",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_AASC,
sizeof(AascContext),
aasc_decode_init,
NULL,
aasc_decode_end,
aasc_decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
};

View File

@@ -120,7 +120,7 @@ typedef struct {
uint32_t bit_rate;
uint8_t channels;
uint16_t frame_size;
uint64_t channel_layout;
int64_t channel_layout;
/** @} */
} AC3HeaderInfo;
@@ -131,8 +131,47 @@ typedef enum {
EAC3_FRAME_TYPE_RESERVED
} EAC3FrameType;
/**
* Encoding Options used by AVOption.
*/
typedef struct AC3EncOptions {
/* AC-3 metadata options*/
int dialogue_level;
int bitstream_mode;
float center_mix_level;
float surround_mix_level;
int dolby_surround_mode;
int audio_production_info;
int mixing_level;
int room_type;
int copyright;
int original;
int extended_bsi_1;
int preferred_stereo_downmix;
float ltrt_center_mix_level;
float ltrt_surround_mix_level;
float loro_center_mix_level;
float loro_surround_mix_level;
int extended_bsi_2;
int dolby_surround_ex_mode;
int dolby_headphone_mode;
int ad_converter_type;
/* other encoding options */
int allow_per_frame_metadata;
int stereo_rematrixing;
int channel_coupling;
int cpl_start;
} AC3EncOptions;
void ff_ac3_common_init(void);
extern const int64_t ff_ac3_channel_layouts[];
extern const AVOption ff_ac3_options[];
extern AVCodec ff_ac3_float_encoder;
extern AVCodec ff_ac3_fixed_encoder;
/**
* Calculate the log power-spectral density of the input signal.
* This gives a rough estimate of signal power in the frequency domain by using

View File

@@ -34,20 +34,8 @@ static const uint8_t eac3_blocks[4] = {
1, 2, 3, 6
};
/**
* Table for center mix levels
* reference: Section 5.4.2.4 cmixlev
*/
static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
/**
* Table for surround mix levels
* reference: Section 5.4.2.5 surmixlev
*/
static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
{
int frame_size_code;
@@ -65,8 +53,8 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
hdr->num_blocks = 6;
/* set default mix levels */
hdr->center_mix_level = 5; // -4.5dB
hdr->surround_mix_level = 6; // -6.0dB
hdr->center_mix_level = 1; // -4.5dB
hdr->surround_mix_level = 1; // -6.0dB
if(hdr->bitstream_id <= 10) {
/* Normal AC-3 */
@@ -88,9 +76,9 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
skip_bits(gbc, 2); // skip dsurmod
} else {
if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
hdr-> center_mix_level = center_levels[get_bits(gbc, 2)];
hdr->center_mix_level = get_bits(gbc, 2);
if(hdr->channel_mode & 4)
hdr->surround_mix_level = surround_levels[get_bits(gbc, 2)];
hdr->surround_mix_level = get_bits(gbc, 2);
}
hdr->lfe_on = get_bits1(gbc);
@@ -134,7 +122,7 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
(hdr->num_blocks * 256.0));
hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
}
hdr->channel_layout = avpriv_ac3_channel_layout_tab[hdr->channel_mode];
hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
if (hdr->lfe_on)
hdr->channel_layout |= AV_CH_LOW_FREQUENCY;
@@ -147,13 +135,13 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err;
union {
uint64_t u64;
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
uint8_t u8[8];
} tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr;
GetBitContext gbc;
init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
err = avpriv_ac3_parse_header(&gbc, &hdr);
err = ff_ac3_parse_header(&gbc, &hdr);
if(err < 0)
return 0;
@@ -186,9 +174,9 @@ static av_cold int ac3_parse_init(AVCodecParserContext *s1)
AVCodecParser ff_ac3_parser = {
.codec_ids = { CODEC_ID_AC3, CODEC_ID_EAC3 },
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = ac3_parse_init,
.parser_parse = ff_aac_ac3_parse,
.parser_close = ff_parse_close,
{ CODEC_ID_AC3, CODEC_ID_EAC3 },
sizeof(AACAC3ParseContext),
ac3_parse_init,
ff_aac_ac3_parse,
ff_parse_close,
};

View File

@@ -36,6 +36,6 @@
* -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
* element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
*/
int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
#endif /* AVCODEC_AC3_PARSER_H */

File diff suppressed because it is too large Load Diff

View File

@@ -66,9 +66,7 @@
#define AC3_FRAME_BUFFER_SIZE 32768
typedef struct {
AVClass *class; ///< class for AVOptions
AVCodecContext *avctx; ///< parent context
AVFrame frame; ///< AVFrame for decoded output
GetBitContext gbc; ///< bitstream reader
///@name Bit stream information
@@ -89,12 +87,6 @@ typedef struct {
int eac3; ///< indicates if current frame is E-AC-3
///@}
int preferred_stereo_downmix;
float ltrt_center_mix_level;
float ltrt_surround_mix_level;
float loro_center_mix_level;
float loro_surround_mix_level;
///@name Frame syntax parameters
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
int block_switch_syntax; ///< block switch syntax enabled (blkswe)
@@ -151,7 +143,6 @@ typedef struct {
///@name Dynamic range
float dynamic_range[2]; ///< dynamic range
float drc_scale; ///< percentage of dynamic range compression to be applied
///@}
///@name Bandwidth

View File

@@ -23,7 +23,6 @@
#include "avcodec.h"
#include "ac3.h"
#include "ac3dsp.h"
#include "mathops.h"
static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
{
@@ -109,7 +108,7 @@ static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd,
int snr_offset, int floor,
const uint8_t *bap_tab, uint8_t *bap)
{
int bin, band, band_end;
int bin, band;
/* special case, if snr offset is -960, set all bap's to zero */
if (snr_offset == -960) {
@@ -121,14 +120,12 @@ static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd,
band = ff_ac3_bin_to_band_tab[start];
do {
int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
band_end = ff_ac3_band_start_tab[++band];
band_end = FFMIN(band_end, end);
int band_end = FFMIN(ff_ac3_band_start_tab[band+1], end);
for (; bin < band_end; bin++) {
int address = av_clip((psd[bin] - m) >> 5, 0, 63);
bap[bin] = bap_tab[address];
}
} while (end > band_end);
} while (end > ff_ac3_band_start_tab[band++]);
}
static void ac3_update_bap_counts_c(uint16_t mant_cnt[16], uint8_t *bap,
@@ -167,50 +164,21 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
int i;
for (i = 0; i < nb_coefs; i++) {
int e;
int v = abs(coef[i]);
exp[i] = v ? 23 - av_log2(v) : 24;
}
}
static void ac3_sum_square_butterfly_int32_c(int64_t sum[4],
const int32_t *coef0,
const int32_t *coef1,
int len)
{
int i;
sum[0] = sum[1] = sum[2] = sum[3] = 0;
for (i = 0; i < len; i++) {
int lt = coef0[i];
int rt = coef1[i];
int md = lt + rt;
int sd = lt - rt;
MAC64(sum[0], lt, lt);
MAC64(sum[1], rt, rt);
MAC64(sum[2], md, md);
MAC64(sum[3], sd, sd);
}
}
static void ac3_sum_square_butterfly_float_c(float sum[4],
const float *coef0,
const float *coef1,
int len)
{
int i;
sum[0] = sum[1] = sum[2] = sum[3] = 0;
for (i = 0; i < len; i++) {
float lt = coef0[i];
float rt = coef1[i];
float md = lt + rt;
float sd = lt - rt;
sum[0] += lt * lt;
sum[1] += rt * rt;
sum[2] += md * md;
sum[3] += sd * sd;
if (v == 0)
e = 24;
else {
e = 23 - av_log2(v);
if (e >= 24) {
e = 24;
coef[i] = 0;
} else if (e < 0) {
e = 0;
coef[i] = av_clip(coef[i], -16777215, 16777215);
}
}
exp[i] = e;
}
}
@@ -225,8 +193,6 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
c->update_bap_counts = ac3_update_bap_counts_c;
c->compute_mantissa_size = ac3_compute_mantissa_size_c;
c->extract_exponents = ac3_extract_exponents_c;
c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
if (ARCH_ARM)
ff_ac3dsp_init_arm(c, bit_exact);

Some files were not shown because too many files have changed in this diff Show More