Compare commits

..

178 Commits

Author SHA1 Message Date
Matt Wolenetz
5bed920971 Fix Win64 AVX h264_deblock by not using redzone on Win64
Thanks-to: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 82a4a4e7ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 01:47:05 +01:00
Michael Niedermayer
705e89d75f update for 1.1.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:53 +01:00
Andrea3000
ef688e7425 matroska: fix missing ,
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8d8c59480e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
02d1efdd5b h264: check that luma and chroma depth match
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bdeb61ccc6)

Conflicts:

	libavcodec/h264_ps.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
469cb61193 avcodec_decode_audio4: check got_frame_ptr before handling initial skip
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8a6449167a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
a642be972d h264: ensure that get_format() is called when changing format but not otherwise.
Fixes Ticket2288

Tested-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 04220b473e)

Conflicts:

	libavcodec/h264.c
2013-02-22 22:53:11 +01:00
Michael Niedermayer
80ddf7889e Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  doc: Fix some obsolete references to av* tools as ff* tools
  vqavideo: check chunk sizes before reading chunks
  roqvideodec: check dimensions validity
  qdm2: check array index before use, fix out of array accesses
  mpegvideo: Do REBASE_PICTURE with byte pointers

Conflicts:
	libavcodec/qdm2.c
	libavcodec/roqvideodec.c
	libavcodec/vqavideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:44:15 +01:00
Carl Eugen Hoyos
4be63111d1 Fix bits_per_coded_sample when encoding png with frame-level multithreading.
Fixes ticket #2290.
(cherry picked from commit c4dc6c4c86)
2013-02-21 09:04:05 +01:00
Vicente Jimenez Aguilar
6626a7df53 doc: Fix some obsolete references to av* tools as ff* tools
Signed-off-by: Diego Biurrun <diego@biurrun.de>

CC: libav-stable@libav.org
(cherry picked from commit 202b5f6deb)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:11:11 +01:00
Michael Niedermayer
ab434bf0d0 vqavideo: check chunk sizes before reading chunks
Fixes out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ab6c9332bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 13093f9767)

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit f7d18deb73)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:10:24 +01:00
Michael Niedermayer
52b18c1fde roqvideodec: check dimensions validity
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ae6104511)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fee26d352a)

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 488f87be87)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:10:03 +01:00
Michael Niedermayer
0b2b8ab979 qdm2: check array index before use, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit a7ee6281f7)

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 39bec05ed4)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:09:48 +01:00
Martin Storsjö
65bf4c9c45 mpegvideo: Do REBASE_PICTURE with byte pointers
REBASE_PICTURE (more specifically, this half of it) takes a Picture
pointer that points into one larger struct, finds the offset of
that Picture within the struct and finds the corresponding field
within another instance of a similar struct.

The pointer difference "pic - (Picture*)old_ctx" is a value given
in sizeof(Picture) units, and when applied back on
(Picture*)new_ctx gets multiplied back with sizeof(Picture). Many
compilers seem to optimize out this division/multiplication, but
not all do.

GCC 4.2 on OS X doesn't seem to remove the division/multiplication,
therefore the new pointer didn't turn out to point to exactly
the right place in the new struct since it only had sizeof(Picture)
granularity (and the Picture is not aligned on a sizeof(Picture)
boundary within the encompassing struct). This bug has been present
before 47318953d as well - with H264, pointers to h->ref_list[0][0]
pointed to 88 bytes before h->ref_list[0][0] after the rebase. After
shrinking Picture, the difference ended up even larger, making
writes via such a Picture pointer overwrite other fields at random
in H264Context, ending up in crashes later.

This fixes H264 multithreaded decoding on OS X with GCC 4.2.

Fixes Bug: #439

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a65f965c04)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:09:08 +01:00
Michael Niedermayer
7c40a0449b swr: check channel layouts before using them.
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 21cd905cd4)

Conflicts:

	libswresample/swresample.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:31:25 +01:00
Michael Niedermayer
811a504c6b shorten: dont leave invalid channel counts in the context.
Fixes freeing invalid addresses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4f1279154e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:52 +01:00
Michael Niedermayer
75211f2b8c tiff: Check buffer allocation and pointer increment more carefully in shorts2str() and double2str()
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e1219cdaf9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:46 +01:00
Michael Niedermayer
f6687bbb64 pngdec/filter: dont access out of array elements at the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ac0fa50ef)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:41 +01:00
Michael Niedermayer
1400f1a1e4 sanm: Use the correct height variable in the decoded_size checks
Fixes integer overflow and out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5260edee7e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:35 +01:00
Michael Niedermayer
1ea5bbc594 sanm: add forgotten check for decoded_size in old_codec37()
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 365270aec5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:30 +01:00
Michael Niedermayer
f5955d9f6f targa: Fix y check in advance_line
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 796012af6c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:24 +01:00
Hendrik Leppkes
e14564b926 lavfi/kerndeint: use av_pix_fmt_desc_get instead of directly accessing the table
Fixes FATE in MSVC DLL builds.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5ad43af9a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:25:44 +01:00
Michael Niedermayer
0f5a0a4155 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  svq3: unbreak decoding
  build: make audio_frame_queue a stand-alone component
  build: The libopencore-amrnb encoder depends on audio_frame_queue
  libopencore-amrwb: Make AMR-WB ifdeffery more precise
  libopencore-amr: Conditionally compile decoder and encoder bits
  libopencore-amrnb: cosmetics: Group all encoder-related code together

Conflicts:
	configure
	libavcodec/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:19:31 +01:00
Diego Biurrun
7acfa7758c configure: Make warnings from -Wreturn-type fatal errors
These warnings have no false positives and point to serious bugs.
(cherry picked from commit 99853cb8d4)

Conflicts:

	configure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 00:52:44 +01:00
Michael Niedermayer
56b6909b39 movenc: hotfix, dont store fiel for h264 / mpeg4-asp / dnxhd
Other software does not store it in this case, and the information
is provided by the codec stream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 405cc0d905)

Conflicts:

	tests/ref/lavf/mov
2013-02-18 18:22:04 +01:00
Michael Niedermayer
c6f59b95c5 h264: avoid calling get_format() multiple times
Some applications do not like that.
Fixes VDA
Reduces noise for VDPAU

Tested-by: Guillaume POIRIER <poirierg@gmail.com>
Tested-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dece584a63)

Conflicts:

	libavcodec/h264.c
2013-02-18 18:14:11 +01:00
Matti Hamalainen
d61c6ebccf svq3: unbreak decoding
a7d2861d36 removed necessary braces.
2013-02-18 02:49:45 +01:00
Luca Barbato
b9a287f237 build: make audio_frame_queue a stand-alone component
Encoders requiring it have the dependency expressed in the configure.
2013-02-17 22:38:37 +01:00
Carl Eugen Hoyos
6407800521 Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit 620b88a302.

Fixes ticket #2272.

Conflicts:
	libavformat/swfenc.c
(cherry picked from commit 8d0757e107)
2013-02-17 20:27:19 +01:00
Diego Biurrun
6c62098827 build: The libopencore-amrnb encoder depends on audio_frame_queue
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit d0fd1dd559b8362bdbca3405f739e0cc202d62e7)
2013-02-16 23:41:31 +01:00
Diego Biurrun
a23d6ea1e4 libopencore-amrwb: Make AMR-WB ifdeffery more precise
The library might provide an encoder in the future, so it's better to
check for the presence of the decoder rather than just the library.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ed89cad6aa04bbd692b3eb21c0e0bb56aca77130)
2013-02-16 23:41:31 +01:00
Diego Biurrun
e492818d89 libopencore-amr: Conditionally compile decoder and encoder bits
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f6ad3ca159edcd2e48634bf39b9cd4a85af29cb1)
2013-02-16 23:41:31 +01:00
Diego Biurrun
1ca25bc387 libopencore-amrnb: cosmetics: Group all encoder-related code together
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 81ae57a269782fbfc9e11548d1e6605f13d65c9b)
2013-02-16 23:41:31 +01:00
Carl Eugen Hoyos
057051b848 Write the fiel atom to mov files independently of the used video coded.
The QuickTime specification does not contain any hint that the atom
must not be written in some cases and both the QuickTime and the
AVID decoders do not fail if the atom is present.

This change allows to signal (visually) interlaced streams with
a codec different from uncompressed video.

As a side-effect, this fixes ticket #2202
(cherry picked from commit 7d0e3b197c)

Conflicts:
	tests/ref/lavf/mov
2013-02-14 15:18:55 +01:00
Michael Niedermayer
71fee2ab1e sws: dont write out of array on bigendian
Fixes Ticket2229

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e2c63685e)
2013-02-14 14:17:21 +01:00
Michael Niedermayer
7d3e217623 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
  doc/platform: Fix 10l typo
  xxan: properly handle odd heights.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 13:50:08 +01:00
Michael Niedermayer
2ac6b573a4 h264: Reset last_pocs in case of reference or frame number inconsistencies
This prevents faulty increasing of has_b_frames
Should fix Ticket 2062

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c230af9bcc)
2013-02-14 13:33:44 +01:00
Michael Niedermayer
7f8846405e Merge commit 'b7765d00f911fe0f8fcda21b93a540f27d2ba2f5' into release/1.1
* commit 'b7765d00f911fe0f8fcda21b93a540f27d2ba2f5':
  msrledec: check bounds before constructing a possibly invalid pointer,
  qtrle: fix the topmost line for 1bit
  aasc: fix output for msrle compression.

Conflicts:
	tests/ref/fate/aasc
	tests/ref/fate/qtrle-1bit

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 13:14:54 +01:00
Michael Niedermayer
81bcf9454e Merge commit '108ca6fad1e0e9af8d6337f908bfd23807b7fbd6' into release/1.1
* commit '108ca6fad1e0e9af8d6337f908bfd23807b7fbd6':
  yop: check for input overreads.
  yop: check that extradata is large enough.
  fraps: fix off-by one bug for version 1.

Conflicts:
	libavcodec/fraps.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:57:14 +01:00
Michael Niedermayer
5a3c8f95d5 Merge commit '5bee21d724dc47d115faae3f5065a6db74e1594a' into release/1.1
* commit '5bee21d724dc47d115faae3f5065a6db74e1594a':
  vf_delogo: fix copying the input frame.
  vf_delogo: fix an uninitialized read.
  dnxhdenc: fix invalid reads in dnxhd_mb_var_thread().
  atrac3: use correct loop variable in add_tonal_components()

Conflicts:
	libavfilter/vf_delogo.c
	tests/ref/vsynth/vsynth1-dnxhd-1080i
	tests/ref/vsynth/vsynth2-dnxhd-1080i

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:27:48 +01:00
Michael Niedermayer
358e4081ed mlp: fix channel order.
This fixes a regression introduced with todays merge

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6747b0be9b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:13:15 +01:00
Michael Niedermayer
6baaaa0174 Merge commit '5af78cc98d807f3b43510410dad46e1840c5c99f' into release/1.1
* commit '5af78cc98d807f3b43510410dad46e1840c5c99f':
  mlp: store the channel layout for each substream.
  mlpdec: TrueHD: use Libav channel order.
  mlpdec: set the channel layout.
  x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly

Conflicts:
	libavcodec/mlp_parser.c
	libavcodec/mlpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:03:59 +01:00
Michael Niedermayer
9e3e11a348 Merge commit '1fd2deedcc6400e08b31566a547a5fac3b38cefb'
* commit '1fd2deedcc6400e08b31566a547a5fac3b38cefb':
  mlpdec: set the channel layout.

Conflicts:
	libavcodec/mlpdec.c

(cherry picked from commit 1cf6f6f3da)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:53:39 +01:00
Michael Niedermayer
1d20d975aa Merge commit '3ffcccb4fbaae4d5ad775506f1f2761f2029affa'
* commit '3ffcccb4fbaae4d5ad775506f1f2761f2029affa':
  mlpdec: TrueHD: use Libav channel order.

(cherry picked from commit cd6a8618b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:53:26 +01:00
Michael Niedermayer
e67491a2a4 Merge commit '99ccd2ba10eac2b282c272ad9e75f082123c765a'
* commit '99ccd2ba10eac2b282c272ad9e75f082123c765a':
  mlp: store the channel layout for each substream.

Conflicts:
	libavcodec/mlp_parser.c
	libavcodec/mlpdec.c

(cherry picked from commit fa36270c4c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:52:23 +01:00
Michael Niedermayer
e1a86b1433 mlpdec: dont leave a invalid huff_lsb in the context.
Fix assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4aed4f5846)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:48:25 +01:00
Martin Storsjö
5310da7e83 arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
On recent android versions, /proc/self/auxw is unreadable
(unless the process is running running under the shell uid or
in debuggable mode, which makes it hard to notice). See
http://b.android.com/43055 and
https://android-review.googlesource.com/51271 for more information
about the issue.

This makes sure e.g. neon optimizations are enabled at runtime in
android apps even when built in release mode, if configured to
use the runtime detection.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ab8f1a6989)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-14 10:39:23 +02:00
Derek Buitenhuis
4eede1fca2 doc/platform: Fix 10l typo
This error was somehow missed for months.

(cherry picked from commit 130cefc9dc)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-13 21:35:10 -05:00
Anton Khirnov
b7765d00f9 msrledec: check bounds before constructing a possibly invalid pointer,
CC:libav-stable@libav.org
(cherry picked from commit 9bd6375d5f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:57 +01:00
Kostya Shishkov
5479e08cc4 xxan: properly handle odd heights.
Duplicate the last one or two chroma lines.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
CC:libav-stable@libav.org
(cherry picked from commit 685e6f2e39)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:57 +01:00
Kostya Shishkov
d0249f1c2e qtrle: fix the topmost line for 1bit
Signed-off-by: Anton Khirnov <anton@khirnov.net>
CC:libav-stable@libav.org
(cherry picked from commit 89f11f498b)

Conflicts:

	cmdutils.c
2013-02-07 07:18:57 +01:00
Anton Khirnov
108ca6fad1 yop: check for input overreads.
CC:libav-stable@libav.org
(cherry picked from commit 8136f23444)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
5bee21d724 vf_delogo: fix copying the input frame.
CC:libav-stable@libav.org
(cherry picked from commit 7194330bcd)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
1f8bf163e4 aasc: fix output for msrle compression.
The bottom line was invalid before.

CC:libav-stable@libav.org
(cherry picked from commit da7baaaae7)

Conflicts:

	cmdutils.c
2013-02-07 07:18:56 +01:00
Anton Khirnov
7e35c50b81 yop: check that extradata is large enough.
CC:libav-stable@libav.org
(cherry picked from commit 06cf597c35)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
e835ce83e2 vf_delogo: fix an uninitialized read.
CC:libav-stable@libav.org
(cherry picked from commit f81c37e40f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
00bf66785f fraps: fix off-by one bug for version 1.
CC:libav-stable@libav.org
(cherry picked from commit 2cd4068071)

Conflicts:

	cmdutils.c
	libavcodec/fraps.c
2013-02-07 07:18:56 +01:00
Anton Khirnov
e0e4250421 dnxhdenc: fix invalid reads in dnxhd_mb_var_thread().
Do not assume that frame dimensions are mod16 (or that height is mod32
for interlaced).

CC:libav-stable@libav.org
(cherry picked from commit 69c25c9284)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Michael Karcher
901682ff78 atrac3: use correct loop variable in add_tonal_components()
Signed-off-by: Michael Karcher <ffmpeg@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 0e3afacd4d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Tim Walker
5af78cc98d mlp: store the channel layout for each substream.
Also stop storing the channel arrangement in the header info, as it's unused outside of ff_mlp_read_major_sync.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 99ccd2ba10)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Tim Walker
59f22ef91a mlpdec: TrueHD: use Libav channel order.
Fixes bug 208.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 3ffcccb4fb)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Tim Walker
5393a5600d mlpdec: set the channel layout.
Fixes bug 401.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 1fd2deedcc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Diego Biurrun
077beee465 x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
CC: libav-stable@libav.org
(cherry picked from commit 4f56e773fe)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Matthieu Bouron
02d3ad8609 lavf/mov: skip version and flags attributes in mov_read_chan function
Fixes ticket #1764.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59d40fc7e6)
2013-02-06 23:24:19 +01:00
Michael Niedermayer
b48cf5412b ffmpeg: do not call exit from exit_program()
This should fix  Ticket2116

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 127ff88639)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 04:15:48 +01:00
Michael Niedermayer
5f3fa5f930 ffmpeg: dont allow -flags to override -pass
Fixes Ticket2154

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ccf9dd00da)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 02:03:05 +01:00
Michael Niedermayer
0e1bb99f26 update for 1.1.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 02:02:35 +01:00
Michael Niedermayer
d2c1a8dc2d ljpegenc: allocate needed scratch-buffer
Fixes null pointer dereference
Fixes Ticket2207

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2dd5a18b2)
2013-02-06 00:11:11 +01:00
Michael Niedermayer
5a97a5291a riff: fix infinite loop
Fixes Ticket2241

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a8343bfb6a)
2013-02-06 00:10:05 +01:00
Michael Niedermayer
f6b50924a5 dvenc: dont fail hard if the timecode is invalid
Instead just dont store the timecode
Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0eacbc760)
2013-02-06 00:09:03 +01:00
Michael Niedermayer
a55c274f51 movtextenc: fix pointer messup and out of array accesses
Fixes Ticket2213

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b0635e2fcf)
2013-02-06 00:07:02 +01:00
Michael Niedermayer
eaa9d2cd6b h264: skip error concealment when SPS and slices are mismatching
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 695af8eed6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:53:12 +01:00
Michael Niedermayer
d3bec24739 h264: Only apply error concealment if theres a frame
Without any correctly decoded slices, there can be no frame.

Fixes out of array reads

Found-by: Rafaël Carré
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 60af6c3138)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:53:03 +01:00
Michael Niedermayer
3ef1538121 h264: check the pixel format directly and force a reinit on mismatches.
The existing checks are insufficient to detect a pixel format
changes in case of some damaged streams.
Fixes inconsistency and later out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 11c99c78ba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:50:52 +01:00
Michael Niedermayer
47e462eecc aacdec: check channel count
Prevent out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96f452ac64)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:48:04 +01:00
Michael Niedermayer
f3d1670606 vqavideo: check chunk sizes before reading chunks
Fixes out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ab6c9332bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:59 +01:00
Michael Niedermayer
9547034f91 gifdec: gif_copy_img_rect: Fix end pointer
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c10350358d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:53 +01:00
Michael Niedermayer
62c9beda0c sanm: Check decoded_size.
This prevents a buffer overflow in rle_decode()

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7357ca900e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:41 +01:00
Diego Biurrun
0e68b6ddce Use proper "" quotes for local header #includes
(cherry picked from commit 6c1a7d07eb)

Conflicts:

	libavcodec/kbdwin.c
2013-02-05 16:35:28 +01:00
Michael Niedermayer
75e88db330 huffyuvdec: Skip len==0 cases
Fixes vlc decoding for hypothetical files that would contain such cases.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0dfc01c2bb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Michael Niedermayer
6baa549249 huffyuvdec: Check init_vlc() return codes.
Prevents out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f67a0d1152)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Piotr Bandurski
22561bc0e9 aasc: fix 16bpp on big-endian
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Michael Niedermayer
8a4464514f Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
  Prepare for 9.2 Release
  lavr: call mix_function_init() in ff_audio_mix_set_matrix()
  rtpenc_chain: Use the original AVFormatContext for getting payload type
  rtp: Make sure the output format pointer is set

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:28:36 +01:00
Michael Niedermayer
85e94a30ee Merge commit '62de693a17f9b107be7867d822d5accacd4be544' into release/1.1
* commit '62de693a17f9b107be7867d822d5accacd4be544':
  rtp: Make sure priv_data is set before reading it
  videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
  get_bits: change the failure condition in init_get_bits
  mpegvideo: fix loop condition in draw_line()

Conflicts:
	libavcodec/get_bits.h
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:19:17 +01:00
Carl Eugen Hoyos
3445bec6fc Do not change codec in flv streams if the user has forced a codec.
Fixes ticket #2218.
(cherry picked from commit 6a50e8a190)
2013-02-01 23:37:48 +01:00
Matthieu Bouron
c8dace2728 ffmpeg: fix broken channel_layout option
Fixes ticket #2163.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5a67e30b1c)
2013-02-01 23:09:50 +01:00
Carl Eugen Hoyos
9bcb84810f doc/muxers.texi: Fix mp3 picture attachment documentation.
(cherry picked from commit 99eedfc400)
2013-02-01 17:57:12 +01:00
Peter Ross
54e19092fd wtvdec: demux thumbnail picture to AVStream.attached_pic
Fixes ticket #2133.

(cherry picked from commit 508836932f)
2013-01-30 09:49:59 +01:00
Martin Storsjö
3d67f52f9d arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
This makes the plain-armv6 version use the same registers as the
armv6t2 version above.

This fixes fate-vp8 on plain-armv6 devices.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2026eb1408)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-28 22:57:07 +02:00
Michael Niedermayer
bfd586577c movenc: check that fps for tmcd is within encodable range.
The fps is stored as a 8 bit value thus 255 is the maximum encodable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 55d66b2790)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:38 +01:00
Michael Niedermayer
5589549c1d movenc: Calculate fps for tmcd without intermediate step.
Fixes part of Ticket2045

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9362f31b55)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:37 +01:00
Michael Niedermayer
5c316acaa0 ffmpeg: copy tmcd track timebase parameters
Fixes part of Ticket2045

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bee044d7c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:36 +01:00
Michael Niedermayer
f4fb841ad1 sanm: check image dimensions before using them
Avoids integer overflows and out of array accesses.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 49b729d3af)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
c2d11275f7 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e692374f7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
b54c155f5b rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 902cfe2f74)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
ea2d44503f rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f014567cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Michael Niedermayer
59f7d583a3 mpeg1enc: Disable threads for resolutions too large for multi-threading
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0c6b0409af)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Clément Bœsch
fb876e4572 lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since 3af3a30.
Fixes Ticket2167.
(cherry picked from commit f2b6aabd3d)
2013-01-27 16:32:57 +01:00
Paul B Mahol
c2d2bf1d6b lavc/iff: ilbm: unbreak decoding on big endian
Fixes ticket #2192.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 25c75525bf)
2013-01-26 15:10:02 +01:00
Michael Karcher
302094e1d2 Fix atrac3 decoder broken in e55d53905f
Signed-off-by: Michael Karcher <ffmpeg@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dcbb920f15)
2013-01-26 03:36:18 +01:00
Reinhard Tartler
8d55c2441c Prepare for 9.2 Release 2013-01-24 12:02:57 +01:00
Justin Ruggles
d7e7e12abc lavr: call mix_function_init() in ff_audio_mix_set_matrix()
This is needed if a custom matrix is set by the user after opening the
AVAudioResampleContext because the matrix channel count can change if
different mixing coefficients are used.

CC:libav-stable@libav.org
(cherry picked from commit f07ef2d9c9)

Conflicts:

	libavresample/audio_mix.c
2013-01-24 12:00:08 +01:00
Martin Storsjö
a856623e87 rtpenc_chain: Use the original AVFormatContext for getting payload type
In ff_rtp_get_payload_type, the AVFormatContext is used for checking
whether the payload_type or rtpflags options are set. In rtpenc_chain,
the rtpctx struct is a newly initialized struct where no options have
been set yet, so no options can be fetched from there.

All muxers that internally chain rtp muxers have the "rtpflags" field
that allows passing such options on (which is how this worked before
8034130e06), so this works just as intended.

This makes it possible to produce H263 in RFC2190 format with chained
RTP muxers.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4a4a7e138c)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:58:09 +02:00
Martin Storsjö
348cd84fc8 rtp: Make sure the output format pointer is set
Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 932117171f)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:57:29 +02:00
Martin Storsjö
62de693a17 rtp: Make sure priv_data is set before reading it
This fixes crashes with muxing H263 into RTSP.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e90820d4f8)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:56:43 +02:00
Carl Eugen Hoyos
33769e908d matroskaenc: add codec_tag lists back.
This reverts 312645e :
"Do not set codec_tag property for matroska muxers."

Also adds dummy codec_tag lists with codecs
supported in mkv but not in wav / avi.

Fixes ticket #2169.
(cherry picked from commit df39c3ce38)
2013-01-24 02:30:40 +01:00
Janne Grunau
1a28948eb3 videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
libavutil/arm/asm.S sets '.arch' depending on HAVE_ARMV5TE so that
assembling armv5te code will always succeed even if the default -march
flag does not support it. HAVE_ARMV5TE_EXTERNAL tests assembling code
with the default arch.
Fixes the missing symbol ff_prefetch_arm with --cpu= not including
armv5te.

CC: libav-stable@libav.org
2013-01-22 13:43:16 +01:00
Luca Barbato
01050448cf get_bits: change the failure condition in init_get_bits
Too much code relies in having init_get_bits fed with a valid
buffer and set its dimension to 0.

Check for NULL buffer instead.
(cherry picked from commit 4603ec85ed)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-20 14:06:52 +01:00
Michael Niedermayer
edc00dea02 update for 1.1.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 01:11:06 +01:00
Xi Wang
8d0631c8fa mpegvideo: fix loop condition in draw_line()
The loop condition `x = ex' is incorrect.  It should be `x <= ex'.

This bug was introduced in commit c65dfac4 "mpegvideo.c: K&R formatting
and cosmetics."

CC:libav-stable@libav.org

(cherry picked from commit 992b031838)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-19 22:21:23 +01:00
Michael Niedermayer
1135928903 init_get_bits: fix off by 1 error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7980cca05c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:23 +01:00
Michael Niedermayer
6f3bc92c29 init_get_bits8: zero pointers & struct on error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 153fad14e5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:22 +01:00
Michael Niedermayer
bd531038e8 init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ac73d3a12a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:21 +01:00
Carl Eugen Hoyos
90da0cb60e The c99-to-c89 binaries are now hosted on videolan.org.
(cherry picked from commit c29c7c1470)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:20 +01:00
Michael Niedermayer
3049d5b9b3 doc/RELEASE_NOTES
mention changed sample_fmt for audio decoders

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:31:51 +01:00
Michael Niedermayer
43c6b45a53 avcodec_decode_audio: do not trust the channel layout, use the channel count.
Fixes memory corruption

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d270c32025)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:18:08 +01:00
Michael Niedermayer
68a0477bc0 error_concealment: Check that the picture is not in a half setup state.
Fixes state becoming inconsistent
Fixes a null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 23318a5735)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:18:01 +01:00
Paul B Mahol
ccf0cd967d 012v: remove double ; and return correct error code if ff_get_buffer() fails
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 2516023695)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:17:24 +01:00
Michael Niedermayer
002ad7cd39 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  fate: update ref after rv30_loop_filter fix
  rv30: fix masking in rv30_loop_filter()
  libcdio: support recent cdio-paranoia
  theora: Skip zero-sized headers
  h264: add 3 pixels below for subpixel filter wait position
  h264: fix ff_generate_sliding_window_mmcos() prototype.
  h264: don't clobber mmco opcode tables for non-first slice headers.

Conflicts:
	configure
	libavcodec/h264_refs.c
	tests/ref/fate/filter-delogo
	tests/ref/fate/rv30

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 15:54:36 +01:00
Jonas Bechtel
397fafad23 Fix opencv detection.
This commit changes the ".so" argument placement in check_ld sub-program.
(cherry picked from commit a003c5bd4f)
2013-01-18 10:32:49 +01:00
Michael Niedermayer
30f0cd2f1e h264: fix () placement
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c13e4e288c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
4d6d8d9ae9 rtmpproto: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a601eb9543)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
9348514a67 lavf/mux: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ac5a8d7e3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
17704500fb vsrc_testsrc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f88d2d786)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
2338eda8d8 tiff: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 659546b42d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
6a0633e961 svq1enc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 37be1d802f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
16dc41de27 ra144enc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e2704381e5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
ab471e17e4 nellymoserenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 795d2dc23b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
3be8aeb14e libvorbisenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bdd71abe5f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
b48e251360 libvo-aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0ccb31dcad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
65a4b90840 libspeexenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b8d66d531)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
59956a5957 libopencore-amr: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6180aa297)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
d4a08e560d libmp3lame: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 871b6ec01d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
dacac91973 libfdk-aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9302ad1ac8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
d39400fed7 libfaac: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68a25c64cd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
07174ed841 aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 98fed59427)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
e7475335b1 doc/examples: fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48a7981e6f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
722bfe4e7c swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d676598f87)
2013-01-18 05:14:30 +01:00
Michael Niedermayer
cc8ab98656 mpeg12enc: check dimension validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
d7cff9f8e8 mpeg12enc: Correctly mask dimensions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
9bfda9df71 mpeg12: Support decoding dimensions that are a multiple of 4096
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Luca Barbato
0a837b6317 fate: update ref after rv30_loop_filter fix
(cherry picked from commit 56ef1ef1f7)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 23:47:01 +01:00
Xi Wang
c3c1db7c56 rv30: fix masking in rv30_loop_filter()
The mask `x && (1 << y)' is incorrect and always yields true.

The correct form should be `x & (1 << y)'.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
(cherry picked from commit 783e37f7ef)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 22:00:01 +01:00
Luca Barbato
21ca4ab944 libcdio: support recent cdio-paranoia
Upstream decided to split the paranoia interface and move the headers
accordingly.
(cherry picked from commit 57224e425c567a87798b66425acc383c6dd37331)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 21:42:03 +01:00
Martin Storsjö
c749bec8c3 theora: Skip zero-sized headers
This fixes a regression since d9cf5f51/7a2ee770f5 with theora
over RTP (possibly with other variants of theora as well).

In theora over RTP, the second of the 3 headers turns out to be
0 bytes long, which prior to d9cf5f51 worked just fine. After
d9cf5f51, reading from the bitstream reader fails (since the reader
wasn't initialized but returned an error if initialized with 0 bits).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e33db35b4a)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-17 19:11:54 +02:00
Carl Eugen Hoyos
a95306e2d7 Only skip MLP header in mpeg files if the codec actually is MLP.
Fixes PCM audio in Kansas Pheasant Hunt 2000 mpg file.
Reported-by: Mashiat Sarker Shakkhar
(cherry picked from commit ad406f7e40)
2013-01-17 17:40:02 +01:00
Carl Eugen Hoyos
ed12d1ecad Fix compilation with --disable-everything.
(cherry picked from commit f023003ce6)
2013-01-17 17:39:00 +01:00
Michael Niedermayer
05ed9b7005 oggparsevorbis: fix vorbis_cleanup return type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 04:34:47 +01:00
Michael Niedermayer
76477c3843 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  libx264: use the library specific default rc_initial_buffer_occupancy
  lavc: set the default rc_initial_buffer_occupancy
  lavc: introduce the convenience function init_get_bits8
  lavc: check for overflow in init_get_bits
  APIchanges: Fill in missing hashes and dates; fix a version number typo.
  configure: enable pic for shared libs on AArch64
  zmbv: Reset the decoder on keyframe errors
  vc1dec: prevent a crash due missing pred_flag parameter
  matroska: Fix use after free
  vp3: Fix double free in vp3_decode_end()
  update Changelog
  oggdec: make sure the private parse data is cleaned up
  oggdec: free the ogg streams on read_header failure
  update Changelog
  x86: lavr: use the x86inc.asm automatic stack alignment in mixing functions
  Prepare 9.1 Release

Conflicts:
	Changelog
	RELEASE
	doc/APIchanges
	libavcodec/utils.c
	libavformat/oggdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 04:26:42 +01:00
Carl Eugen Hoyos
ccc4219558 Fix detection of struct v4l2_frmsize_discrete.
It was always detected successfully.
(cherry picked from commit c345100efc)
2013-01-17 02:13:40 +01:00
Ronald S. Bultje
9d60f608af h264: add 3 pixels below for subpixel filter wait position
If the motion vector is at a subpixel position, we need 3 pixels below
the motion vector's wholepel position available, not 2, since the MC
filter is a sixtap filter for the hpel position, and then a bilin filter
for the qpel position.

This patch fixes highly irreproducible (0.1%) fate failures in frame 2
and 4 of h264-conformance-cama2_vtc_b (e.g. first P-frame, first field,
last line of MB x=40,y=2 and second field and last lines of MBs x=39-40,
y=3). These used pre-loopfilter instead of post-loopfilter data because
the await_progress() waited for one line too little in that field, and
the motion vector of these particular MBs happened to align exactly to a
position where that demonstrates the bug.

CC: libav-stable@libav.org

(cherry picked from commit fb845ffdd3)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:20:10 +01:00
Anton Khirnov
6a4803a6a9 h264: fix ff_generate_sliding_window_mmcos() prototype.
It's been returning an error value since
bad446e251

Also check for the errors it returns.
(cherry picked from commit ea382767ad)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:19:42 +01:00
Ronald S. Bultje
c3b67720f9 h264: don't clobber mmco opcode tables for non-first slice headers.
Clobbering these tables will temporarily clobber the template used
as a basis for other threads to start decoding from. If the other
decoding thread updates from the template right at that moment,
subsequent threads will get invalid (or, usually, none at all) mmco
tables. This leads to invalid reference lists and subsequent decode
failures.

Therefore, instead, decode the mmco tables only for the first slice in
a field or frame. For other slices, decode the bits and ensure they
are identical to the mmco tables in the first slice, but don't ever
clobber the context state. This prevents other threads from using a
clobbered/invalid template as starting point for decoding, and thus
fixes decoding in these cases.

This fixes occasional (~1%) failures of h264-conformance-mr1_bt_a with
frame-multithreading enabled.

(cherry picked from commit bad446e251)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:19:07 +01:00
Michael Niedermayer
1c373456f6 oggdec: Leave treatment of serial changes to the decoder.
Attempting to re-parse the headers at demuxer level is a
pandora box the way its done currently.

This allows full reconfiguration of vorbis streams

Fixes Ticket2117
Fixes Ticket2121

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c994bb2fb7)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
9636266cbd vorbisdec: handle midstream parameter changes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e9ffee23f3)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
dc3349024a vorbisdec: support freeing partially allocated contexts.
Fixes null pointer derefernces

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 778069c832)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
66a3112100 oggdec: resync from the last page.
Previously we re synced from where we where which cam lead
to loosing pages.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c5cf58d4b9)
2013-01-15 21:12:03 +01:00
Luca Barbato
72eca26bf9 libx264: use the library specific default rc_initial_buffer_occupancy
By default libav sets it to 3/4 while x264 sets it to 9/10.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 47812070a2)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 09:12:46 +01:00
Luca Barbato
e44d56b18d lavc: set the default rc_initial_buffer_occupancy
rc_buffer_size is not set before.

Solve the initial the rate control underflow issue reported in
bug 222.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit bff3607547)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 09:12:41 +01:00
Luca Barbato
71e00caeab lavc: introduce the convenience function init_get_bits8
Accept the buffer size in bytes and check for overflow before passing
the value in bits to init_get_bits.
(cherry picked from commit e28ac6e5e2)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-14 05:22:22 +01:00
Luca Barbato
7a2ee770f5 lavc: check for overflow in init_get_bits
Fix an undefined behaviour and make the function return a proper
error in case of overflow.

CC: libav-stable@libav.org
(cherry picked from commit d9cf5f5169)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-14 05:21:57 +01:00
Diego Biurrun
fadebd256e APIchanges: Fill in missing hashes and dates; fix a version number typo. 2013-01-12 12:59:25 +01:00
André Pankratz
3dab6e5429 lavfi/yadif: fix shorthand/option mismatch
Fix trac ticket #2128.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 0287eea914)
2013-01-12 02:34:06 +01:00
Marcin Juszkiewicz
bc182a6aca configure: enable pic for shared libs on AArch64
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d11cb13b0e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 13:02:44 +01:00
Luca Barbato
fbde7b2d0a zmbv: Reset the decoder on keyframe errors
Prevent the crash on fuzzed files as reported in bug 63.
(cherry picked from commit c1d1ef4ecd)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 12:42:56 +01:00
Vladimir Pantelic
58baa367d6 vc1dec: prevent a crash due missing pred_flag parameter
Handle pred_flag parameter not given to get_mvdata_interlaced()

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 7b8c5b263b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 12:42:56 +01:00
Dale Curtis
ca2e3f1131 matroska: Fix use after free
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ae3d416369)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 02:17:19 +01:00
Ronald Bultje
ebd3aa429c vp3: Fix double free in vp3_decode_end()
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ec86ba5731)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 02:17:09 +01:00
Michael Niedermayer
ddb0317154 dirac: fix inverted check
Regression since: ea6da80
Fixes Ticket2123

I cannot reproduce any regressions by flipping the wrong condition
to how it should have been.

Thanks-to: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57bdd67646)
2013-01-09 09:48:49 +01:00
Clément Bœsch
606aa3baee lavf/mux: do not pass a copy of the packet to write_packet().
Sometimes the muxer modifies the packet, like for instance lavf/mp3enc
changing pkt->destruct in order to keep a copy. These changes must be
kept, even though the muxer behaviour is questionable. Regression since
0072116.

Fixes #2124.
(cherry picked from commit 119d70db50)
2013-01-08 23:26:49 +01:00
Carl Eugen Hoyos
36dac6da41 Add forgotten AVC Intra entry to Changelog.
(cherry picked from commit b23aff6755)
2013-01-08 23:26:36 +01:00
Paul B Mahol
9202824e1b Changelog: move Megalux where it belongs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e13c5abbd7)
2013-01-08 23:26:19 +01:00
Reinhard Tartler
0135dd73bb update Changelog 2013-01-07 11:14:31 +01:00
Luca Barbato
c01be297ce oggdec: make sure the private parse data is cleaned up
(cherry picked from commit d894f74762)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-07 09:00:09 +01:00
Luca Barbato
42bd6d9cf6 oggdec: free the ogg streams on read_header failure
Plug an annoying memory leak on broken files.
(cherry picked from commit 89b51b570d)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-07 09:00:04 +01:00
Michael Niedermayer
79013a59c0 update for 1.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-06 22:42:56 +01:00
Reinhard Tartler
c1555ae4b6 update Changelog 2013-01-06 18:05:04 +01:00
Justin Ruggles
a557005417 x86: lavr: use the x86inc.asm automatic stack alignment in mixing functions
CC:libav-stable@libav.org
(cherry picked from commit 95d01c3f1c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-06 15:46:12 +01:00
Reinhard Tartler
8069b44ebf Prepare 9.1 Release 2013-01-06 15:45:51 +01:00
1138 changed files with 24499 additions and 45717 deletions

2
.gitignore vendored
View File

@@ -37,7 +37,6 @@
/doc/examples/filtering_video
/doc/examples/metadata
/doc/examples/muxing
/doc/examples/pc-uninstalled
/doc/examples/resampling_audio
/doc/examples/scaling_video
/doc/fate.txt
@@ -67,4 +66,3 @@
/tools/probetest
/tools/qt-faststart
/tools/trasher
/tools/seek_print

59
CREDITS
View File

@@ -1,6 +1,55 @@
See the Git history of the project (git://source.ffmpeg.org/ffmpeg) to
get the names of people who have contributed to FFmpeg.
This file contains the names of some of the people who have contributed to
FFmpeg. The names are sorted alphabetically by last name. As this file is
currently quite outdated and git serves as a much better tool for determining
authorship, it remains here for historical reasons only.
To check the log, you can type the command "git log" in the FFmpeg
source directory, or browse the online repository at
http://source.ffmpeg.org.
Dénes Balatoni
Michel Bardiaux
Fabrice Bellard
Patrice Bensoussan
Alex Beregszaszi
BERO
Thilo Borgmann
Mario Brito
Ronald Bultje
Alex Converse
Maarten Daniels
Reimar Doeffinger
Tim Ferguson
Brian Foley
Arpad Gereoffy
Philip Gladstone
Vladimir Gneushev
Roine Gustafsson
David Hammerton
Wolfgang Hesseler
Marc Hoffman
Falk Hueffner
Aurélien Jacobs
Steven Johnson
Zdenek Kabelac
Robin Kay
Todd Kirby
Nick Kurshev
Benjamin Larsson
Loïc Le Loarer
Daniel Maas
Mike Melanson
Loren Merritt
Jeff Muizelaar
Michael Niedermayer
François Revol
Peter Ross
Måns Rullgård
Stefano Sabatini
Roman Shaposhnik
Oded Shimon
Dieter Shirley
Konstantin Shishkov
Juan J. Sierralta
Ewald Snel
Sascha Sommer
Leon van Stuivenberg
Roberto Togni
Lionel Ulmer
Reynaldo Verdejo

View File

@@ -1,37 +1,10 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 1.2.8:
- proresenc_ks: fix buffer overflow
- iff: fix crash
- cdgraphics: fix infinite loop
- Fix Ticket3804
- Fix Ticket3208
version 1.2:
- VDPAU hardware acceleration through normal hwaccel
- SRTP support
- Error diffusion dither in Swscale
- Chained Ogg support
- Theora Midstream reconfiguration support
- EVRC decoder
- audio fade filter
- filtering audio with unknown channel layout
- allpass, bass, bandpass, bandreject, biquad, equalizer, highpass, lowpass
and treble audio filter
- improved showspectrum filter, with multichannel support and sox-like colors
- histogram filter
- tee muxer
- il filter ported from libmpcodecs
- support ID3v2 tags in ASF files
- encrypted TTA stream decoding support
- RF64 support in WAV muxer
- noise filter ported from libmpcodecs
- Subtitles character encoding conversion
- blend filter
- stereo3d filter ported from libmpcodecs
version <next>:
- Fix a crash on windows platforms related to automatic stack alignment
in libavresample
- Fix memleaks in the ogg demuxer. Related to CVE-2012-2882
version 1.1:

12
LICENSE
View File

@@ -36,20 +36,13 @@ Specifically, the GPL parts of FFmpeg are
- vf_hue.c
- vf_kerndeint.c
- vf_mp.c
- vf_noise.c
- vf_pp.c
- vf_smartblur.c
- vf_stereo3d.c
- vf_super2xsai.c
- vf_tinterlace.c
- vf_yadif.c
- vsrc_mptestsrc.c
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
the configure parameter --enable-version3 will activate this licensing option
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
There are a handful of files under other licensing terms, namely:
* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
@@ -59,6 +52,11 @@ There are a handful of files under other licensing terms, namely:
You must also indicate any changes including additions and deletions to
those three files in the documentation.
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
the configure parameter --enable-version3 will activate this licensing option
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
external libraries
==================

View File

@@ -445,9 +445,9 @@ x86 Michael Niedermayer
Releases
========
1.2 Michael Niedermayer
1.1 Michael Niedermayer
1.0 Michael Niedermayer
0.11 Michael Niedermayer

View File

@@ -1 +1 @@
1.2.11
1.1.3

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.1.3

View File

@@ -62,10 +62,10 @@
static int init_report(const char *env);
struct SwsContext *sws_opts;
AVDictionary *swr_opts;
AVDictionary *format_opts, *codec_opts, *resample_opts;
SwrContext *swr_opts;
AVDictionary *format_opts, *codec_opts;
const int this_year = 2014;
const int this_year = 2013;
static FILE *report_file;
@@ -75,6 +75,9 @@ void init_opts(void)
if(CONFIG_SWSCALE)
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
NULL, NULL, NULL);
if(CONFIG_SWRESAMPLE)
swr_opts = swr_alloc();
}
void uninit_opts(void)
@@ -84,10 +87,11 @@ void uninit_opts(void)
sws_opts = NULL;
#endif
av_dict_free(&swr_opts);
if(CONFIG_SWRESAMPLE)
swr_free(&swr_opts);
av_dict_free(&format_opts);
av_dict_free(&codec_opts);
av_dict_free(&resample_opts);
}
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
@@ -474,9 +478,6 @@ int opt_default(void *optctx, const char *opt, const char *arg)
char opt_stripped[128];
const char *p;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
#if CONFIG_AVRESAMPLE
const AVClass *rc = avresample_get_class();
#endif
const AVClass *sc, *swr_class;
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
@@ -515,23 +516,13 @@ int opt_default(void *optctx, const char *opt, const char *arg)
#endif
#if CONFIG_SWRESAMPLE
swr_class = swr_get_class();
if (!consumed && (o=av_opt_find(&swr_class, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
struct SwrContext *swr = swr_alloc();
int ret = av_opt_set(swr, opt, arg, 0);
swr_free(&swr);
if (!consumed && av_opt_find(&swr_class, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
int ret = av_opt_set(swr_opts, opt, arg, 0);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret;
}
av_dict_set(&swr_opts, opt, arg, FLAGS);
consumed = 1;
}
#endif
#if CONFIG_AVRESAMPLE
if ((o=av_opt_find(&rc, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
av_dict_set(&resample_opts, opt, arg, FLAGS);
consumed = 1;
}
#endif
@@ -584,11 +575,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
g->swr_opts = swr_opts;
g->codec_opts = codec_opts;
g->format_opts = format_opts;
g->resample_opts = resample_opts;
codec_opts = NULL;
format_opts = NULL;
resample_opts = NULL;
#if CONFIG_SWSCALE
sws_opts = NULL;
#endif
@@ -646,11 +635,11 @@ void uninit_parse_context(OptionParseContext *octx)
av_freep(&l->groups[j].opts);
av_dict_free(&l->groups[j].codec_opts);
av_dict_free(&l->groups[j].format_opts);
av_dict_free(&l->groups[j].resample_opts);
#if CONFIG_SWSCALE
sws_freeContext(l->groups[j].sws_opts);
#endif
av_dict_free(&l->groups[j].swr_opts);
if(CONFIG_SWRESAMPLE)
swr_free(&l->groups[j].swr_opts);
}
av_freep(&l->groups);
}
@@ -667,7 +656,6 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
const OptionGroupDef *groups, int nb_groups)
{
int optindex = 1;
int dashdash = -2;
/* perform system-dependent conversions for arguments list */
prepare_app_arguments(&argc, &argv);
@@ -682,12 +670,8 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
dashdash = optindex;
continue;
}
/* unnamed group separators, e.g. output filename */
if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
if (opt[0] != '-' || !opt[1]) {
finish_group(octx, 0, opt);
av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
continue;
@@ -759,7 +743,7 @@ do { \
return AVERROR_OPTION_NOT_FOUND;
}
if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
if (octx->cur_group.nb_opts || codec_opts || format_opts)
av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
"commandline.\n");
@@ -1628,7 +1612,7 @@ int show_help(void *optctx, const char *opt, const char *arg)
int read_yesno(void)
{
int c = getchar();
int yesno = (av_toupper(c) == 'Y');
int yesno = (toupper(c) == 'Y');
while (c != '\n' && c != EOF)
c = getchar();
@@ -1749,8 +1733,10 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
if (!codec)
codec = s->oformat ? avcodec_find_encoder(codec_id)
: avcodec_find_decoder(codec_id);
if (!codec)
return NULL;
switch (st->codec->codec_type) {
switch (codec->type) {
case AVMEDIA_TYPE_VIDEO:
prefix = 'v';
flags |= AV_OPT_FLAG_VIDEO_PARAM;
@@ -1862,6 +1848,12 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
av_log(s, AV_LOG_ERROR, "alloc_buffer: av_image_alloc() failed\n");
return ret;
}
/* XXX this shouldn't be needed, but some tests break without this line
* those decoders are buggy and need to be fixed.
* the following tests fail:
* cdgraphics, ansi
*/
memset(buf->base[0], 128, ret);
avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {

View File

@@ -51,8 +51,8 @@ extern const int this_year;
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts;
extern struct SwsContext *sws_opts;
extern AVDictionary *swr_opts;
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
extern struct SwrContext *swr_opts;
extern AVDictionary *format_opts, *codec_opts;
/**
* Initialize the cmdutils option system, in particular
@@ -123,7 +123,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
* not zero timestr is interpreted as a duration, otherwise as a
* date
*
* @see av_parse_time()
* @see parse_date()
*/
int64_t parse_time_or_die(const char *context, const char *timestr,
int is_duration);
@@ -190,13 +190,13 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
void show_help_children(const AVClass *class, int flags);
/**
* Per-fftool specific help handler. Implemented in each
* fftool, called by show_help().
* Per-avtool specific help handler. Implemented in each
* avtool, called by show_help().
*/
void show_help_default(const char *opt, const char *arg);
/**
* Generic -h handler common to all fftools.
* Generic -h handler common to all avtools.
*/
int show_help(void *optctx, const char *opt, const char *arg);
@@ -253,9 +253,8 @@ typedef struct OptionGroup {
AVDictionary *codec_opts;
AVDictionary *format_opts;
AVDictionary *resample_opts;
struct SwsContext *sws_opts;
AVDictionary *swr_opts;
struct SwrContext *swr_opts;
} OptionGroup;
/**

View File

@@ -32,7 +32,7 @@ ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
define COMPILE
@@ -117,12 +117,12 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
$(OBJS): | $(sort $(dir $(OBJS)))
$(HOBJS): | $(sort $(dir $(HOBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
$(HOBJS): | $(sort $(dir $(HOBJS)))
$(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS) $(HOBJS))
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
DISTCLEANSUFFIXES = *.pc

View File

@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
@@ -48,7 +49,7 @@ double avpriv_strtod(const char *nptr, char **endptr)
double res;
/* Skip leading spaces */
while (av_isspace(*nptr))
while (isspace(*nptr))
nptr++;
if (!av_strncasecmp(nptr, "infinity", 8)) {

465
configure vendored
View File

@@ -130,6 +130,7 @@ Component options:
--disable-pthreads disable pthreads [auto]
--disable-w32threads disable Win32 threads [auto]
--disable-os2threads disable OS/2 threads [auto]
--enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no]
--disable-dct disable DCT code
--disable-dwt disable DWT code
@@ -138,12 +139,10 @@ Component options:
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--disable-fft disable FFT code
Hardware accelerators:
--disable-dxva2 disable DXVA2 code [autodetect]
--disable-vaapi disable VAAPI code [autodetect]
--enable-vda enable VDA code
--disable-vdpau disable VDPAU code [autodetect]
--enable-dxva2 enable DXVA2 code
--enable-vaapi enable VAAPI code [autodetect]
--enable-vda enable VDA code [autodetect]
--enable-vdpau enable VDPAU code [autodetect]
Individual component options:
--disable-everything disable all components listed below
@@ -184,11 +183,10 @@ Individual component options:
External library support:
--enable-avisynth enable reading of AVISynth script files [no]
--disable-bzlib disable bzlib [autodetect]
--enable-bzlib enable bzlib [autodetect]
--enable-fontconfig enable fontconfig
--enable-frei0r enable frei0r video filtering
--enable-gnutls enable gnutls [no]
--disable-iconv disable iconv [autodetect]
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
--enable-libass enable libass subtitles rendering [no]
--enable-libbluray enable BluRay reading using libbluray [no]
@@ -227,15 +225,14 @@ External library support:
--enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
--enable-libvorbis enable Vorbis en/decoding via libvorbis,
native implementation exists [no]
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
--enable-libvpx enable VP8 de/encoding via libvpx [no]
--enable-libx264 enable H.264 encoding via x264 [no]
--enable-libxavs enable AVS encoding via xavs [no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-openssl enable openssl [no]
--enable-x11grab enable X11 grabbing [no]
--disable-zlib disable zlib [autodetect]
--enable-zlib enable zlib [autodetect]
Advanced options (experts only):
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
@@ -256,7 +253,6 @@ Advanced options (experts only):
--ld=LD use linker LD [$ld_default]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
--host-ld=HOSTLD use host linker HOSTLD
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
@@ -456,18 +452,14 @@ set_weak(){
done
}
sanitize_var_name(){
echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
}
set_safe(){
var=$1
shift
eval $(sanitize_var_name "$var")='$*'
eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
}
get_safe(){
eval echo \$$(sanitize_var_name "$1")
eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
}
pushvar(){
@@ -705,10 +697,6 @@ add_extralibs(){
prepend extralibs $($ldflags_filter "$@")
}
add_host_cppflags(){
append host_cppflags "$@"
}
add_host_cflags(){
append host_cflags $($host_cflags_filter "$@")
}
@@ -1024,7 +1012,7 @@ check_type(){
}
check_struct(){
log check_struct "$@"
log check_type "$@"
headers=$1
struct=$2
member=$3
@@ -1034,16 +1022,6 @@ check_struct(){
enable_safe "${struct}_${member}"
}
check_builtin(){
log check_builtin "$@"
name=$1
headers=$2
builtin=$3
shift 3
disable "$name"
check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
}
require(){
name="$1"
header="$2"
@@ -1075,26 +1053,6 @@ require_pkg_config(){
add_extralibs $(get_safe ${pkg}_libs)
}
require_libfreetype(){
log require_libfreetype "$@"
pkg="freetype2"
check_cmd $pkg_config --exists --print-errors $pkg \
|| die "ERROR: $pkg not found"
pkg_cflags=$($pkg_config --cflags $pkg)
pkg_libs=$($pkg_config --libs $pkg)
{
echo "#include <ft2build.h>"
echo "#include FT_FREETYPE_H"
echo "long check_func(void) { return (long) FT_Init_FreeType; }"
echo "int main(void) { return 0; }"
} | check_ld "cc" $pkg_cflags $pkg_libs \
&& set_safe ${pkg}_cflags $pkg_cflags \
&& set_safe ${pkg}_libs $pkg_libs \
|| die "ERROR: $pkg not found"
add_cflags $(get_safe ${pkg}_cflags)
add_extralibs $(get_safe ${pkg}_libs)
}
hostcc_o(){
eval printf '%s\\n' $HOSTCC_O
}
@@ -1106,13 +1064,6 @@ check_host_cc(){
check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
}
check_host_cppflags(){
log check_host_cppflags "$@"
check_host_cc "$@" <<EOF && append host_cppflags "$@"
int x;
EOF
}
check_host_cflags(){
log check_host_cflags "$@"
set -- $($host_cflags_filter "$@")
@@ -1150,14 +1101,54 @@ COMPONENT_LIST="
protocols
"
EXTERNAL_LIBRARY_LIST="
DOCUMENT_LIST="
doc
htmlpages
manpages
podpages
txtpages
"
LIBRARY_LIST="
avcodec
avdevice
avfilter
avformat
avresample
avutil
postproc
swresample
swscale
"
PROGRAM_LIST="
ffplay
ffprobe
ffserver
ffmpeg
"
CONFIG_LIST="
$COMPONENT_LIST
$DOCUMENT_LIST
$LIBRARY_LIST
$PROGRAM_LIST
avisynth
bzlib
crystalhd
dct
dwt
dxva2
fast_unaligned
fft
fontconfig
frei0r
ftrapv
gnutls
iconv
gpl
gray
hardcoded_tables
incompatible_fork_abi
libaacplus
libass
libbluray
@@ -1197,62 +1188,6 @@ EXTERNAL_LIBRARY_LIST="
libx264
libxavs
libxvid
openal
openssl
x11grab
zlib
"
DOCUMENT_LIST="
doc
htmlpages
manpages
podpages
txtpages
"
HWACCEL_LIST="
dxva2
vaapi
vda
vdpau
"
LIBRARY_LIST="
avcodec
avdevice
avfilter
avformat
avresample
avutil
postproc
swresample
swscale
"
PROGRAM_LIST="
ffplay
ffprobe
ffserver
ffmpeg
"
CONFIG_LIST="
$COMPONENT_LIST
$DOCUMENT_LIST
$EXTERNAL_LIBRARY_LIST
$HWACCEL_LIST
$LIBRARY_LIST
$PROGRAM_LIST
dct
dwt
fast_unaligned
fft
ftrapv
gpl
gray
hardcoded_tables
incompatible_fork_abi
lsp
lzo
mdct
@@ -1260,6 +1195,8 @@ CONFIG_LIST="
memory_poisoning
network
nonfree
openal
openssl
pic
rdft
runtime_cpudetect
@@ -1270,8 +1207,13 @@ CONFIG_LIST="
static
swscale_alpha
thumb
vaapi
vda
vdpau
version3
xmm_clobber_test
x11grab
zlib
"
THREADS_LIST='
@@ -1358,7 +1300,6 @@ HAVE_LIST_PUB='
MATH_FUNCS="
atanf
atan2f
cbrt
cbrtf
cosf
exp2
@@ -1440,7 +1381,6 @@ HAVE_LIST="
gettimeofday
glob
gnu_as
gsm_h
ibm_asm
inet_aton
io_h
@@ -1620,7 +1560,6 @@ CMDLINE_SET="
CMDLINE_APPEND="
extra_cflags
extra_cxxflags
host_cppflags
"
# code dependency declarations
@@ -1690,7 +1629,7 @@ mdct_select="fft"
rdft_select="fft"
mpegaudio_select="mpegaudiodsp"
mpegaudiodsp_select="dct"
mpegvideo_select="error_resilience videodsp h264chroma"
mpegvideo_select="videodsp"
mpegvideoenc_select="mpegvideo"
# decoders / encoders
@@ -1708,13 +1647,13 @@ atrac1_decoder_select="mdct sinewin"
atrac3_decoder_select="mdct"
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
binkaudio_rdft_decoder_select="mdct rdft sinewin"
cavs_decoder_select="golomb h264chroma mpegvideo"
cavs_decoder_select="golomb mpegvideo"
comfortnoise_encoder_select="lpc"
cook_decoder_select="mdct sinewin"
cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
dca_decoder_select="mdct"
dirac_decoder_select="dwt golomb videodsp"
dirac_decoder_select="dwt golomb"
dnxhd_encoder_select="aandcttables mpegvideoenc"
dxa_decoder_select="zlib"
eac3_decoder_select="ac3_decoder"
@@ -1741,7 +1680,7 @@ h263_decoder_select="error_resilience h263_parser mpegvideo"
h263_encoder_select="aandcttables error_resilience mpegvideoenc"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
huffyuv_encoder_select="huffman"
iac_decoder_select="fft mdct sinewin"
imc_decoder_select="fft mdct sinewin"
@@ -1796,8 +1735,8 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dwt h264qpel rangecoder"
snow_encoder_select="aandcttables dwt h264qpel error_resilience mpegvideoenc rangecoder"
snow_decoder_select="dwt rangecoder"
snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
@@ -1817,8 +1756,8 @@ vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="mdct"
vp3_decoder_select="vp3dsp videodsp"
vp5_decoder_select="h264chroma vp3dsp videodsp"
vp6_decoder_select="h264chroma huffman vp3dsp videodsp"
vp5_decoder_select="vp3dsp videodsp"
vp6_decoder_select="huffman vp3dsp videodsp"
vp6a_decoder_select="vp6_decoder"
vp6f_decoder_select="vp6_decoder"
vp8_decoder_select="h264pred videodsp"
@@ -1842,67 +1781,43 @@ zmbv_encoder_select="zlib"
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
dxva2_deps="dxva2api_h"
vaapi_deps="va_va_h"
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
h263_vaapi_hwaccel_deps="vaapi"
h263_vaapi_hwaccel_select="h263_decoder"
h263_vdpau_hwaccel_deps="vdpau"
h263_vdpau_hwaccel_select="h263_decoder"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_dxva2_hwaccel_deps="dxva2"
h264_dxva2_hwaccel_select="h264_decoder"
h264_vaapi_hwaccel_deps="vaapi"
h264_vaapi_hwaccel_select="h264_decoder"
h264_vda_decoder_deps="vda"
h264_vda_decoder_select="h264_decoder"
h264_vda_hwaccel_deps="vda"
h264_vda_hwaccel_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
h264_vdpau_hwaccel_select="h264_decoder"
mpeg_vdpau_decoder_deps="vdpau"
mpeg_vdpau_decoder_select="mpegvideo_decoder"
mpeg1_vdpau_decoder_deps="vdpau"
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
mpeg1_vdpau_hwaccel_deps="vdpau"
mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
h264_dxva2_hwaccel_deps="dxva2api_h"
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
h264_vaapi_hwaccel_select="vaapi h264_decoder"
h264_vda_decoder_select="vda h264_parser h264_decoder"
h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
h264_vda_hwaccel_select="vda h264_decoder"
h264_vdpau_decoder_select="vdpau h264_decoder"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_dxva2_hwaccel_deps="dxva2"
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
mpeg2_vaapi_hwaccel_deps="vaapi"
mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
mpeg2_vdpau_hwaccel_deps="vdpau"
mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_vaapi_hwaccel_deps="vaapi"
mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
mpeg4_vdpau_decoder_deps="vdpau"
mpeg4_vdpau_decoder_select="mpeg4_decoder"
mpeg4_vdpau_hwaccel_deps="vdpau"
mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_crystalhd_decoder_select="crystalhd"
vc1_dxva2_hwaccel_deps="dxva2"
vc1_dxva2_hwaccel_select="vc1_decoder"
vc1_vaapi_hwaccel_deps="vaapi"
vc1_vaapi_hwaccel_select="vc1_decoder"
vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder"
vc1_vdpau_hwaccel_deps="vdpau"
vc1_vdpau_hwaccel_select="vc1_decoder"
vc1_dxva2_hwaccel_deps="dxva2api_h"
vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
vc1_vdpau_decoder_select="vdpau vc1_decoder"
wmv3_crystalhd_decoder_select="crystalhd"
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# parsers
h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
mpeg4video_parser_select="error_resilience mpegvideo"
mpegvideo_parser_select="error_resilience mpegvideo"
vc1_parser_select="error_resilience mpegvideo"
@@ -1946,10 +1861,8 @@ libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
libvorbis_decoder_deps="libvorbis"
libvorbis_encoder_deps="libvorbis"
libvorbis_encoder_select="audio_frame_queue"
libvpx_vp8_decoder_deps="libvpx"
libvpx_vp8_encoder_deps="libvpx"
libvpx_vp9_decoder_deps="libvpx"
libvpx_vp9_encoder_deps="libvpx"
libvpx_decoder_deps="libvpx"
libvpx_encoder_deps="libvpx"
libx264_encoder_deps="libx264"
libx264rgb_encoder_deps="libx264"
libxavs_encoder_deps="libxavs"
@@ -2056,7 +1969,6 @@ rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
rtp_protocol_select="udp_protocol"
sctp_protocol_deps="struct_sctp_event_subscribe"
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol"
tcp_protocol_select="network"
tls_protocol_deps_any="openssl gnutls"
tls_protocol_select="tcp_protocol"
@@ -2092,7 +2004,6 @@ movie_filter_deps="avcodec avformat"
mp_filter_deps="gpl avcodec swscale inline_asm"
mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
noise_filter_deps="gpl"
resample_filter_deps="avresample"
ocv_filter_deps="libopencv"
pan_filter_deps="swresample"
@@ -2101,7 +2012,6 @@ removelogo_filter_deps="avcodec avformat swscale"
scale_filter_deps="swscale"
smartblur_filter_deps="gpl swscale"
showspectrum_filter_deps="avcodec rdft"
stereo3d_filter_deps="gpl"
subtitles_filter_deps="avformat avcodec libass"
super2xsai_filter_deps="gpl"
tinterlace_filter_deps="gpl"
@@ -2156,7 +2066,7 @@ cxx_default="g++"
host_cc_default="gcc"
cp_f="cp -f"
install="install"
ln_s="ln -s -f"
ln_s="ln -sf"
nm_default="nm -g"
objformat="elf"
pkg_config_default=pkg-config
@@ -2189,9 +2099,6 @@ enable safe_bitstream_reader
enable static
enable swscale_alpha
# Enable hwaccels by default.
enable dxva2 vaapi vdpau
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
FFSERVERLDFLAGS=-Wl,-E
@@ -2226,8 +2133,7 @@ HOSTCC_C='-c'
HOSTCC_O='-o $@'
HOSTLD_O='-o $@'
host_cflags='-O3 -g'
host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600'
host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
host_libs='-lm'
host_cflags_filter=echo
host_ldflags_filter=echo
@@ -2304,14 +2210,10 @@ die_unknown(){
exit 1
}
print_3_columns() {
cat | tr ' ' '\n' | sort | pr -r -3 -t
}
show_list() {
suffix=_$1
shift
echo $* | sed s/$suffix//g | print_3_columns
echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
exit 0
}
@@ -2599,8 +2501,7 @@ suncc_flags(){
core2) echo -xarch=ssse3 -xchip=core2 ;;
corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
amdfam10|barcelona) echo -xtarget=barcelona ;;
bdver*) echo -xarch=avx ;;
amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
echo -xarch=sse2a ;;
@@ -2611,8 +2512,7 @@ suncc_flags(){
-fomit-frame-pointer) echo -xregs=frameptr ;;
-fPIC) echo -KPIC -xcode=pic32 ;;
-W*,*) echo $flag ;;
-f*-*|-W*|-mimpure-text) ;;
-shared) echo -G ;;
-f*-*|-W*) ;;
*) echo $flag ;;
esac
done
@@ -2656,9 +2556,7 @@ probe_cc(){
unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo
if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
true # no-op to avoid reading stdin in following checks
elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
_type=llvm_gcc
gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
_ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
@@ -2677,7 +2575,7 @@ probe_cc(){
fi
_cflags_speed='-O3'
_cflags_size='-Os'
elif $_cc --version 2>/dev/null | grep -q ^icc; then
elif $_cc --version 2>/dev/null | grep -q Intel; then
_type=icc
_ident=$($_cc --version | head -n1)
_depflags='-MMD'
@@ -3252,9 +3150,15 @@ case $target_os in
enabled gcc || check_ldflags -Wl,-zmuldefs
;;
openbsd|bitrig)
# On OpenBSD 4.5. the compiler does not use PIC unless
# explicitly using -fPIC. FFmpeg builds fine without PIC,
# however the generated executable will not do anything
# (simply quits with exit-code 1, no crash, no output).
# Thus explicitly enable PIC here.
enable pic
disable symver
SHFLAGS='-shared'
SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
SLIB_INSTALL_LINKS=
oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio"
@@ -3318,6 +3222,7 @@ case $target_os in
objformat="win32"
ranlib=:
enable dos_paths
add_cppflags -U__STRICT_ANSI__
;;
win32|win64)
if enabled shared; then
@@ -3432,6 +3337,7 @@ case $target_os in
network_extralibs='-lbsd'
exeobjs=compat/plan9/main.o
disable ffserver
ln_s='ln -s -f'
cp_f='cp'
;;
none)
@@ -3443,29 +3349,26 @@ esac
# determine libc flavour
# uclibc defines __GLIBC__, so it needs to be checked before glibc.
if check_cpp_condition features.h "defined __UCLIBC__"; then
libc_type=uclibc
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
elif check_cpp_condition features.h "defined __GLIBC__"; then
libc_type=glibc
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
# MinGW headers can be installed on Cygwin, so check for newlib first.
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib
add_cppflags -U__STRICT_ANSI__
elif check_header _mingw.h; then
libc_type=mingw
check_cpp_condition _mingw.h \
"defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
die "ERROR: MinGW runtime version must be >= 3.15."
add_cppflags -U__STRICT_ANSI__
if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \
__MINGW64_VERSION_MAJOR < 3"; then
add_compat msvcrt/snprintf.o
add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
fi
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib
add_cppflags -U__STRICT_ANSI__
elif check_func_headers stdlib.h _get_doserrno; then
libc_type=msvcrt
add_compat strtod.o strtod=avpriv_strtod
@@ -3680,8 +3583,9 @@ elif enabled sparc; then
elif enabled x86; then
check_builtin rdtsc intrin.h "__rdtsc()"
check_builtin mm_empty mmintrin.h "_mm_empty()"
check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
enable local_aligned_8 local_aligned_16
@@ -3750,7 +3654,6 @@ EOF
fi
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if check_func dlopen; then
ldl=
@@ -3854,7 +3757,6 @@ check_header termios.h
check_header unistd.h
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header VideoDecodeAcceleration/VDADecoder.h
check_header windows.h
check_header X11/extensions/XvMClib.h
check_header asm/types.h
@@ -3862,6 +3764,14 @@ check_header asm/types.h
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
# check for VDA header
if ! disabled vda && ! enabled ppc; then
if check_header VideoDecodeAcceleration/VDADecoder.h; then
enable vda
add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
fi
fi
if ! disabled w32threads && ! enabled pthreads; then
check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
fi
@@ -3899,6 +3809,7 @@ fi
check_lib math.h sin -lm && LIBM="-lm"
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
enabled vaapi && require vaapi va/va.h vaInitialize -lva
atan2f_args=2
ldexpf_args=2
@@ -3916,7 +3827,7 @@ enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_in
enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
@@ -3925,10 +3836,8 @@ enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaa
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
enabled libfreetype && require_libfreetype
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
done || die "ERROR: libgsm not found"; }
enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
@@ -3958,12 +3867,10 @@ enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -l
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
enabled libvpx && {
enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
die "ERROR: libvpx decoder version must be >=0.9.1"; }
enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
die "ERROR: libvpx encoder version must be >=0.9.7"; }
enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
die "ERROR: libvpx decoder must be installed and version must be >=0.9.1"; }
enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
die "ERROR: libvpx encoder version must be >=0.9.7"; } }
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
die "ERROR: libx264 must be installed and version must be >= 0.118."; }
@@ -4066,16 +3973,17 @@ require X11 X11/Xlib.h XOpenDisplay -lX11 &&
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
enabled vaapi &&
check_lib va/va.h vaInitialize -lva ||
disable vaapi
if ! disabled vaapi; then
check_lib va/va.h vaInitialize -lva && {
check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
} || disable vaapi
fi
enabled vdpau &&
if ! disabled vdpau && enabled vdpau_vdpau_h; then
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
disable vdpau
# Funny iconv installations are not unusual, so check it after all flags have been set
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
{ echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && disable vdpau; }
fi
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
@@ -4166,16 +4074,17 @@ if enabled icc; then
check_cflags -w1
# -wd: Disable following warnings
# 144, 167, 556: -Wno-pointer-sign
# 188: enumerated type mixed with another type
# 1292: attribute "foo" ignored
# 1419: external declaration in primary source file
# 10006: ignoring unknown option -fno-signed-zeros
# 10148: ignoring unknown option -Wno-parentheses
# 10156: ignoring option '-W'; no argument required
check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156
check_cflags -wd144,167,556,1292,1419,10006,10148,10156
# 11030: Warning unknown option --as-needed
# 10156: ignoring option '-export'; no argument required
check_ldflags -wd10156,11030
# Allow to compile with optimizations
check_ldflags -march=$cpu
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
enable ebp_available
if enabled x86_32; then
@@ -4338,6 +4247,52 @@ echo "network support ${network-no}"
echo "threading support ${thread_type-no}"
echo "safe bitstream reader ${safe_bitstream_reader-no}"
echo "SDL support ${sdl-no}"
echo "libdxva2 enabled ${dxva2-no}"
echo "libva enabled ${vaapi-no}"
echo "libvdpau enabled ${vdpau-no}"
echo "AVISynth enabled ${avisynth-no}"
echo "frei0r enabled ${frei0r-no}"
echo "gnutls enabled ${gnutls-no}"
echo "libaacplus enabled ${libaacplus-no}"
echo "libass enabled ${libass-no}"
echo "libcaca enabled ${libcaca-no}"
echo "libcdio support ${libcdio-no}"
echo "libcelt enabled ${libcelt-no}"
echo "libdc1394 support ${libdc1394-no}"
echo "libfaac enabled ${libfaac-no}"
echo "libfdk-aac enabled ${libfdk_aac-no}"
echo "libgsm enabled ${libgsm-no}"
echo "libiec61883 support ${libiec61883-no}"
echo "libilbc enabled ${libilbc-no}"
echo "libmodplug enabled ${libmodplug-no}"
echo "libmp3lame enabled ${libmp3lame-no}"
echo "libnut enabled ${libnut-no}"
echo "libopencore-amrnb support ${libopencore_amrnb-no}"
echo "libopencore-amrwb support ${libopencore_amrwb-no}"
echo "libopencv support ${libopencv-no}"
echo "libopenjpeg enabled ${libopenjpeg-no}"
echo "libopus enabled ${libopus-no}"
echo "libpulse enabled ${libpulse-no}"
echo "librtmp enabled ${librtmp-no}"
echo "libschroedinger enabled ${libschroedinger-no}"
echo "libsoxr enabled ${libsoxr-no}"
echo "libspeex enabled ${libspeex-no}"
echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
echo "libtheora enabled ${libtheora-no}"
echo "libtwolame enabled ${libtwolame-no}"
echo "libutvideo enabled ${libutvideo-no}"
echo "libv4l2 enabled ${libv4l2-no}"
echo "libvo-aacenc support ${libvo_aacenc-no}"
echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
echo "libvorbis enabled ${libvorbis-no}"
echo "libvpx enabled ${libvpx-no}"
echo "libx264 enabled ${libx264-no}"
echo "libxavs enabled ${libxavs-no}"
echo "libxvid enabled ${libxvid-no}"
echo "openal enabled ${openal-no}"
echo "openssl enabled ${openssl-no}"
echo "zlib enabled ${zlib-no}"
echo "bzlib enabled ${bzlib-no}"
echo "texi2html enabled ${texi2html-no}"
echo "perl enabled ${perl-no}"
echo "pod2man enabled ${pod2man-no}"
@@ -4346,14 +4301,10 @@ test -n "$random_seed" &&
echo "random seed ${random_seed}"
echo
echo "External libraries:"
print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
echo
for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
echo "Enabled ${type}s:"
eval list=\$$(toupper $type)_LIST
print_enabled '_*' $list | print_3_columns
print_enabled '_*' $list | sort | pr -r -3 -t
echo
done
@@ -4430,7 +4381,7 @@ LD_PATH=$LD_PATH
DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
LDFLAGS-ffserver=$FFSERVERLDFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
SHFLAGS=$SHFLAGS
YASMFLAGS=$YASMFLAGS
BUILDSUF=$build_suffix
PROGSSUF=$progs_suffix
@@ -4452,7 +4403,6 @@ AS_DEPFLAGS=$AS_DEPFLAGS
HOSTCC=$host_cc
HOSTLD=$host_ld
HOSTCFLAGS=$host_cflags
HOSTCPPFLAGS=$host_cppflags
HOSTEXESUF=$HOSTEXESUF
HOSTLDFLAGS=$host_ldflags
HOSTLIBS=$host_libs
@@ -4496,7 +4446,6 @@ get_version(){
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
}
map 'get_version $v' $LIBRARY_LIST
@@ -4571,7 +4520,7 @@ pkgconfig_generate(){
requires=$5
enabled ${name#lib} || return 0
mkdir -p $name
cat <<EOF > $name/$name${build_suffix}.pc
cat <<EOF > $name/$name.pc
prefix=$prefix
exec_prefix=\${prefix}
libdir=$libdir
@@ -4607,27 +4556,27 @@ Cflags: -I\${includedir}
EOF
}
libavfilter_pc_deps="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION"
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample = $LIBAVRESAMPLE_VERSION,"
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
libavfilter_pc_deps=${libavfilter_pc_deps%, }
libavdevice_pc_deps="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
fix_ffmpeg_remote(){
git_remote_from=$1

View File

@@ -15,19 +15,7 @@ libavutil: 2012-10-22
API changes, most recent first:
2013-03-07 - xxxxxx - lavu 52.18.100 - avstring.h,bprint.h
Add av_escape() and av_bprint_escape() API.
2013-02-24 - xxxxxx - lavfi 3.41.100 - buffersink.h
Add sample_rates field to AVABufferSinkParams.
2013-01-17 - a1a707f - lavf 54.61.100
Add av_codec_get_tag2().
2013-01-01 - 2eb2e17 - lavfi 3.34.100
Add avfilter_get_audio_buffer_ref_from_arrays_channels.
2012-12-20 - 34de47aa - lavfi 3.29.100 - avfilter.h
2012-12-20 - xxxxxxx - lavfi 3.28.100 - avfilter.h
Add AVFilterLink.channels, avfilter_link_get_channels()
and avfilter_ref_get_channels().
@@ -144,54 +132,30 @@ API changes, most recent first:
2012-03-26 - a67d9cf - lavfi 2.66.100
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
2013-xx-xx - xxxxxxx - lavfi 3.4.0 - avfiltergraph.h
Add resample_lavr_opts to AVFilterGraph for setting libavresample options
for auto-inserted resample filters.
2013-xx-xx - xxxxxxx - lavu 52.7.0 - dict.h
Add av_dict_parse_string() to set multiple key/value pairs at once from a
string.
2013-01-xx - xxxxxxx - lavu 52.6.0 - avstring.h
Add av_strnstr()
2013-01-xx - xxxxxxx - lavu 52.5.0 - hmac.h
Add AVHMAC.
2013-01-13 - xxxxxxx - lavc 54.87.100 / 54.36.0 - vdpau.h
Add AVVDPAUContext struct for VDPAU hardware-accelerated decoding.
2013-01-12 - dae382b / 169fb94 - lavu 52.14.100 / 52.4.0 - pixdesc.h
Add AV_PIX_FMT_VDPAU flag.
2013-01-07 - 249fca3 / 074a00d - lavr 1.1.0
Add avresample_set_channel_mapping() for input channel reordering,
duplication, and silencing.
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
2012-12-29 - d8fd06c - lavu 52.3.0 - avstring.h
Add av_basename() and av_dirname().
2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h
2012-11-11 - 5980f5d - lavu 52.2.0 - audioconvert.h
Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
2012-11-05 - 7d26be6 / dfde8a3 - lavu 52.5.100 / 52.1.0 - intmath.h
2012-11-05 - dfde8a3 - lavu 52.1.0 - intmath.h
Add av_ctz() for trailing zero bit count
2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h
2012-10-21 - a893655 - lavu 51.45.0 - error.h
Add AVERROR_EXPERIMENTAL
2012-10-12 - a33ed6b / d2fcb35 - lavu 51.76.100 / 51.44.0 - pixdesc.h
2012-10-12 - d2fcb35 - lavu 51.44.0 - pixdesc.h
Add functions for accessing pixel format descriptors.
Accessing the av_pix_fmt_descriptors array directly is now
deprecated.
2012-10-11 - f391e40 / 9a92aea - lavu 51.75.100 / 51.43.0 - aes.h, md5.h, sha.h, tree.h
2012-10-11 - 9a92aea - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h
Add functions for allocating the opaque contexts for the algorithms,
2012-10-10 - de31814 / b522000 - lavf 54.32.100 / 54.18.0 - avio.h
2012-10-10 - b522000 - lavf 54.18.0 - avio.h
Add avio_closep to complement avio_close.
2012-10-08 - ae77266 / 78071a1 - lavu 51.74.100 / 51.42.0 - pixfmt.h
2012-10-08 - 78071a1 - lavu 51.42.0 - pixfmt.h
Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
To provide backwards compatibility, PixelFormat is now #defined as
AVPixelFormat.
@@ -199,23 +163,23 @@ API changes, most recent first:
'PixelFormat' identifier. Such code should either #undef PixelFormat
or stop using the PixelFormat name.
2012-10-05 - 55c49af / e7ba5b1 - lavr 1.0.0 - avresample.h
2012-10-05 - e7ba5b1 - lavr 1.0.0 - avresample.h
Data planes parameters to avresample_convert() and
avresample_read() are now uint8_t** instead of void**.
Libavresample is now stable.
2012-09-24 - 46a3595 / a42aada - lavc 54.59.100 / 54.28.0 - avcodec.h
2012-09-24 - a42aada - lavc 54.28.0 - avcodec.h
Add avcodec_free_frame(). This function must now
be used for freeing an AVFrame.
2012-09-12 - e3e09f2 / 8919fee - lavu 51.73.100 / 51.41.0 - audioconvert.h
2012-09-12 - 8919fee - lavu 51.41.0 - audioconvert.h
Added AV_CH_LOW_FREQUENCY_2 channel mask value.
2012-09-04 - b21b5b0 / 686a329 - lavu 51.71.100 / 51.40.0 - opt.h
2012-09-04 - 686a329 - lavu 51.40.0 - opt.h
Reordered the fields in default_val in AVOption, changed which
default_val field is used for which AVOptionType.
2012-08-30 - 98298eb / a231832 - lavc 54.54.101 / 54.26.1 - avcodec.h
2012-08-30 - a231832 - lavc 54.26.1 - avcodec.h
Add codec descriptor properties AV_CODEC_PROP_LOSSY and
AV_CODEC_PROP_LOSSLESS.
@@ -223,90 +187,90 @@ API changes, most recent first:
Add codec descriptors for accessing codec properties without having
to refer to a specific decoder or encoder.
f5f3684 / c223d79 - Add an AVCodecDescriptor struct and functions
c223d79 - Add an AVCodecDescriptor struct and functions
avcodec_descriptor_get() and avcodec_descriptor_next().
f5f3684 / 51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
6c180b3 / 91e59fe - Add avcodec_descriptor_get_by_name().
51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
91e59fe - Add avcodec_descriptor_get_by_name().
2012-08-08 - f5f3684 / 987170c - lavu 51.68.100 / 51.38.0 - dict.h
2012-08-08 - 987170c - lavu 51.38 - dict.h
Add av_dict_count().
2012-08-07 - 7a72695 / 104e10f - lavc 54.51.100 / 54.25.0 - avcodec.h
2012-08-07 - 104e10f - lavc 54.25 - avcodec.h
Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*.
To provide backwards compatibility, CodecID is now #defined as AVCodecID.
Note that this can break user code that includes avcodec.h and uses the
'CodecID' identifier. Such code should either #undef CodecID or stop using the
CodecID name.
2012-08-03 - e776ee8 / 239fdf1 - lavu 51.66.101 / 51.37.1 - cpu.h
2012-08-03 - 239fdf1 - lavu 51.37.1 - cpu.h
lsws 2.1.1 - swscale.h
Rename AV_CPU_FLAG_MMX2 ---> AV_CPU_FLAG_MMXEXT.
Rename SWS_CPU_CAPS_MMX2 ---> SWS_CPU_CAPS_MMXEXT.
2012-07-29 - 7c26761 / 681ed00 - lavf 54.22.100 / 54.13.0 - avformat.h
2012-07-29 - 681ed00 - lavf 54.13.0 - avformat.h
Add AVFMT_FLAG_NOBUFFER for low latency use cases.
2012-07-10 - 5fade8a - lavu 51.37.0
Add av_malloc_array() and av_mallocz_array()
2012-06-22 - e847f41 / d3d3a32 - lavu 51.61.100 / 51.34.0
2012-06-22 - d3d3a32 - lavu 51.34.0
Add av_usleep()
2012-06-20 - 4da42eb / ae0a301 - lavu 51.60.100 / 51.33.0
2012-06-20 - ae0a301 - lavu 51.33.0
Move av_gettime() to libavutil, add libavutil/time.h
2012-06-09 - 82edf67 / 3971be0 - lavr 0.0.3
2012-06-09 - 3971be0 - lavr 0.0.3
Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing.
2012-06-12 - c7b9eab / 9baeff9 - lavfi 2.79.100 / 2.23.0 - avfilter.h
2012-06-12 - 9baeff9 - lavfi 2.23.0 - avfilter.h
Add AVFilterContext.nb_inputs/outputs. Deprecate
AVFilterContext.input/output_count.
2012-06-12 - c7b9eab / 84b9fbe - lavfi 2.79.100 / 2.22.0 - avfilter.h
2012-06-12 - 84b9fbe - lavfi 2.22.0 - avfilter.h
Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those
should now be used instead of accessing AVFilterPad members
directly.
2012-06-12 - 3630a07 / b0f0dfc - lavu 51.57.100 / 51.32.0 - audioconvert.h
2012-06-12 - b0f0dfc - lavu 51.32.0 - audioconvert.h
Add av_get_channel_layout_channel_index(), av_get_channel_name()
and av_channel_layout_extract_channel().
2012-05-25 - 53ce990 / 154486f - lavu 51.55.100 / 51.31.0 - opt.h
2012-05-25 - 154486f - lavu 51.31.0 - opt.h
Add av_opt_set_bin()
2012-05-15 - lavfi 2.74.100 / 2.17.0
2012-05-15 - lavfi 2.17.0
Add support for audio filters
61930bd / ac71230, 1cbf7fb / a2cd9be - add video/audio buffer sink in a new installed
ac71230/a2cd9be - add video/audio buffer sink in a new installed
header buffersink.h
1cbf7fb / 720c6b7 - add av_buffersrc_write_frame(), deprecate
720c6b7 - add av_buffersrc_write_frame(), deprecate
av_vsrc_buffer_add_frame()
61930bd / ab16504 - add avfilter_copy_buf_props()
61930bd / 9453c9e - add extended_data to AVFilterBuffer
61930bd / 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
ab16504 - add avfilter_copy_buf_props()
9453c9e - add extended_data to AVFilterBuffer
1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
2012-05-09 - lavu 51.53.100 / 51.30.0 - samplefmt.h
61930bd / 142e740 - add av_samples_copy()
61930bd / 6d7f617 - add av_samples_set_silence()
2012-05-09 - lavu 51.30.0 - samplefmt.h
142e740 - add av_samples_copy()
6d7f617 - add av_samples_set_silence()
2012-05-09 - 61930bd / a5117a2 - lavc 54.21.101 / 54.13.1
2012-05-09 - a5117a2 - lavc 54.13.1
For audio formats with fixed frame size, the last frame
no longer needs to be padded with silence, libavcodec
will handle this internally (effectively all encoders
behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
2012-05-07 - 653d117 / 828bd08 - lavc 54.20.100 / 54.13.0 - avcodec.h
2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
Add sample_rate and channel_layout fields to AVFrame.
2012-05-01 - 2330eb1 / 4010d72 - lavr 0.0.1
2012-05-01 - 4010d72 - lavr 0.0.1
Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
2012-04-25 - e890b68 / 3527a73 - lavu 51.48.100 / 51.29.0 - cpu.h
2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
Add av_parse_cpu_flags()
2012-04-24 - 3ead79e / c8af852 - lavr 0.0.0
2012-04-24 - c8af852 - lavr 0.0.0
Add libavresample audio conversion library
2012-04-20 - 3194ab7 / 0c0d1bc - lavu 51.47.100 / 51.28.0 - audio_fifo.h
2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
Add audio FIFO functions:
av_audio_fifo_free()
av_audio_fifo_alloc()
@@ -318,10 +282,10 @@ API changes, most recent first:
av_audio_fifo_size()
av_audio_fifo_space()
2012-04-14 - lavfi 2.70.100 / 2.16.0 - avfiltergraph.h
7432bcf / d7bcc71 Add avfilter_graph_parse2().
2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
d7bcc71 Add avfilter_graph_parse2().
2012-04-08 - 6bfb304 / 4d693b0 - lavu 51.46.100 / 51.27.0 - samplefmt.h
2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
2012-03-21 - b75c67d - lavu 51.43.100
@@ -349,73 +313,73 @@ API changes, most recent first:
2012-01-24 - 0c3577b - lavfi 2.60.100
Add avfilter_graph_dump.
2012-03-20 - 0ebd836 / 3c90cc2 - lavfo 54.2.0
2012-03-20 - 3c90cc2 - lavfo 54.2.0
Deprecate av_read_packet(), use av_read_frame() with
AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags
2012-03-05 - lavc 54.10.100 / 54.8.0
f095391 / 6699d07 Add av_get_exact_bits_per_sample()
f095391 / 9524cf7 Add av_get_audio_frame_duration()
2012-03-05 - lavc 54.8.0
6699d07 Add av_get_exact_bits_per_sample()
9524cf7 Add av_get_audio_frame_duration()
2012-03-04 - 2af8f2c / 44fe77b - lavc 54.8.100 / 54.7.0 - avcodec.h
2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
Add av_codec_is_encoder/decoder().
2012-03-01 - 1eb7f39 / 442c132 - lavc 54.5.100 / 54.3.0 - avcodec.h
2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
Add av_packet_shrink_side_data.
2012-02-29 - 79ae084 / dd2a4bc - lavf 54.2.100 / 54.2.0 - avformat.h
2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
used for dealing with attached pictures/cover art.
2012-02-25 - 305e4b3 / c9bca80 - lavu 51.41.100 / 51.24.0 - error.h
2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
Add AVERROR_UNKNOWN
NOTE: this was backported to 0.8
2012-02-20 - eadd426 / e9cda85 - lavc 54.2.100 / 54.2.0
2012-02-20 - e9cda85 - lavc 54.2.0
Add duration field to AVCodecParserContext
2012-02-20 - eadd426 / 0b42a93 - lavu 51.40.100 / 51.23.1 - mathematics.h
2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h
Add av_rescale_q_rnd()
2012-02-08 - f2b20b7 / 38d5533 - lavu 51.38.101 / 51.22.1 - pixdesc.h
2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h
Add PIX_FMT_PSEUDOPAL flag.
2012-02-08 - f2b20b7 / 52f82a1 - lavc 54.2.100 / 54.1.0
2012-02-08 - 52f82a1 - lavc 54.01.0
Add avcodec_encode_video2() and deprecate avcodec_encode_video().
2012-02-01 - 4c677df / 316fc74 - lavc 54.1.0
2012-02-01 - 316fc74 - lavc 54.01.0
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
zero-padded bytes at the end.
2012-01-31 - a369a6b / dd6d3b0 - lavf 54.1.0
2012-01-31 - dd6d3b0 - lavf 54.01.0
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
NOTE: this was backported to 0.8
2012-01-31 - a369a6b / af08d9a - lavc 54.1.0
2012-01-31 - af08d9a - lavc 54.01.0
Add avcodec_is_open() function.
NOTE: this was backported to 0.8
2012-01-30 - 151ecc2 / 8b93312 - lavu 51.36.100 / 51.22.0 - intfloat.h
2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
Add a new installed header libavutil/intfloat.h with int/float punning
functions.
NOTE: this was backported to 0.8
2012-01-25 - lavf 53.31.100 / 53.22.0
3c5fe5b / f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
2012-01-25 - lavf 53.22.0
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-01-15 - lavc 53.56.105 / 53.34.0
2012-01-15 - lavc 53.34.0
New audio encoding API:
67f5650 / b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
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().
5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
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
2012-01-12 - 3167dc9 - lavfi 2.15.0
Add a new installed header -- libavfilter/version.h -- with version macros.
2011-12-08 - a502939 - lavfi 2.52.0
@@ -436,37 +400,37 @@ API changes, most recent first:
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
2011-01-03 - b73ec05 - lavu 51.21.0
Add av_popcount64
2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
2011-12-18 - 8400b12 - lavc 53.28.1
Deprecate AVFrame.age. The field is unused.
2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
2011-12-12 - 5266045 - lavf 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
2011-12-02 - 0eea212 - lavc 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
2011-12-04 - 560f773 - lavc 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
2011-11-23 - bbb46f3 - lavu 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
2011-11-23 - 8889cc4 - lavu 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
2011-11-19 - f3a29b7 - lavc 53.21.0
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
which is accessed from a new field, AVCodecContext.internal.
- fields moved:
@@ -474,55 +438,55 @@ API changes, most recent first:
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
2011-11-16 - 6270671 - lavu 51.16.0
Add av_timegm()
2011-11-13 - lavf 53.21.0 / 53.15.0
2011-11-13 - lavf 53.15.0
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
interrupt callbacks.
5f268ca / 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
AVFormatContext.
5f268ca / 1dee0ac Add avio_open2() with additional parameters. Those are
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
2011-11-06 - ba04ecf - lavu 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-11-06 - 13b7781 / 07b172f - lavu 51.24.0 / 51.13.0
2011-11-06 - 07b172f - lavu 51.13.0
Add av_toupper()/av_tolower()
2011-11-05 - d8cab5c / b6d08f4 - lavf 53.19.0 / 53.13.0
2011-11-05 - b6d08f4 - lavf 53.13.0
Add avformat_network_init()/avformat_network_deinit()
2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
2011-10-27 - 512557b - lavc 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
2011-10-19 - 569129a - lavf 53.10.0
Add avformat_new_stream(). Deprecate av_new_stream().
2011-10-13 - 91eb1b1 / b631fba - lavf 53.16.0 / 53.9.0
2011-10-13 - b631fba - lavf 53.9.0
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
2011-10-12 - lavu 51.21.0 / 51.12.0
2011-10-12 - lavu 51.12.0
AVOptions API rewrite.
- f884ef0 / 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
- 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
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
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
- 8c5dcaa trivial rename av_next_option -> av_opt_next
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
and av_opt_find2()
2011-09-22 - a70e787 - lavu 51.17.0
@@ -568,31 +532,31 @@ API changes, most recent first:
2011-08-20 - 69e2c1a - lavu 51.13.0
Add av_get_media_type_string().
2011-09-03 - 1889c67 / fb4ca26 - lavc 53.13.0
2011-09-03 - 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
2011-08-03 - 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,
2011-08-26 - lavu 51.9.0
- add41de..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
2011-08-16 - 48f9e45 - lavf 53.8.0
Add avformat_query_codec().
2011-08-16 - 27fbe31 / bca06e7 - lavc 53.11.0
2011-08-16 - bca06e7 - lavc 53.11.0
Add avcodec_get_type().
2011-08-06 - 0cb233c / 2f63440 - lavf 53.7.0
2011-08-06 - 2f63440 - lavf 53.7.0
Add error_recognition to AVFormatContext.
2011-08-02 - 1d186e9 / 9d39cbf - lavc 53.9.1
2011-08-02 - 9d39cbf - lavc 53.9.1
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
2011-07-16 - b57df29 - lavfi 2.27.0
@@ -603,11 +567,11 @@ API changes, most recent first:
avfilter_set_common_packing_formats()
avfilter_all_packing_formats()
2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
2011-07-10 - a67c061 - lavf 53.6.0
Add avformat_find_stream_info(), deprecate av_find_stream_info().
NOTE: this was backported to 0.7
2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
2011-07-10 - 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
NOTE: this was backported to 0.7
@@ -650,35 +614,35 @@ API changes, most recent first:
2011-06-12 - 6119b23 - 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
2011-06-23 - 67e9ae1 - lavu 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-16 - 05e84c9, 25de595 - 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-16 - 7e83e1c, dc59ec5 - 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-10 - cb7c11c - 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-05 - b39b062 - lavu 51.8.0 - opt.h
Add av_opt_free convenience function.
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
@@ -708,7 +672,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
@@ -724,10 +688,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.
@@ -757,81 +721,81 @@ 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
e8bb2e2 deprecate url_fget_max_packet_size
76aa876 rename url_fsize -> avio_size
e519753 deprecate url_fgetc
@@ -852,7 +816,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
@@ -890,11 +854,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

@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.2.11
PROJECT_NUMBER = 1.1.3
# 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

View File

@@ -62,7 +62,7 @@ doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
doc/%.pod: TAG = POD
doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
doc/%.pod: doc/%.texi $(GENTEXI)
$(Q)$(TEXIDEP)
$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
@@ -92,9 +92,9 @@ uninstall: uninstall-man
uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
clean:: docclean
docclean: clean
docclean:
clean::
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
$(RM) -r doc/doxy/html

View File

@@ -1,7 +1,7 @@
Release Notes
=============
* 1.2 "Magic" March, 2013
* 1.1 "Fire Flower" January, 2013
General notes
@@ -14,3 +14,12 @@ accepted. If you are experiencing issues with any formally released version of
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.
Of big interest to our Windows users, FFmpeg now supports building with the MSVC
compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
this has been accomplished using a converter that turns C99 code to C89. See the
platform-specific documentation for more detailed documentation on building
FFmpeg with MSVC.
The used output sample format for several audio decoders has changed, make
sure you always check/use AVCodecContext.sample_fmt or AVFrame.format.

View File

@@ -60,78 +60,6 @@ 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.
@section libcelt
libcelt decoder wrapper
libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
Requires the presence of the libcelt headers and library during configuration.
You need to explicitly configure the build with @code{--enable-libcelt}.
@section libgsm
libgsm decoder wrapper
libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
the presence of the libgsm headers and library during configuration. You need
to explicitly configure the build with @code{--enable-libgsm}.
This decoder supports both the ordinary GSM and the Microsoft variant.
@section libilbc
libilbc decoder wrapper
libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
audio codec. Requires the presence of the libilbc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libilbc}.
@subsection Options
The following option is supported by the libilbc wrapper.
@table @option
@item enhance
Enable the enhancement of the decoded audio when set to 1. The default
value is 0 (disabled).
@end table
@section libopencore-amrnb
libopencore-amrnb decoder wrapper
libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
Narrowband audio codec. Using it requires the presence of the
libopencore-amrnb headers and library during configuration. You need to
explicitly configure the build with @code{--enable-libopencore-amrnb}.
An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
without this library.
@section libopencore-amrwb
libopencore-amrwb decoder wrapper.
libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
Wideband audio codec. Using it requires the presence of the
libopencore-amrwb headers and library during configuration. You need to
explicitly configure the build with @code{--enable-libopencore-amrwb}.
An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
without this library.
@section libopus
libopus decoder wrapper.
libopus allows libavcodec to decode the Opus Interactive Audio Codec.
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopus}.
@c man end AUDIO DECODERS
@chapter Subtitles Decoders

View File

@@ -6,100 +6,18 @@ multimedia streams from a particular type of file.
When you configure your FFmpeg build, all the supported demuxers
are enabled by default. You can list all available ones using the
configure option @code{--list-demuxers}.
configure option "--list-demuxers".
You can disable all the demuxers using the configure option
@code{--disable-demuxers}, and selectively enable a single demuxer with
the option @code{--enable-demuxer=@var{DEMUXER}}, or disable it
with the option @code{--disable-demuxer=@var{DEMUXER}}.
"--disable-demuxers", and selectively enable a single demuxer with
the option "--enable-demuxer=@var{DEMUXER}", or disable it
with the option "--disable-demuxer=@var{DEMUXER}".
The option @code{-formats} of the ff* tools will display the list of
The option "-formats" of the ff* tools will display the list of
enabled demuxers.
The description of some of the currently available demuxers follows.
@section applehttp
Apple HTTP Live Streaming demuxer.
This demuxer presents all AVStreams from all variant streams.
The id field is set to the bitrate variant index number. By setting
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
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".
@anchor{concat}
@section concat
Virtual concatenation script demuxer.
This demuxer reads a list of files and other directives from a text file and
demuxes them one after the other, as if all their packet had been muxed
together.
The timestamps in the files are adjusted so that the first file starts at 0
and each next file starts where the previous one finishes. Note that it is
done globally and may cause gaps if all streams do not have exactly the same
length.
All files must have the same streams (same codecs, same time base, etc.).
The duration of each file is used to adjust the timestamps of the next file:
if the duration is incorrect (because it was computed using the bit-rate or
because the file is truncated, for example), it can cause artifacts. The
@code{duration} directive can be used to override the duration stored in
each file.
@subsection Syntax
The script is a text file in extended-ASCII, with one directive per line.
Empty lines, leading spaces and lines starting with '#' are ignored. The
following directive is recognized:
@table @option
@item @code{file @var{path}}
Path to a file to read; special characters and spaces must be escaped with
backslash or single quotes.
All subsequent directives apply to that file.
@item @code{ffconcat version 1.0}
Identify the script type and version. It also sets the @option{safe} option
to 1 if it was to its default -1.
To make FFmpeg recognize the format automatically, this directive must
appears exactly as is (no extra space or byte-order-mark) on the very first
line of the script.
@item @code{duration @var{dur}}
Duration of the file. This information can be specified from the file;
specifying it here may be more efficient or help if the information from the
file is not available or accurate.
@end table
@subsection Options
This demuxer accepts the following option:
@table @option
@item safe
If set to 1, reject unsafe file paths. A file path is considered safe if it
does not contain a protocol specification and is relative and all components
only contain characters from the portable character set (letters, digits,
period, underscore and hyphen) and have no period at the beginning of a
component.
If set to 0, any file name is accepted.
The default is -1, it is equivalent to 1 if the format was automatically
probed and 0 otherwise.
@end table
@section image2
Image file demuxer.
@@ -225,34 +143,16 @@ ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
@end example
@end itemize
@section rawvideo
@section applehttp
Raw video demuxer.
Apple HTTP Live Streaming demuxer.
This demuxer allows to read raw video data. Since there is no header
specifying the assumed video parameters, the user must specify them
in order to be able to decode the data correctly.
This demuxer accepts the following options:
@table @option
@item framerate
Set input video frame rate. Default value is 25.
@item pixel_format
Set the input video pixel format. Default value is @code{yuv420p}.
@item video_size
Set the input video size. This value must be specified explicitly.
@end table
For example to read a rawvideo file @file{input.raw} with
@command{ffplay}, assuming a pixel format of @code{rgb24}, a video
size of @code{320x240}, and a frame rate of 10 images per second, use
the command:
@example
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
@end example
This demuxer presents all AVStreams from all variant streams.
The id field is set to the bitrate variant index number. By setting
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
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
@@ -284,6 +184,37 @@ 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.
@section concat
Virtual concatenation script demuxer.
This demuxer reads a list of files and other directives from a text file and
demuxes them one after the other, as if all their packet had been muxed
together.
The timestamps in the files are adjusted so that the first file starts at 0
and each next file starts where the previous one finishes. Note that it is
done globally and may cause gaps if all streams do not have exactly the same
length.
All files must have the same streams (same codecs, same time base, etc.).
This script format can currently not be probed, it must be specified explicitly.
@subsection Syntax
The script is a text file in extended-ASCII, with one directive per line.
Empty lines, leading spaces and lines starting with '#' are ignored. The
following directive is recognized:
@table @option
@item @code{file @var{path}}
Path to a file to read; special characters and spaces must be escaped with
backslash or single quotes.
@end table
@section tedcaptions
JSON captions used for @url{http://www.ted.com/, TED Talks}.
@@ -305,4 +236,4 @@ Example: convert the captions to a format most players understand:
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
@end example
@c man end DEMUXERS
@c man end INPUT DEVICES

View File

@@ -147,41 +147,29 @@ GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
@end itemize
@subsection Naming conventions
All names should be composed with underscores (_), not CamelCase. For example,
@samp{avfilter_get_video_buffer} is an acceptable function name and
@samp{AVFilterGetVideo} is not. The exception from this are type names, like
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
There are the following conventions for naming variables and functions:
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 prefix is required.
For variables and functions declared as @code{static} no prefixes are required.
@item
For variables and functions used internally by a library an @code{ff_}
prefix should be used, e.g. @samp{ff_w64_demuxer}.
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
Each library has its own prefix for public symbols, in addition to the
commonly used @code{av_} (@code{avformat_} for libavformat,
@code{avcodec_} for libavcodec, @code{swr_} for libswresample, etc).
Check the existing code and choose names accordingly.
Note that some symbols without these prefixes are also exported for
retro-compatibility reasons. These exceptions are declared in the
@code{lib<name>/lib<name>.v} files.
For exported names, each library has its own prefixes. Just check the existing
code and name accordingly.
@end itemize
Furthermore, name space reserved for the system should not be invaded.
Identifiers ending in @code{_t} are reserved by
@url{http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02, POSIX}.
Also avoid names starting with @code{__} or @code{_} followed by an uppercase
letter as they are reserved by the C standard. Names starting with @code{_}
are reserved at the file level and may not be used for externally visible
symbols. If in doubt, just avoid names starting with @code{_} altogether.
@subsection Miscellaneous conventions
@itemize @bullet
@item
@@ -202,8 +190,8 @@ set shiftwidth=4
set softtabstop=4
set cindent
set cinoptions=(0
" Allow tabs in Makefiles.
autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
" allow tabs in Makefiles
autocmd FileType make 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/
@@ -229,13 +217,8 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
@enumerate
@item
Contributions should be licensed under the
@uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
including an "or any later version" clause, or, if you prefer
a gift-style license, the
@uref{http://www.isc.org/software/license/, ISC} or
@uref{http://mit-license.org/, MIT} license.
@uref{http://www.gnu.org/licenses/gpl-2.0.html, GPL 2} including
Contributions should be licensed under the LGPL 2.1, including an
"or any later version" clause, or the MIT license. GPL 2 including
an "or any later version" clause is also acceptable, but LGPL is
preferred.
@item
@@ -245,13 +228,6 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
You can commit unfinished stuff (for testing etc), but it must be disabled
(#ifdef etc) by default so it does not interfere with other developers'
work.
@item
The commit message should have a short first line in the form of
a @samp{topic: short description} as a header, separated by a newline
from the body consisting of an explanation of why the change is necessary.
If the commit fixes a known bug on the bug tracker, the commit message
should include its bug ID. Referring to the issue on the bug tracker does
not exempt you from writing an excerpt of the bug in the commit message.
@item
You do not have to over-test things. If it works for you, and you think it
should work for others, then commit. If your code has problems
@@ -358,6 +334,8 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
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
@@ -380,6 +358,11 @@ 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.
Patches should be posted as base64 encoded attachments (or any other
encoding which ensures that the patch will not be trashed during
transmission) to the ffmpeg-devel mailing list, see
@url{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel}
It also helps quite a bit if you tell us what the patch does (for example
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
and has no lrint()')
@@ -387,13 +370,6 @@ and has no lrint()')
Also please if you send several patches, send each patch as a separate mail,
do not attach several unrelated patches to the same mail.
Patches should be posted to the
@uref{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
mailing list. Use @code{git send-email} when possible since it will properly
send patches without requiring extra care. If you cannot, then send patches
as base64-encoded attachments, so your patch is not trashed during
transmission.
Your patch will be reviewed on the mailing list. You will likely be asked
to make some changes and are expected to send in an improved version that
incorporates the requests from the review. This process may go through
@@ -422,7 +398,7 @@ send a reminder by email. Your patch should eventually be dealt with.
When adding new codec IDs, also add an entry to the codec descriptor
list in @file{libavcodec/codec_desc.c}.
@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?
@@ -475,10 +451,8 @@ send a reminder by email. Your patch should eventually be dealt with.
other security issues?
@item
Did you test your decoder or demuxer against damaged data? If no, see
tools/trasher, the noise bitstream filter, and
@uref{http://caca.zoy.org/wiki/zzuf, zzuf}. Your decoder or demuxer
should not crash, end in a (near) infinite loop, or allocate ridiculous
amounts of memory when fed damaged data.
tools/trasher and the noise bitstream filter. Your decoder or demuxer
should not crash or end in a (near) infinite loop when fed damaged data.
@item
Does the patch not mix functional and cosmetic changes?
@item
@@ -522,9 +496,6 @@ send a reminder by email. Your patch should eventually be dealt with.
Make sure you check the return values of function and return appropriate
error codes. Especially memory allocation functions like @code{av_malloc()}
are notoriously left unchecked, which is a serious problem.
@item
Test your code with valgrind and or Address Sanitizer to ensure it's free
of leaks, out of array accesses, etc.
@end enumerate
@section Patch review process

View File

@@ -25,95 +25,6 @@ enabled encoders.
A description of some of the currently available audio encoders
follows.
@anchor{aacenc}
@section aac
Advanced Audio Coding (AAC) encoder.
This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
low complexity (AAC-LC) profile is supported. To use this encoder, you must set
@option{strict} option to @samp{experimental} or lower.
As this encoder is experimental, unexpected behavior may exist from time to
time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
that it has a worse quality reported by some users.
@c Comment this out until somebody writes the respective documentation.
@c See also @ref{libfaac}, @ref{libaacplus}, and @ref{libfdk-aac-enc}.
@subsection Options
@table @option
@item b
Set bit rate in bits/s. Setting this automatically activates constant bit rate
(CBR) mode.
@item q
Set quality for variable bit rate (VBR) mode. This option is valid only using
the @command{ffmpeg} command-line tool. For library interface users, use
@option{global_quality}.
@item stereo_mode
Set stereo encoding mode. Possible values:
@table @samp
@item auto
Automatically selected by the encoder.
@item ms_off
Disable middle/side encoding. This is the default.
@item ms_force
Force middle/side encoding.
@end table
@item aac_coder
Set AAC encoder coding method. Possible values:
@table @samp
@item 0
FAAC-inspired method.
This method is a simplified reimplementation of the method used in FAAC, which
sets thresholds proportional to the band energies, and then decreases all the
thresholds with quantizer steps to find the appropriate quantization with
distortion below threshold band by band.
The quality of this method is comparable to the two loop searching method
descibed below, but somewhat a little better and slower.
@item 1
Average noise to mask ratio (ANMR) trellis-based solution.
This has a theoretic best quality out of all the coding methods, but at the
cost of the slowest speed.
@item 2
Two loop searching (TLS) method.
This method first sets quantizers depending on band thresholds and then tries
to find an optimal combination by adding or subtracting a specific value from
all quantizers and adjusting some individual quantizer a little.
This method produces similar quality with the FAAC method and is the default.
@item 3
Constant quantizer method.
This method sets a constant quantizer for all bands. This is the fastest of all
the methods, yet produces the worst quality.
@end table
@end table
@subsection Tips and Tricks
According to some reports
(e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
@option{cutoff} option to 15000 Hz greatly improves the quality of the output
quality. As a result, we encourage you to do the same.
@section ac3 and ac3_fixed
AC-3 audio encoders.
@@ -501,279 +412,6 @@ Selected by Encoder (default)
@end table
@section libmp3lame
LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper
Requires the presence of the libmp3lame headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libmp3lame}.
@subsection Options
The following options are supported by the libmp3lame wrapper. The
@command{lame}-equivalent of the options are listed in parentheses.
@table @option
@item b (@emph{-b})
Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
expressed in kilobits/s.
@item q (@emph{-V})
Set constant quality setting for VBR. This option is valid only
using the @command{ffmpeg} command-line tool. For library interface
users, use @option{global_quality}.
@item compression_level (@emph{-q})
Set algorithm quality. Valid arguments are integers in the 0-9 range,
with 0 meaning highest quality but slowest, and 9 meaning fastest
while producing the worst quality.
@item reservoir
Enable use of bit reservoir when set to 1. Default value is 1. LAME
has this enabled by default, but can be overriden by use
@option{--nores} option.
@end table
@section libopencore-amrnb
OpenCORE Adaptive Multi-Rate Narrowband encoder.
Requires the presence of the libopencore-amrnb headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopencore-amrnb --enable-version3}.
This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
but you can override it by setting @option{strict} to @samp{unofficial} or
lower.
@subsection Options
@table @option
@item b
Set bitrate in bits per second. Only the following bitrates are supported,
otherwise libavcodec will round to the nearest valid bitrate.
@table @option
@item 4750
@item 5150
@item 5900
@item 6700
@item 7400
@item 7950
@item 10200
@item 12200
@end table
@item dtx
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
@end table
@section libtwolame
TwoLAME MP2 encoder wrapper
Requires the presence of the libtwolame headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libtwolame}.
@subsection Options
The following options are supported by the libtwolame wrapper. The
@command{twolame}-equivalent options follow the FFmpeg ones and are in
parentheses.
@table @option
@item b (@emph{-b})
Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
option is expressed in kilobits/s. Default value is 128k.
@item q (@emph{-V})
Set quality for experimental VBR support. Maximum value range is
from -50 to 50, useful range is from -10 to 10. The higher the
value, the better the quality. This option is valid only using the
@command{ffmpeg} command-line tool. For library interface users,
use @option{global_quality}.
@item mode (@emph{--mode})
Set the mode of the resulting audio. Possible values:
@table @samp
@item auto
Choose mode automatically based on the input. This is the default.
@item stereo
Stereo
@item joint_stereo
Joint stereo
@item dual_channel
Dual channel
@item mono
Mono
@end table
@item psymodel (@emph{--psyc-mode})
Set psychoacoustic model to use in encoding. The argument must be
an integer between -1 and 4, inclusive. The higher the value, the
better the quality. The default value is 3.
@item energy_levels (@emph{--energy})
Enable energy levels extensions when set to 1. The default value is
0 (disabled).
@item error_protection (@emph{--protect})
Enable CRC error protection when set to 1. The default value is 0
(disabled).
@item copyright (@emph{--copyright})
Set MPEG audio copyright flag when set to 1. The default value is 0
(disabled).
@item original (@emph{--original})
Set MPEG audio original flag when set to 1. The default value is 0
(disabled).
@end table
@anchor{libvo-aacenc}
@section libvo-aacenc
VisualOn AAC encoder
Requires the presence of the libvo-aacenc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libvo-aacenc --enable-version3}.
This encoder is considered to be worse than the
@ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
multiple sources.
@subsection Options
The VisualOn AAC encoder only support encoding AAC-LC and up to 2
channels. It is also CBR-only.
@table @option
@item b
Set bit rate in bits/s.
@end table
@section libvo-amrwbenc
VisualOn Adaptive Multi-Rate Wideband encoder
Requires the presence of the libvo-amrwbenc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libvo-amrwbenc --enable-version3}.
This is a mono-only encoder. Officially it only supports 16000Hz sample
rate, but you can override it by setting @option{strict} to
@samp{unofficial} or lower.
@subsection Options
@table @option
@item b
Set bitrate in bits/s. Only the following bitrates are supported, otherwise
libavcodec will round to the nearest valid bitrate.
@table @samp
@item 6600
@item 8850
@item 12650
@item 14250
@item 15850
@item 18250
@item 19850
@item 23050
@item 23850
@end table
@item dtx
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
@end table
@section libopus
libopus Opus Interactive Audio Codec encoder wrapper.
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopus}.
@subsection Option Mapping
Most libopus options are modeled after the @command{opusenc} utility from
opus-tools. The following is an option mapping chart describing options
supported by the libopus wrapper, and their @command{opusenc}-equivalent
in parentheses.
@table @option
@item b (@emph{bitrate})
Set the bit rate in bits/s. FFmpeg's @option{b} option is
expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
kilobits/s.
@item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
Set VBR mode. The FFmpeg @option{vbr} option has the following
valid arguments, with the their @command{opusenc} equivalent options
in parentheses:
@table @samp
@item off (@emph{hard-cbr})
Use constant bit rate encoding.
@item on (@emph{vbr})
Use variable bit rate encoding (the default).
@item constrained (@emph{cvbr})
Use constrained variable bit rate encoding.
@end table
@item compression_level (@emph{comp})
Set encoding algorithm complexity. Valid options are integers in
the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
gives the highest quality but slowest encoding. The default is 10.
@item frame_duration (@emph{framesize})
Set maximum frame size, or duration of a frame in milliseconds. The
argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
frame sizes achieve lower latency but less quality at a given bitrate.
Sizes greater than 20ms are only interesting at fairly low bitrates.
The default is 20ms.
@item packet_loss (@emph{expect-loss})
Set expected packet loss percentage. The default is 0.
@item application (N.A.)
Set intended application type. Valid options are listed below:
@table @samp
@item voip
Favor improved speech intelligibility.
@item audio
Favor faithfulness to the input (the default).
@item lowdelay
Restrict to only the lowest delay modes.
@end table
@item cutoff (N.A.)
Set cutoff bandwidth in Hz. The argument must be exactly one of the
following: 4000, 6000, 8000, 12000, or 20000, corresponding to
narrowband, mediumband, wideband, super wideband, and fullband
respectively. The default is 0 (cutoff disabled).
@end table
@c man end AUDIO ENCODERS
@chapter Video Encoders
@@ -943,458 +581,56 @@ For more information about libvpx see:
@section libx264
x264 H.264/MPEG-4 AVC encoder wrapper
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
libx264.
This encoder requires the presence of the libx264 headers and library
during configuration. You need to explicitly configure the build with
Requires the presence of the libx264 headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libx264}.
libx264 supports an impressive number of features, including 8x8 and
4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
for detail retention (adaptive quantization, psy-RD, psy-trellis).
Many libx264 encoder options are mapped to FFmpeg global codec
options, while unique encoder options are provided through private
options. Additionally the @option{x264opts} and @option{x264-params}
private options allows to pass a list of key=value tuples as accepted
by the libx264 @code{x264_param_parse} function.
The x264 project website is at
@url{http://www.videolan.org/developers/x264.html}.
@subsection Options
The following options are supported by the libx264 wrapper. The
@command{x264}-equivalent options or values are listed in parentheses
for easy migration.
To reduce the duplication of documentation, only the private options
and some others requiring special attention are documented here. For
the documentation of the undocumented generic options, see
@ref{codec-options,,the Codec Options chapter}.
To get a more accurate and extensive documentation of the libx264
options, invoke the command @command{x264 --full-help} or consult
the libx264 documentation.
@table @option
@item b (@emph{bitrate})
Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
expressed in bits/s, while @command{x264}'s @option{bitrate} is in
kilobits/s.
@item bf (@emph{bframes})
@item g (@emph{keyint})
@item qmax (@emph{qpmax})
@item qmin (@emph{qpmin})
@item qdiff (@emph{qpstep})
@item qblur (@emph{qblur})
@item qcomp (@emph{qcomp})
@item refs (@emph{ref})
@item sc_threshold (@emph{scenecut})
@item trellis (@emph{trellis})
@item nr (@emph{nr})
@item me_range (@emph{merange})
@item me_method (@emph{me})
Set motion estimation method. Possible values in the decreasing order
of speed:
@table @samp
@item dia (@emph{dia})
@item epzs (@emph{dia})
Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
@samp{dia}.
@item hex (@emph{hex})
Hexagonal search with radius 2.
@item umh (@emph{umh})
Uneven multi-hexagon search.
@item esa (@emph{esa})
Exhaustive search.
@item tesa (@emph{tesa})
Hadamard exhaustive search (slowest).
@end table
@item subq (@emph{subme})
@item b_strategy (@emph{b-adapt})
@item keyint_min (@emph{min-keyint})
@item coder
Set entropy encoder. Possible values:
@table @samp
@item ac
Enable CABAC.
@item vlc
Enable CAVLC and disable CABAC. It generates the same effect as
@command{x264}'s @option{--no-cabac} option.
@end table
@item cmp
Set full pixel motion estimation comparation algorithm. Possible values:
@table @samp
@item chroma
Enable chroma in motion estimation.
@item sad
Ignore chroma in motion estimation. It generates the same effect as
@command{x264}'s @option{--no-chroma-me} option.
@end table
@item threads (@emph{threads})
@item thread_type
Set multithreading technique. Possible values:
@table @samp
@item slice
Slice-based multithreading. It generates the same effect as
@command{x264}'s @option{--sliced-threads} option.
@item frame
Frame-based multithreading.
@end table
@item flags
Set encoding flags. It can be used to disable closed GOP and enable
open GOP by setting it to @code{-cgop}. The result is similar to
the behavior of @command{x264}'s @option{--open-gop} option.
@item rc_init_occupancy (@emph{vbv-init})
@item preset (@emph{preset})
@item preset @var{preset_name}
Set the encoding preset.
@item tune (@emph{tune})
Set tuning of the encoding params.
@item tune @var{tune_name}
Tune the encoding params.
@item profile (@emph{profile})
@item fastfirstpass @var{bool}
Use fast settings when encoding first pass, default value is 1.
@item profile @var{profile_name}
Set profile restrictions.
@item fastfirstpass
Enable fast settings when encoding first pass, when set to 1. When set
to 0, it has the same effect of @command{x264}'s
@option{--slow-firstpass} option.
@item level @var{level}
Specify level (as defined by Annex A).
Deprecated in favor of @var{x264opts}.
@item crf (@emph{crf})
Set the quality for constant quality mode.
@item passlogfile @var{filename}
Specify filename for 2 pass stats.
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
@item crf_max (@emph{crf-max})
In CRF mode, prevents VBV from lowering quality beyond this point.
@item wpredp @var{wpred_type}
Specify Weighted prediction for P-frames.
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
@item qp (@emph{qp})
Set constant quantization rate control method parameter.
@item x264opts @var{options}
Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
@item aq-mode (@emph{aq-mode})
Set AQ method. Possible values:
@table @samp
@item none (@emph{0})
Disabled.
@item variance (@emph{1})
Variance AQ (complexity mask).
@item autovariance (@emph{2})
Auto-variance AQ (experimental).
@end table
@item aq-strength (@emph{aq-strength})
Set AQ strength, reduce blocking and blurring in flat and textured areas.
@item psy
Use psychovisual optimizations when set to 1. When set to 0, it has the
same effect as @command{x264}'s @option{--no-psy} option.
@item psy-rd (@emph{psy-rd})
Set strength of psychovisual optimization, in
@var{psy-rd}:@var{psy-trellis} format.
@item rc-lookahead (@emph{rc-lookahead})
Set number of frames to look ahead for frametype and ratecontrol.
@item weightb
Enable weighted prediction for B-frames when set to 1. When set to 0,
it has the same effect as @command{x264}'s @option{--no-weightb} option.
@item weightp (@emph{weightp})
Set weighted prediction method for P-frames. Possible values:
@table @samp
@item none (@emph{0})
Disabled
@item simple (@emph{1})
Enable only weighted refs
@item smart (@emph{2})
Enable both weighted refs and duplicates
@end table
@item ssim (@emph{ssim})
Enable calculation and printing SSIM stats after the encoding.
@item intra-refresh (@emph{intra-refresh})
Enable the use of Periodic Intra Refresh instead of IDR frames when set
to 1.
@item b-bias (@emph{b-bias})
Set the influence on how often B-frames are used.
@item b-pyramid (@emph{b-pyramid})
Set method for keeping of some B-frames as references. Possible values:
@table @samp
@item none (@emph{none})
Disabled.
@item strict (@emph{strict})
Strictly hierarchical pyramid.
@item normal (@emph{normal})
Non-strict (not Blu-ray compatible).
@end table
@item mixed-refs
Enable the use of one reference per partition, as opposed to one
reference per macroblock when set to 1. When set to 0, it has the
same effect as @command{x264}'s @option{--no-mixed-refs} option.
@item 8x8dct
Enable adaptive spatial transform (high profile 8x8 transform)
when set to 1. When set to 0, it has the same effect as
@command{x264}'s @option{--no-8x8dct} option.
@item fast-pskip
Enable early SKIP detection on P-frames when set to 1. When set
to 0, it has the same effect as @command{x264}'s
@option{--no-fast-pskip} option.
@item aud (@emph{aud})
Enable use of access unit delimiters when set to 1.
@item mbtree
Enable use macroblock tree ratecontrol when set to 1. When set
to 0, it has the same effect as @command{x264}'s
@option{--no-mbtree} option.
@item deblock (@emph{deblock})
Set loop filter parameters, in @var{alpha}:@var{beta} form.
@item cplxblur (@emph{cplxblur})
Set fluctuations reduction in QP (before curve compression).
@item partitions (@emph{partitions})
Set partitions to consider as a comma-separated list of. Possible
values in the list:
@table @samp
@item p8x8
8x8 P-frame partition.
@item p4x4
4x4 P-frame partition.
@item b8x8
4x4 B-frame partition.
@item i8x8
8x8 I-frame partition.
@item i4x4
4x4 I-frame partition.
(Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
@samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
option) to be enabled.)
@item none (@emph{none})
Do not consider any partitions.
@item all (@emph{all})
Consider every partition.
@end table
@item direct-pred (@emph{direct})
Set direct MV prediction mode. Possible values:
@table @samp
@item none (@emph{none})
Disable MV prediction.
@item spatial (@emph{spatial})
Enable spatial predicting.
@item temporal (@emph{temporal})
Enable temporal predicting.
@item auto (@emph{auto})
Automatically decided.
@end table
@item slice-max-size (@emph{slice-max-size})
Set the limit of the size of each slice in bytes. If not specified
but RTP payload size (@option{ps}) is specified, that is used.
@item stats (@emph{stats})
Set the file name for multi-pass stats.
@item nal-hrd (@emph{nal-hrd})
Set signal HRD information (requires @option{vbv-bufsize} to be set).
Possible values:
@table @samp
@item none (@emph{none})
Disable HRD information signaling.
@item vbr (@emph{vbr})
Variable bit rate.
@item cbr (@emph{cbr})
Constant bit rate (not allowed in MP4 container).
@end table
@item x264opts (N.A.)
Set any x264 option, see @command{x264 --fullhelp} for a list.
Argument is a list of @var{key}=@var{value} couples separated by
@var{options} is a list of @var{key}=@var{value} couples separated by
":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
themselves, use "," instead. They accept it as well since long ago but this
is kept undocumented for some reason.
@end table
For example to specify libx264 encoding options with @command{ffmpeg}:
@example
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
@end example
@item x264-params (N.A.)
Override the x264 configuration using a :-separated list of key=value
parameters.
This option is functionally the same as the @option{x264opts}, but is
duplicated for compability with the Libav fork.
For example to specify libx264 encoding options with @command{ffmpeg}:
@example
ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
@end example
@end table
Encoding ffpresets for common usages are provided so they can be used with the
general presets system (e.g. passing the @option{pre} option).
@section libxvid
Xvid MPEG-4 Part 2 encoder wrapper.
This encoder requires the presence of the libxvidcore headers and library
during configuration. You need to explicitly configure the build with
@code{--enable-libxvid --enable-gpl}.
The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
users can encode to this format without this library.
@subsection Options
The following options are supported by the libxvid wrapper. Some of
the following options are listed but are not documented, and
correspond to shared codec options. See @ref{codec-options,,the Codec
Options chapter} for their documentation. The other shared options
which are not listed have no effect for the libxvid encoder.
@table @option
@item b
@item g
@item qmin
@item qmax
@item mpeg_quant
@item threads
@item bf
@item b_qfactor
@item b_qoffset
@item flags
Set specific encoding flags. Possible values:
@table @samp
@item mv4
Use four motion vector by macroblock.
@item aic
Enable high quality AC prediction.
@item gray
Only encode grayscale.
@item gmc
Enable the use of global motion compensation (GMC).
@item qpel
Enable quarter-pixel motion compensation.
@item cgop
Enable closed GOP.
@item global_header
Place global headers in extradata instead of every keyframe.
@end table
@item trellis
@item me_method
Set motion estimation method. Possible values in decreasing order of
speed and increasing order of quality:
@table @samp
@item zero
Use no motion estimation (default).
@item phods
@item x1
@item log
Enable advanced diamond zonal search for 16x16 blocks and half-pixel
refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
@samp{phods}.
@item epzs
Enable all of the things described above, plus advanced diamond zonal
search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
estimation on chroma planes.
@item full
Enable all of the things described above, plus extended 16x16 and 8x8
blocks search.
@end table
@item mbd
Set macroblock decision algorithm. Possible values in the increasing
order of quality:
@table @samp
@item simple
Use macroblock comparing function algorithm (default).
@item bits
Enable rate distortion-based half pixel and quarter pixel refinement for
16x16 blocks.
@item rd
Enable all of the things described above, plus rate distortion-based
half pixel and quarter pixel refinement for 8x8 blocks, and rate
distortion-based search using square pattern.
@end table
@end table
For more information about libx264 and the supported options see:
@url{http://www.videolan.org/developers/x264.html}
@c man end VIDEO ENCODERS

View File

@@ -20,93 +20,57 @@ The following unary operators are available: @code{+}, @code{-}.
The following functions are available:
@table @option
@item abs(x)
Compute absolute value of @var{x}.
@item acos(x)
Compute arccosine of @var{x}.
@item asin(x)
Compute arcsine of @var{x}.
@item atan(x)
Compute arctangent of @var{x}.
@item ceil(expr)
Round the value of expression @var{expr} upwards to the nearest
integer. For example, "ceil(1.5)" is "2.0".
@item cos(x)
Compute cosine of @var{x}.
@item sinh(x)
Compute hyperbolic sine of @var{x}.
@item cosh(x)
Compute hyperbolic cosine of @var{x}.
@item eq(x, y)
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
@item tanh(x)
Compute hyperbolic tangent of @var{x}.
@item sin(x)
Compute sine of @var{x}.
@item cos(x)
Compute cosine of @var{x}.
@item tan(x)
Compute tangent of @var{x}.
@item atan(x)
Compute arctangent of @var{x}.
@item asin(x)
Compute arcsine of @var{x}.
@item acos(x)
Compute arccosine of @var{x}.
@item exp(x)
Compute exponential of @var{x} (with base @code{e}, the Euler's number).
@item floor(expr)
Round the value of expression @var{expr} downwards to the nearest
integer. For example, "floor(-1.5)" is "-2.0".
@item log(x)
Compute natural logarithm of @var{x}.
@item abs(x)
Compute absolute value of @var{x}.
@item squish(x)
Compute expression @code{1/(1 + exp(4*x))}.
@item gauss(x)
Compute Gauss function of @var{x}, corresponding to
@code{exp(-x*x/2) / sqrt(2*PI)}.
@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 gt(x, y)
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
@item gte(x, y)
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
@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 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 if(x, y, z)
Evaluate @var{x}, and if the result is non-zero return the evaluation
result of @var{y}, otherwise the evaluation result of @var{z}.
@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.
@item ifnot(x, y, z)
Evaluate @var{x}, and if the result is zero return the evaluation
result of @var{y}, otherwise the evaluation result of @var{z}.
@item isinf(x)
Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
@item isnan(x)
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
@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}).
The function returns the loaded value.
@item log(x)
Compute natural logarithm of @var{x}.
@item lt(x, y)
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
@item lte(x, y)
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
@item mod(x, y)
Compute the remainder of division of @var{x} by @var{y}.
@item max(x, y)
Return the maximum between @var{x} and @var{y}.
@@ -114,53 +78,20 @@ Return the maximum between @var{x} and @var{y}.
@item min(x, y)
Return the maximum between @var{x} and @var{y}.
@item mod(x, y)
Compute the remainder of division of @var{x} by @var{y}.
@item eq(x, y)
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
@item not(expr)
Return 1.0 if @var{expr} is zero, 0.0 otherwise.
@item gte(x, y)
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
@item pow(x, y)
Compute the power of @var{x} elevated @var{y}, it is equivalent to
"(@var{x})^(@var{y})".
@item gt(x, y)
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
@item print(t)
@item print(t, l)
Print the value of expression @var{t} with loglevel @var{l}. If
@var{l} is not specified then a default log level is used.
Returns the value of the expression printed.
@item lte(x, y)
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
Prints t with loglevel l
@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 root(expr, max)
Find an input value for which the function represented by @var{expr}
with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
The expression in @var{expr} must denote a continuous function or the
result is undefined.
@var{ld(0)} is used to represent the function input value, which means
that the given expression will be evaluated multiple times with
various input values that the expression can access through
@code{ld(0)}. When the expression evaluates to 0 then the
corresponding input value will be returned.
@item sin(x)
Compute sine of @var{x}.
@item sinh(x)
Compute hyperbolic sine of @var{x}.
@item sqrt(expr)
Compute the square root of @var{expr}. This is equivalent to
"(@var{expr})^.5".
@item squish(x)
Compute expression @code{1/(1 + exp(4*x))}.
@item lt(x, y)
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
@item st(var, expr)
Allow to store the value of the expression @var{expr} in an internal
@@ -169,38 +100,72 @@ 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 tan(x)
Compute tangent of @var{x}.
@item tanh(x)
Compute hyperbolic tangent of @var{x}.
@item taylor(expr, x)
@item taylor(expr, x, id)
Evaluate a Taylor series at @var{x}, given an expression representing
the @code{ld(id)}-th derivative of a function at 0.
When the series does not converge the result is undefined.
@var{ld(id)} is used to represent the derivative order in @var{expr},
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
Note, when you have the derivatives at y instead of 0,
@code{taylor(expr, x-y)} can be used.
@item time(0)
Return the current (wallclock) time in seconds.
@item trunc(expr)
Round the value of expression @var{expr} towards zero to the nearest
integer. For example, "trunc(-1.5)" is "-1.0".
@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}).
The function returns the loaded value.
@item while(cond, expr)
Evaluate expression @var{expr} while the expression @var{cond} is
non-zero, and returns the value of the last @var{expr} evaluation, or
NAN if @var{cond} was always false.
@item ceil(expr)
Round the value of expression @var{expr} upwards to the nearest
integer. For example, "ceil(1.5)" is "2.0".
@item floor(expr)
Round the value of expression @var{expr} downwards to the nearest
integer. For example, "floor(-1.5)" is "-2.0".
@item trunc(expr)
Round the value of expression @var{expr} towards zero to the nearest
integer. For example, "trunc(-1.5)" is "-1.0".
@item sqrt(expr)
Compute the square root of @var{expr}. This is equivalent to
"(@var{expr})^.5".
@item not(expr)
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.
@item taylor(expr, x) taylor(expr, x, id)
Evaluate a taylor series at x.
expr represents the LD(id)-th derivates of f(x) at 0. If id is not specified
then 0 is assumed.
note, when you have the derivatives at y instead of 0
taylor(expr, x-y) can be used
When the series does not converge the results are undefined.
@item root(expr, max)
Finds x where f(x)=0 in the interval 0..max.
f() must be continuous or the result is undefined.
@end table
The following constants are available:
@@ -220,69 +185,68 @@ value, note that:
@code{+} works like OR
For example the construct:
and the construct:
@example
if (A AND B) then C
if A then B else C
@end example
is equivalent to:
is equivalent to
@example
if(A*B, C)
if(A,B) + ifnot(A,C)
@end example
In your C code, you can extend the list of unary and binary functions,
and define recognized constants, so that they are available for your
expressions.
The evaluator also recognizes the International System unit prefixes.
If 'i' is appended after the prefix, binary prefixes are used, which
are based on powers of 1024 instead of powers of 1000.
The 'B' postfix multiplies the value by 8, and can be appended after a
unit prefix or used alone. This allows using for example 'KB', 'MiB',
'G' and 'B' as number postfix.
The evaluator also recognizes the International System number
postfixes. 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.
The list of available International System prefixes follows, with
Follows the list of available International System postfixes, with
indication of the corresponding powers of 10 and of 2.
@table @option
@item y
10^-24 / 2^-80
-24 / -80
@item z
10^-21 / 2^-70
-21 / -70
@item a
10^-18 / 2^-60
-18 / -60
@item f
10^-15 / 2^-50
-15 / -50
@item p
10^-12 / 2^-40
-12 / -40
@item n
10^-9 / 2^-30
-9 / -30
@item u
10^-6 / 2^-20
-6 / -20
@item m
10^-3 / 2^-10
-3 / -10
@item c
10^-2
-2
@item d
10^-1
-1
@item h
10^2
2
@item k
10^3 / 2^10
3 / 10
@item K
10^3 / 2^10
3 / 10
@item M
10^6 / 2^20
6 / 20
@item G
10^9 / 2^30
9 / 30
@item T
10^12 / 2^40
12 / 40
@item P
10^15 / 2^40
15 / 40
@item E
10^18 / 2^50
18 / 50
@item Z
10^21 / 2^60
21 / 60
@item Y
10^24 / 2^70
24 / 70
@end table
@c man end

View File

@@ -98,7 +98,7 @@ static int decode_packet(int *got_frame, int cached)
audio_frame_count++, frame->nb_samples,
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, av_frame_get_channels(frame),
ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, frame->channels,
frame->nb_samples, frame->format, 1);
if (ret < 0) {
fprintf(stderr, "Could not allocate audio buffer\n");
@@ -107,13 +107,13 @@ static int decode_packet(int *got_frame, int cached)
/* TODO: extend return code of the av_samples_* functions so that this call is not needed */
audio_dst_bufsize =
av_samples_get_buffer_size(NULL, av_frame_get_channels(frame),
av_samples_get_buffer_size(NULL, frame->channels,
frame->nb_samples, frame->format, 1);
/* copy audio data to destination buffer:
* this is required since rawaudio expects non aligned data */
av_samples_copy(audio_dst_data, frame->data, 0, 0,
frame->nb_samples, av_frame_get_channels(frame), frame->format);
frame->nb_samples, frame->channels, frame->format);
/* write to rawaudio file */
fwrite(audio_dst_data[0], 1, audio_dst_bufsize, audio_dst_file);
@@ -292,10 +292,8 @@ int main (int argc, char **argv)
printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);
/* read frames from the file */
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
while (av_read_frame(fmt_ctx, &pkt) >= 0)
decode_packet(&got_frame, 0);
av_free_packet(&pkt);
}
/* flush cached frames */
pkt.data = NULL;

View File

@@ -169,13 +169,9 @@ int main(int argc, char **argv)
{
int ret;
AVPacket packet;
AVFrame *frame = avcodec_alloc_frame();
AVFrame frame;
int got_frame;
if (!frame) {
perror("Could not allocate frame");
exit(1);
}
if (argc != 2) {
fprintf(stderr, "Usage: %s file | %s\n", argv[0], player);
exit(1);
@@ -197,9 +193,9 @@ int main(int argc, char **argv)
break;
if (packet.stream_index == audio_stream_index) {
avcodec_get_frame_defaults(frame);
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_audio4(dec_ctx, frame, &got_frame, &packet);
ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
continue;
@@ -207,7 +203,7 @@ int main(int argc, char **argv)
if (got_frame) {
/* push the audio data from decoded frame into the filtergraph */
if (av_buffersrc_add_frame(buffersrc_ctx, frame, 0) < 0) {
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n");
break;
}
@@ -233,7 +229,6 @@ end:
if (dec_ctx)
avcodec_close(dec_ctx);
avformat_close_input(&fmt_ctx);
av_freep(&frame);
if (ret < 0 && ret != AVERROR_EOF) {
char buf[1024];

View File

@@ -173,13 +173,9 @@ int main(int argc, char **argv)
{
int ret;
AVPacket packet;
AVFrame *frame = avcodec_alloc_frame();
AVFrame frame;
int got_frame;
if (!frame) {
perror("Could not allocate frame");
exit(1);
}
if (argc != 2) {
fprintf(stderr, "Usage: %s file\n", argv[0]);
exit(1);
@@ -201,19 +197,19 @@ int main(int argc, char **argv)
break;
if (packet.stream_index == video_stream_index) {
avcodec_get_frame_defaults(frame);
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, &packet);
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
break;
}
if (got_frame) {
frame->pts = av_frame_get_best_effort_timestamp(frame);
frame.pts = av_frame_get_best_effort_timestamp(&frame);
/* push the decoded frame into the filtergraph */
if (av_buffersrc_add_frame(buffersrc_ctx, frame, 0) < 0) {
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
break;
}
@@ -240,7 +236,6 @@ end:
if (dec_ctx)
avcodec_close(dec_ctx);
avformat_close_input(&fmt_ctx);
av_freep(&frame);
if (ret < 0 && ret != AVERROR_EOF) {
char buf[1024];

View File

@@ -86,6 +86,7 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
break;
case AVMEDIA_TYPE_VIDEO:
avcodec_get_context_defaults3(c, *codec);
c->codec_id = codec_id;
c->bit_rate = 400000;
@@ -395,7 +396,7 @@ int main(int argc, char **argv)
AVStream *audio_st, *video_st;
AVCodec *audio_codec, *video_codec;
double audio_pts, video_pts;
int ret;
int ret, i;
/* Initialize libavcodec, and register all codecs and formats. */
av_register_all();
@@ -503,12 +504,18 @@ int main(int argc, char **argv)
if (audio_st)
close_audio(oc, audio_st);
/* Free the streams. */
for (i = 0; i < oc->nb_streams; i++) {
av_freep(&oc->streams[i]->codec);
av_freep(&oc->streams[i]);
}
if (!(fmt->flags & AVFMT_NOFILE))
/* Close the output file. */
avio_close(oc->pb);
/* free the stream */
avformat_free_context(oc);
av_free(oc);
return 0;
}

View File

@@ -107,7 +107,7 @@ int main(int argc, char **argv)
goto end;
}
/* buffer is going to be written to rawvideo file, no alignment */
/* buffer is going to be written to rawvideo file, no alignmnet */
if ((ret = av_image_alloc(dst_data, dst_linesize,
dst_w, dst_h, dst_pix_fmt, 1)) < 0) {
fprintf(stderr, "Could not allocate destination image\n");

View File

@@ -294,12 +294,8 @@ your format doesn't support file level concatenation.
@subsection Concatenating using the concat @emph{protocol} (file level)
FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
@code{concat}} protocol designed specifically for that, with examples in the
documentation.
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
video by merely concatenating the files containing them.
video by merely concatenating the files them.
Hence you may concatenate your multimedia files by first transcoding them to
these privileged formats, then using the humble @code{cat} command (or the

View File

@@ -17,7 +17,6 @@ the libavcodec library.
@c man end DESCRIPTION
@anchor{codec-options}
@chapter Codec Options
@c man begin CODEC OPTIONS
@@ -1099,9 +1098,6 @@ Set sample format audio decoders should prefer. Default value is
@code{none}.
@item pkt_timebase @var{rational number}
@item sub_charenc @var{encoding} (@emph{decoding,subtitles})
Set the input subtitles character encoding.
@end table
@c man end CODEC OPTIONS

View File

@@ -76,13 +76,8 @@ Enable RTP MP4A-LATM payload.
Reduce the latency introduced by optional buffering
@end table
@item seek2any @var{integer} (@emph{input})
Forces seeking to enable seek to any mode if set to 1. Default is 0.
@item analyzeduration @var{integer} (@emph{input})
Specify how many microseconds are analyzed to probe the input. A
higher value will allow to detect more accurate information, but will
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
Specify how many microseconds are analyzed to estimate duration.
@item cryptokey @var{hexadecimal string} (@emph{input})
Set decryption key.
@@ -145,12 +140,6 @@ Use wallclock as timestamps.
@item avoid_negative_ts @var{integer} (@emph{output})
Shift timestamps to make them positive. 1 enables, 0 disables, default
of -1 enables when required by target format.
@item skip_initial_bytes @var{integer} (@emph{input})
Set number initial bytes to skip. Default is 0.
@item correct_ts_overflow @var{integer} (@emph{input})
Correct single timestamp overflows if set to 1. Default is 1.
@end table
@c man end FORMAT OPTIONS

View File

@@ -43,7 +43,7 @@ value is not mandatory if the corresponding channel layout
@option{out_channel_layout} is set.
@item uch, used_channel_count
Set the number of used input channels. Default value is 0. This option is
Set the number of used channels. Default value is 0. This option is
only used for special remapping.
@item isr, in_sample_rate
@@ -60,7 +60,6 @@ Specify the output sample format. It is set by default to @code{none}.
@item tsf, internal_sample_fmt
Set the internal sample format. Default value is @code{none}.
This will automatically be chosen when it is not explicitly set.
@item icl, in_channel_layout
Set the input channel layout.
@@ -69,17 +68,15 @@ Set the input channel layout.
Set the output channel layout.
@item clev, center_mix_level
Set the center mix level. It is a value expressed in deciBel, and must be
in the interval [-32,32].
Set center mix level. It is a value expressed in deciBel, and must be
inclusively included between -32 and +32.
@item slev, surround_mix_level
Set the surround mix level. It is a value expressed in deciBel, and must
be in the interval [-32,32].
Set surround mix level. It is a value expressed in deciBel, and must
be inclusively included between -32 and +32.
@item lfe_mix_level
Set LFE mix into non LFE level. It is used when there is a LFE input but no
LFE output. It is a value expressed in deciBel, and must
be in the interval [-32,32].
@item lfe_mix_evel
Set LFE mix level.
@item rmvol, rematrix_volume
Set rematrix volume. Default value is 1.0.
@@ -90,8 +87,7 @@ Set flags used by the converter. Default value is 0.
It supports the following individual flags:
@table @option
@item res
force resampling, this flag forces resampling to be used even when the
input and output sample rates match.
force resampling
@end table
@item dither_scale
@@ -108,21 +104,6 @@ select rectangular dither
select triangular dither
@item triangular_hp
select triangular dither with high pass
@item lipshitz
select lipshitz noise shaping dither
@item shibata
select shibata noise shaping dither
@item low_shibata
select low shibata noise shaping dither
@item high_shibata
select high shibata noise shaping dither
@item f_weighted
select f-weighted noise shaping dither
@item modified_e_weighted
select modified-e-weighted noise shaping dither
@item improved_e_weighted
select improved-e-weighted noise shaping dither
@end table
@item resampler
@@ -143,8 +124,8 @@ case.
For swr only, set resampling filter size, default value is 32.
@item phase_shift
For swr only, set resampling phase shift, default value is 10, and must be in
the interval [0,30].
For swr only, set resampling phase shift, default value is 10, must be included
between 0 and 30.
@item linear_interp
Use Linear Interpolation if set to 1, default value is 0.
@@ -172,14 +153,6 @@ may be stretched or squeezed for each second.
Default value is 0, thus no compensation is applied to make the samples match
the audio timestamps.
@item first_pts
For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
This allows for padding/trimming at the start of stream. By default, no
assumption is made about the first frame's expected pts, so no padding or
trimming is done. For example, this could be set to 0 to pad the beginning with
silence if an audio stream starts after the video stream or to trim any samples
with a negative pts due to encoder delay.
@item min_comp
For swr only, set the minimum difference between timestamps and audio data (in
seconds) to trigger stretching/squeezing/filling or trimming of the
@@ -235,8 +208,8 @@ select Kaiser Windowed Sinc
@end table
@item kaiser_beta
For swr only, set Kaiser Window Beta value. Must be an integer in the
interval [2,16], default value is 9.
For swr only, set Kaiser Window Beta value. Must be an integer included between
2 and 16, default value is 9.
@end table

View File

@@ -256,14 +256,6 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
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.
-to and -t are mutually exclusive and -t has priority.
@item -to @var{position} (@emph{output})
Stop writing the output at @var{position}.
@var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
-to and -t are mutually exclusive and -t has priority.
@item -fs @var{limit_size} (@emph{output})
Set the file size limit, expressed in bytes.
@@ -342,21 +334,13 @@ Stop writing to the stream after @var{framecount} frames.
Use fixed quality scale (VBR). The meaning of @var{q} is
codec-dependent.
@anchor{filter_option}
@item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
Create the filter graph specified by @var{filter_graph} and use it to
filter the stream.
@var{filter_graph} is a description of the filter graph to apply to
the stream, and must have a single input and a single output of the
same type of the stream. In the filter graph, the input is associated
to the label @code{in}, and the output to the label @code{out}. See
the ffmpeg-filters manual for more information about the filtergraph
syntax.
See the @ref{filter_complex_option,,-filter_complex option} if you
want to create filter graphs with multiple inputs and/or outputs.
the stream. Use @code{-filters} to show all the available filters
(including also sources and sinks).
See also the @option{-filter_complex} option if you want to create filter graphs
with multiple inputs and/or outputs.
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
Specify the preset for matching stream(s).
@@ -411,11 +395,11 @@ will be used.
E.g. to extract the first attachment to a file named 'out.ttf':
@example
ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
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 "" -i INPUT
ffmpeg -dump_attachment:t "" INPUT
@end example
Technical note -- attachments are implemented as codec extradata, so this
@@ -459,6 +443,21 @@ form @var{num}:@var{den}, where @var{num} and @var{den} are the
numerator and denominator of the aspect ratio. For example "4:3",
"16:9", "1.3333", and "1.7777" are valid argument values.
@item -croptop @var{size}
@item -cropbottom @var{size}
@item -cropleft @var{size}
@item -cropright @var{size}
All the crop options have been removed. Use -vf
crop=width:height:x:y instead.
@item -padtop @var{size}
@item -padbottom @var{size}
@item -padleft @var{size}
@item -padright @var{size}
@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})
Disable video recording.
@@ -488,10 +487,11 @@ stream
Set the ISO 639 language code (3 letters) of the current video stream.
@item -vf @var{filter_graph} (@emph{output})
Create the filter graph specified by @var{filter_graph} and use it to
filter the stream.
@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}.
This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}.
@end table
@section Advanced Video Options
@@ -545,58 +545,12 @@ Force video tag/fourcc. This is an alias for @code{-tag:v}.
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})
@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
Force key frames at the specified timestamps, more precisely at the first
frames after each specified time.
If the argument is prefixed with @code{expr:}, the string @var{expr}
is interpreted like an expression and is evaluated for each frame. A
key frame is forced in case the evaluation is non-zero.
If one of the times is "@code{chapters}[@var{delta}]", it is expanded into
the time of the beginning of all chapters in the file, shifted by
@var{delta}, expressed as a time in seconds.
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.
For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
before the beginning of every chapter:
@example
-force_key_frames 0:05:00,chapters-0.1
@end example
The expression in @var{expr} can contain the following constants:
@table @option
@item n
the number of current processed frame, starting from 0
@item n_forced
the number of forced frames
@item prev_forced_n
the number of the previous forced frame, it is @code{NAN} when no
keyframe was forced yet
@item prev_forced_t
the time of the previous forced frame, it is @code{NAN} when no
keyframe was forced yet
@item t
the time of the current processed frame
@end table
For example to force a key frame every 5 seconds, you can specify:
@example
-force_key_frames expr:gte(t,n_forced*5)
@end example
To force a key frame 5 seconds after the time of the last forced one,
starting from second 13:
@example
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
@end example
Note that forcing too many keyframes is very harmful for the lookahead
algorithms of certain encoders: using fixed-GOP options or similar
would be more efficient.
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
@@ -627,12 +581,11 @@ 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 -af @var{filter_graph} (@emph{output})
Create the filter graph specified by @var{filter_graph} and use it to
filter the stream.
This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter option}.
@var{filter_graph} is a description of the filter graph to apply to
the input audio.
Use the option "-filters" to show all the available filters (including
also sources and sinks). This is an alias for @code{-filter:a}.
@end table
@section Advanced Audio options:
@@ -642,12 +595,6 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
@item -absf @var{bitstream_filter}
Deprecated, see -bsf
@item -guess_layout_max @var{channels} (@emph{input,per-stream})
If some input channel layout is not known, try to guess only if it
corresponds to at most the specified number of channels. For example, 2
tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
0 to disable all guessing.
@end table
@section Subtitle options:
@@ -981,7 +928,6 @@ Specify Timecode for writing. @var{SEP} is ':' for non drop timecode and ';'
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
@end example
@anchor{filter_complex_option}
@item -filter_complex @var{filtergraph} (@emph{global})
Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
outputs. For simple graphs -- those with one input and one output of the same
@@ -1026,13 +972,13 @@ ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
To generate 5 seconds of pure red video using lavfi @code{color} source:
@example
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
ffmpeg -filter_complex 'color=red' -t 5 out.mkv
@end example
@end table
As a special exception, you can use a bitmap subtitle stream as input: it
will be converted into a video with the same size as the largest video in
the file, or 720x576 if no video is present. Note that this is an
the file, or 720×576 if no video is present. Note that this is an
experimental and temporary solution. It will be removed once libavfilter has
proper support for subtitles.
@@ -1338,7 +1284,7 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
@url{ffmpeg-scaler.html,ffmpeg-scaler},
@url{ffmpeg-resampler.html,ffmpeg-resampler},
@url{ffmpeg-codecs.html,ffmpeg-codecs},
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
@url{ffmpeg-formats.html,ffmpeg-formats},
@url{ffmpeg-devices.html,ffmpeg-devices},
@url{ffmpeg-protocols.html,ffmpeg-protocols},

View File

@@ -74,15 +74,10 @@ You can interactively cycle through the available show modes by
pressing the key @key{w}.
@item -vf @var{filter_graph}
Create the filter graph specified by @var{filter_graph} and use it to
filter the video stream.
@var{filter_graph} is a description of the filter graph to apply to
the stream, and must have a single video input and a single video
output. In the filter graph, the input is associated to the label
@code{in}, and the output to the label @code{out}. See the
ffmpeg-filters manual for more information about the filtergraph
syntax.
the input video.
Use the option "-filters" to show all the available filters (including
also sources and sinks).
@item -i @var{input_file}
Read @var{input_file}.
@@ -199,7 +194,7 @@ Seek to percentage in file corresponding to fraction of width.
@url{ffmpeg-scaler.html,ffmpeg-scaler},
@url{ffmpeg-resampler.html,ffmpeg-resampler},
@url{ffmpeg-codecs.html,ffmpeg-codecs},
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
@url{ffmpeg-formats.html,ffmpeg-formats},
@url{ffmpeg-devices.html,ffmpeg-devices},
@url{ffmpeg-protocols.html,ffmpeg-protocols},

View File

@@ -495,7 +495,7 @@ DV, GXF and AVI timecodes are available in format metadata
@url{ffmpeg-scaler.html,ffmpeg-scaler},
@url{ffmpeg-resampler.html,ffmpeg-resampler},
@url{ffmpeg-codecs.html,ffmpeg-codecs},
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
@url{ffmpeg-formats.html,ffmpeg-formats},
@url{ffmpeg-devices.html,ffmpeg-devices},
@url{ffmpeg-protocols.html,ffmpeg-protocols},

View File

@@ -16,28 +16,34 @@ ffserver [@var{options}]
@chapter Description
@c man begin DESCRIPTION
@command{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
@file{ffserver.conf}).
ffserver is a streaming server for both audio and video. It supports
@command{ffserver} receives prerecorded files or FFM streams from some
@command{ffmpeg} instance as input, then streams them over
RTP/RTSP/HTTP.
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).
An @command{ffserver} instance will listen on some port as specified
in the configuration file. You can launch one or more instances of
@command{ffmpeg} and send one or more FFM streams to the port where
ffserver is expecting to receive them. Alternately, you can make
@command{ffserver} launch such @command{ffmpeg} instances at startup.
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
information.
Input streams are called feeds, and each one is specified by a
@code{<Feed>} section in the configuration file.
@section How does it work?
ffserver receives prerecorded files or FFM streams from some ffmpeg
instance as input, then streams them over RTP/RTSP/HTTP.
An ffserver instance will listen on some port as specified in the
configuration file. You can launch one or more instances of ffmpeg and
send one or more FFM streams to the port where ffserver is expecting
to receive them. Alternately, you can make ffserver launch such ffmpeg
instances at startup.
Input streams are called feeds, and each one is specified by a <Feed>
section in the configuration file.
For each feed you can have different output streams in various
formats, each one specified by a @code{<Stream>} section in the
configuration file.
formats, each one specified by a <Stream> section in the configuration
file.
@section Status stream
@@ -73,6 +79,14 @@ web server can be used to serve up the files just as well.
It can stream prerecorded video from .ffm files, though it is somewhat tricky
to make it work correctly.
@section What do I need?
I use Linux on a 900 MHz Duron with a cheap Bt848 based TV capture card. I'm
using stock Linux 2.4.17 with the stock drivers. [Actually that isn't true,
I needed some special drivers for my motherboard-based sound card.]
I understand that FreeBSD systems work just fine as well.
@section How do I make it work?
First, build the kit. It *really* helps to have installed LAME first. Then when
@@ -221,7 +235,7 @@ of an infinite movie or a whole movie.
FFM is version specific, and there is limited compatibility of FFM files
generated by one version of ffmpeg/ffserver and another version of
ffmpeg/ffserver. It may work but it is not guaranteed to work.
ffmpeg/ffserver. It may work but its not guaranteed to work.
FFM2 is extensible while maintaining compatibility and should work between
differing versions of tools. FFM2 is the default.
@@ -255,7 +269,7 @@ The @file{doc/ffserver.conf} example,
@url{ffmpeg-scaler.html,ffmpeg-scaler},
@url{ffmpeg-resampler.html,ffmpeg-resampler},
@url{ffmpeg-codecs.html,ffmpeg-codecs},
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
@url{ffmpeg-formats.html,ffmpeg-formats},
@url{ffmpeg-devices.html,ffmpeg-devices},
@url{ffmpeg-protocols.html,ffmpeg-protocols},

View File

@@ -15,13 +15,13 @@ Format negotiation
the list of supported formats.
For video links, that means pixel format. For audio links, that means
channel layout, sample format (the sample packing is implied by the sample
format) and sample rate.
channel layout, and sample format (the sample packing is implied by the
sample format).
The lists are not just lists, they are references to shared objects. When
the negotiation mechanism computes the intersection of the formats
supported at each end of a link, all references to both lists are replaced
with a reference to the intersection. And when a single format is
supported at each ends of a link, all references to both lists are
replaced with a reference to the intersection. And when a single format is
eventually chosen for a link amongst the remaining list, again, all
references to the list are updated.
@@ -68,15 +68,15 @@ Buffer references ownership and permissions
Here are the (fairly obvious) rules for reference ownership:
* A reference received by the filter_frame method (or its start_frame
deprecated version) belongs to the corresponding filter.
* A reference received by the start_frame or filter_frame method
belong to the corresponding filter.
Special exception: for video references: the reference may be used
internally for automatic copying and must not be destroyed before
end_frame; it can be given away to ff_start_frame.
* A reference passed to ff_filter_frame (or the deprecated
ff_start_frame) is given away and must no longer be used.
* A reference passed to ff_start_frame or ff_filter_frame is given
away and must no longer be used.
* A reference created with avfilter_ref_buffer belongs to the code that
created it.
@@ -90,11 +90,27 @@ Buffer references ownership and permissions
Link reference fields
---------------------
The AVFilterLink structure has a few AVFilterBufferRef fields. The
cur_buf and out_buf were used with the deprecated
start_frame/draw_slice/end_frame API and should no longer be used.
src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
and must not be accessed by filters.
The AVFilterLink structure has a few AVFilterBufferRef fields. Here are
the rules to handle them:
* cur_buf is set before the start_frame and filter_frame methods to
the same reference given as argument to the methods and belongs to the
destination filter of the link. If it has not been cleared after
end_frame or filter_frame, libavfilter will automatically destroy
the reference; therefore, any filter that needs to keep the reference
for longer must set cur_buf to NULL.
* out_buf belongs to the source filter of the link and can be used to
store a reference to the buffer that has been sent to the destination.
If it is not NULL after end_frame or filter_frame, libavfilter will
automatically destroy the reference.
If a video input pad does not have a start_frame method, the default
method will request a buffer on the first output of the filter, store
the reference in out_buf and push a second reference to the output.
* src_buf, cur_buf_copy and partial_buf are used by libavfilter
internally and must not be accessed by filters.
Reference permissions
---------------------
@@ -103,10 +119,8 @@ Buffer references ownership and permissions
the code that owns the reference is allowed to do to the buffer data.
Different references for the same buffer can have different permissions.
For video filters that implement the deprecated
start_frame/draw_slice/end_frame API, the permissions only apply to the
parts of the buffer that have already been covered by the draw_slice
method.
For video filters, the permissions only apply to the parts of the buffer
that have already been covered by the draw_slice method.
The value is a binary OR of the following constants:
@@ -165,9 +179,9 @@ Buffer references ownership and permissions
with the WRITE permission.
* Filters that intend to keep a reference after the filtering process
is finished (after filter_frame returns) must have the PRESERVE
permission on it and remove the WRITE permission if they create a new
reference to give it away.
is finished (after end_frame or filter_frame returns) must have the
PRESERVE permission on it and remove the WRITE permission if they
create a new reference to give it away.
* Filters that intend to modify a reference they have kept after the end
of the filtering process need the REUSE2 permission and must remove
@@ -184,11 +198,11 @@ Frame scheduling
Simple filters that output one frame for each input frame should not have
to worry about it.
filter_frame
------------
start_frame / filter_frame
----------------------------
This method is called when a frame is pushed to the filter's input. It
can be called at any time except in a reentrant way.
These methods are called when a frame is pushed to the filter's input.
They can be called at any time except in a reentrant way.
If the input frame is enough to produce output, then the filter should
push the output frames on the output link immediately.
@@ -199,7 +213,7 @@ Frame scheduling
filter; these buffered frames must be flushed immediately if a new input
produces new output.
(Example: framerate-doubling filter: filter_frame must (1) flush the
(Example: framerate-doubling filter: start_frame must (1) flush the
second copy of the previous frame, if it is still there, (2) push the
first copy of the incoming frame, (3) keep the second copy for later.)
@@ -219,8 +233,8 @@ Frame scheduling
This method is called when a frame is wanted on an output.
For an input, it should directly call filter_frame on the corresponding
output.
For an input, it should directly call start_frame or filter_frame on
the corresponding output.
For a filter, if there are queued frames already ready, one of these
frames should be pushed. If not, the filter should request a frame on
@@ -241,7 +255,7 @@ Frame scheduling
}
while (!frame_pushed) {
input = input_where_a_frame_is_most_needed();
ret = ff_request_frame(input);
ret = avfilter_request_frame(input);
if (ret == AVERROR_EOF) {
process_eof_on_input();
} else if (ret < 0) {
@@ -252,14 +266,4 @@ Frame scheduling
Note that, except for filters that can have queued frames, request_frame
does not push frames: it requests them to its input, and as a reaction,
the filter_frame method will be called and do the work.
Legacy API
==========
Until libavfilter 3.23, the filter_frame method was split:
- for video filters, it was made of start_frame, draw_slice (that could be
called several times on distinct parts of the frame) and end_frame;
- for audio filters, it was called filter_samples.
the start_frame / filter_frame method will be called and do the work.

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ instructions. To enable using OpenJPEG in FFmpeg, pass @code{--enable-libopenjp
@file{./configure}.
@section OpenCORE, VisualOn, and Fraunhofer libraries
@section OpenCORE and VisualOn libraries
Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
libraries provide encoders for a number of audio codecs.
@@ -32,14 +32,9 @@ 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 to the LGPL version 2.1 and GPL version 2. You have to
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) by passing @code{--enable-version3} to configure in
order to use it.
The Fraunhofer AAC library is licensed under a license incompatible to the GPL
and is not known to be compatible to the LGPL. Therefore, you have to pass
@code{--enable-nonfree} to configure to use it.
GPL components, GPL version 3) to use it.
@end float
@subsection OpenCORE AMR
@@ -819,7 +814,6 @@ following image formats are supported:
@item DSP Group TrueSpeech @tab @tab X
@item DV audio @tab @tab X
@item Enhanced AC-3 @tab X @tab X
@item EVRC (Enhanced Variable Rate Codec) @tab @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

View File

@@ -583,16 +583,10 @@ command:
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
@end example
@section video4linux2, v4l2
@section video4linux2
Video4Linux2 input video device.
"v4l2" can be used as alias for "video4linux2".
If FFmpeg is built with v4l-utils support (by using the
@code{--enable-libv4l2} configure option), the device will always rely
on libv4l2.
The name of the device to grab is a file device node, usually Linux
systems tend to automatically create such nodes when the device
(e.g. an USB webcam) is plugged into the system, and has a name of the
@@ -602,8 +596,8 @@ the device.
Video4Linux2 devices usually support a limited set of
@var{width}x@var{height} sizes and framerates. You can check which are
supported using @command{-list_formats all} for Video4Linux2 devices.
Some devices, like TV cards, support one or more standards. It is possible
to list all the supported standards using @command{-list_standards all}.
Some usage examples of the video4linux2 devices with ffmpeg and ffplay:
The time base for the timestamps is 1 microsecond. Depending on the kernel
version and configuration, the timestamps may be derived from the real time
@@ -612,93 +606,19 @@ boot time, unaffected by NTP or manual changes to the clock). The
@option{-timestamps abs} or @option{-ts abs} option can be used to force
conversion into the real time clock.
Some usage examples of the video4linux2 device with @command{ffmpeg}
and @command{ffplay}:
@itemize
@item
Grab and show the input of a video4linux2 device:
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
option), it will always be used.
@example
# Grab and show the input of a video4linux2 device.
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
@end example
@item
Grab and record the input of a video4linux2 device, leave the
framerate and size as previously set:
@example
# Grab and record the input of a video4linux2 device, leave the
framerate and size as previously set.
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
@end example
@end itemize
For more information about Video4Linux, check @url{http://linuxtv.org/}.
@subsection Options
@table @option
@item standard
Set the standard. Must be the name of a supported standard. To get a
list of the supported standards, use the @option{list_standards}
option.
@item channel
Set the input channel number. Default to 0.
@item video_size
Set the video frame size. The argument must be a string in the form
@var{WIDTH}x@var{HEIGHT} or a valid size abbreviation.
@item pixel_format
Select the pixel format (only valid for raw video input).
@item input_format
Set the preferred pixel format (for raw video) or a codec name.
This option allows to select the input format, when several are
available.
@item framerate
Set the preferred video framerate.
@item list_formats
List available formats (supported pixel formats, codecs, and frame
sizes) and exit.
Available values are:
@table @samp
@item all
Show all available (compressed and non-compressed) formats.
@item raw
Show only raw video (non-compressed) formats.
@item compressed
Show only compressed formats.
@end table
@item list_standards
List supported standards and exit.
Available values are:
@table @samp
@item all
Show all supported standards.
@end table
@item timestamps, ts
Set type of timestamps for grabbed frames.
Available values are:
@table @samp
@item default
Use timestamps from the kernel.
@item abs
Use absolute timestamps (wall clock).
@item mono2abs
Force conversion from monotonic to absolute timestamps.
@end table
Default value is @code{default}.
@end table
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
"video4linux2".
@section vfwcap

View File

@@ -24,7 +24,7 @@ a mail for every change to every issue.
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
Type:
-----

View File

@@ -18,23 +18,6 @@ enabled muxers.
A description of some of the currently available muxers follows.
@anchor{aiff}
@section aiff
Audio Interchange File Format muxer.
It accepts the following options:
@table @option
@item write_id3v2
Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
@item id3v2_version
Select ID3v2 version to write. Currently only version 3 and 4 (aka.
ID3v2.3 and ID3v2.4) are supported. The default is version 4.
@end table
@anchor{crc}
@section crc
@@ -258,13 +241,8 @@ ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
@end example
@table @option
@item start_number @var{number}
Start the sequence from @var{number}. Default value is 1. Must be a
positive number.
@item updatefirst 1|0
If set to 1, update the first written image file again and
again. Default value is 0.
@item -start_number @var{number}
Start the sequence from @var{number}.
@end table
The image muxer supports the .Y.U.V image file format. This format is
@@ -368,8 +346,6 @@ This option is implicitly set when writing ismv (Smooth Streaming) files.
Run a second pass moving the moov atom on top of the file. This
operation can take a while, and will not work in various situations such
as fragmented output, thus it is not enabled by default.
@item -movflags rtphint
Add RTP hinting tracks to the output file.
@end table
Smooth Streaming content can be pushed in real time to a publishing
@@ -545,11 +521,9 @@ reference stream. The default value is ``auto''.
@item segment_format @var{format}
Override the inner container format, by default it is guessed by the filename
extension.
@item segment_list @var{name}
Generate also a listfile named @var{name}. If not specified no
listfile is generated.
@item segment_list_flags @var{flags}
Set flags affecting the segment list generation.
@@ -560,15 +534,17 @@ Allow caching (only affects M3U8 list files).
@item live
Allow live-friendly file generation.
This currently only affects M3U8 lists. In particular, write a fake
EXT-X-TARGETDURATION duration field at the top of the file, based on
the specified @var{segment_time}.
@end table
Default value is @code{cache}.
@item segment_list_size @var{size}
Update the list file so that it contains at most the last @var{size}
segments. If 0 the list file will contain all the segments. Default
value is 0.
Overwrite the listfile once it reaches @var{size} entries. If 0
the listfile is never overwritten. Default value is 0.
@item segment_list type @var{type}
Specify the format for the segment list file.
@@ -596,34 +572,19 @@ auto-select this format.
@code{ext} is deprecated in favor or @code{csv}.
@item ffconcat
Generate an ffconcat file for the created segments. The resulting file
can be read using the FFmpeg @ref{concat} demuxer.
A list file with the suffix @code{".ffcat"} or @code{".ffconcat"} will
auto-select this format.
@item m3u8
Generate an extended M3U8 file, version 3, compliant with
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming}.
Generate an extended M3U8 file, version 4, compliant with
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
A list file with the suffix @code{".m3u8"} will auto-select this format.
@end table
If not specified the type is guessed from the list file name suffix.
@item segment_time @var{time}
Set segment duration to @var{time}, the value must be a duration
specification. Default value is "2". See also the
@option{segment_times} option.
Note that splitting may not be accurate, unless you force the
reference stream key-frames at the given time. See the introductory
notice and the examples below.
Set segment duration to @var{time}. Default value is "2".
@item segment_time_delta @var{delta}
Specify the accuracy time when selecting the start time for a
segment, expressed as a duration specification. Default value is "0".
segment. Default value is "0".
When delta is specified a key-frame will start a new segment if its
PTS satisfies the relation:
@@ -645,8 +606,7 @@ the specified time and the time set by @var{force_key_frames}.
@item segment_times @var{times}
Specify a list of split points. @var{times} contains a list of comma
separated duration specifications, in increasing order. See also
the @option{segment_time} option.
separated duration specifications, in increasing order.
@item segment_frames @var{frames}
Specify a list of split video frame numbers. @var{frames} contains a
@@ -669,7 +629,7 @@ of the generated segments. May not work with some combinations of
muxers/codecs. It is set to @code{0} by default.
@end table
@subsection Examples
@section Examples
@itemize
@item
@@ -758,54 +718,4 @@ ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
@end example
@section ogg
Ogg container muxer.
@table @option
@item -page_duration @var{duration}
Preferred page duration, in microseconds. The muxer will attempt to create
pages that are approximately @var{duration} microseconds long. This allows the
user to compromise between seek granularity and container overhead. The default
is 1 second. A value of 0 will fill all segments, making pages as large as
possible. A value of 1 will effectively use 1 packet-per-page in most
situations, giving a small seek granularity at the cost of additional container
overhead.
@end table
@section tee
The tee muxer can be used to write the same data to several files or any
other kind of muxer. It can be used, for example, to both stream a video to
the network and save it to disk at the same time.
It is different from specifying several outputs to the @command{ffmpeg}
command-line tool because the audio and video data will be encoded only once
with the tee muxer; encoding can be a very expensive process. It is not
useful when using the libavformat API directly because it is then possible
to feed the same packets to several muxers directly.
The slave outputs are specified in the file name given to the muxer,
separated by '|'. If any of the slave name contains the '|' separator,
leading or trailing spaces or any special character, it must be
escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
manual).
Options can be specified for each slave by prepending them as a list of
@var{key}=@var{value} pairs separated by ':', between square brackets. If
the options values contain a special character or the ':' separator, they
must be escaped; note that this is a second level escaping.
Example: encode something and both archive it in a WebM file and stream it
as MPEG-TS over UDP (the streams need to be explicitly mapped):
@example
ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
"archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
@end example
Note: some codecs may need different options depending on the output format;
the auto-detection of this can not work with the tee muxer. The main example
is the @option{global_header} flag.
@c man end MUXERS

View File

@@ -148,7 +148,7 @@ Alignment:
Some instructions on some architectures have strict alignment restrictions,
for example most SSE/SSE2 instructions on x86.
The minimum guaranteed alignment is written in the .h files, for example:
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
General Tips:

View File

@@ -128,63 +128,6 @@ m3u8 files.
HTTP (Hyper Text Transfer Protocol).
This protocol accepts the following options.
@table @option
@item seekable
Control seekability of connection. If set to 1 the resource is
supposed to be seekable, if set to 0 it is assumed not to be seekable,
if set to -1 it will try to autodetect if it is seekable. Default
value is -1.
@item chunked_post
If set to 1 use chunked transfer-encoding for posts, default is 1.
@item headers
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
@item content_type
Force a content type.
@item user-agent
Override User-Agent header. If not specified the protocol will use a
string describing the libavformat build.
@item multiple_requests
Use persistent connections if set to 1. By default it is 0.
@item post_data
Set custom HTTP post data.
@item timeout
Set timeout of socket I/O operations used by the underlying low level
operation. By default it is set to -1, which means that the timeout is
not specified.
@item mime_type
Set MIME type.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@end table
@subsection HTTP Cookies
Some HTTP requests will be denied unless cookie values are passed in with the
request. The @option{cookies} option allows these cookies to be specified. At
the very least, each cookie must specify a value along with a path and domain.
HTTP requests that match both the domain and path will automatically include the
cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
by a newline.
The required syntax to play a stream specifying a cookie is:
@example
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
@end example
@section mmst
MMS (Microsoft Media Server) protocol over TCP.

View File

@@ -32,9 +32,9 @@ Special Converter v
Output
Planar/Packed conversion is done when needed during sample format conversion.
Every step can be skipped without memcpy when it is not needed.
Every step can be skipped without memcpy when its not needed.
Either Resampling and Rematrixing can be performed first depending on which
way it is faster.
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.

View File

@@ -98,7 +98,7 @@ year-month-day.
The accepted syntax is:
@example
[-][HH:]MM:SS[.m...]
[-]HH:MM:SS[.m...]
[-]S+[.m...]
@end example
@@ -112,22 +112,6 @@ Specify the size of the sourced video, it may be a string of the form
The following abbreviations are recognized:
@table @samp
@item ntsc
720x480
@item pal
720x576
@item qntsc
352x240
@item qpal
352x288
@item sntsc
640x480
@item spal
768x576
@item film
352x240
@item ntsc-film
352x240
@item sqcif
128x96
@item qcif
@@ -186,18 +170,6 @@ The following abbreviations are recognized:
1280x720
@item hd1080
1920x1080
@item 2k
2048x1080
@item 2kflat
1998x1080
@item 2kscope
2048x858
@item 4k
4096x2160
@item 4kflat
3996x2160
@item 4kscope
4096x1716
@end table
@anchor{video rate syntax}
@@ -215,17 +187,17 @@ The following abbreviations are recognized:
@item pal
25/1
@item qntsc
30000/1001
30000/1
@item qpal
25/1
@item sntsc
30000/1001
30000/1
@item spal
25/1
@item film
24/1
@item ntsc-film
24000/1001
24000/1
@end table
@anchor{ratio syntax}

View File

@@ -68,7 +68,7 @@ $print_page_head = \&FFmpeg_print_page_head;
sub FFmpeg_print_page_head($$)
{
my $fh = shift;
my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_no_texi'}";
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));

View File

@@ -169,7 +169,7 @@ INF: while(<$inf>) {
} elsif ($ended =~ /^(?:example|smallexample|display)$/) {
$shift = "";
$_ = ""; # need a paragraph break
} elsif ($ended =~ /^(?:itemize|enumerate|(?:multi|[fv])?table)$/) {
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
$_ = "\n=back\n";
$ic = pop @icstack;
} else {
@@ -269,7 +269,7 @@ INF: while(<$inf>) {
$endw = "enumerate";
};
/^\@((?:multi|[fv])?table)\s+(\@[a-z]+)/ and do {
/^\@([fv]?table)\s+(\@[a-z]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
$endw = $1;
@@ -278,7 +278,6 @@ INF: while(<$inf>) {
$ic =~ s/\@(?:code|kbd)/C/;
$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
$ic =~ s/\@(?:file)/F/;
$ic =~ s/\@(?:columnfractions)//;
$_ = "\n=over 4\n";
};
@@ -289,21 +288,6 @@ INF: while(<$inf>) {
$_ = ""; # need a paragraph break
};
/^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
my $columns = $1;
$columns =~ s/\@tab/ : /;
$_ = "\n=item B&LT;". $columns ."&GT;\n";
};
/^\@tab\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
my $columns = $1;
$columns =~ s/\@tab/ : /;
$_ = " : ". $columns;
$chapter =~ s/\n+\s+$//;
};
/^\@itemx?\s*(.+)?$/ and do {
if (defined $1) {
# Entity escapes prevent munging by the <> processing below.
@@ -377,7 +361,6 @@ sub postprocess
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
s/\@ref\{(?:[^,\}]*,)(?:[^,\}]*,)([^,\}]*).*\}/$1/g;
s/\@ref\{([^\}]*)\}/$1/g;
s/\@noindent\s*//g;
s/\@refill//g;

182
ffmpeg.c
View File

@@ -109,18 +109,8 @@ const int program_birth_year = 2000;
static FILE *vstats_file;
const char *const forced_keyframes_const_names[] = {
"n",
"n_forced",
"prev_forced_n",
"prev_forced_t",
"t",
NULL
};
static void do_video_stats(OutputStream *ost, int frame_size);
static int64_t getutime(void);
static int64_t getmaxrss(void);
static int run_as_daemon = 0;
static int64_t video_size = 0;
@@ -162,8 +152,6 @@ static struct termios oldtty;
static int restore_tty;
#endif
static void free_input_threads(void);
/* sub2video hack:
Convert subtitles to video with alpha to insert them in filter graphs.
@@ -411,11 +399,6 @@ static void exit_program(void)
{
int i, j;
if (do_benchmark) {
int maxrss = getmaxrss() / 1024;
printf("bench: maxrss=%ikB\n", maxrss);
}
for (i = 0; i < nb_filtergraphs; i++) {
avfilter_graph_free(&filtergraphs[i]->graph);
for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
@@ -454,14 +437,10 @@ static void exit_program(void)
avcodec_free_frame(&output_streams[i]->filtered_frame);
av_freep(&output_streams[i]->forced_keyframes);
av_expr_free(output_streams[i]->forced_keyframes_pexpr);
av_freep(&output_streams[i]->avfilter);
av_freep(&output_streams[i]->logfile_prefix);
av_freep(&output_streams[i]);
}
#if HAVE_PTHREADS
free_input_threads();
#endif
for (i = 0; i < nb_input_files; i++) {
avformat_close_input(&input_files[i]->ctx);
av_freep(&input_files[i]);
@@ -470,7 +449,6 @@ static void exit_program(void)
avcodec_free_frame(&input_streams[i]->decoded_frame);
av_dict_free(&input_streams[i]->opts);
free_buffer_pool(&input_streams[i]->buffer_pool);
avsubtitle_free(&input_streams[i]->prev_sub.subtitle);
avfilter_unref_bufferp(&input_streams[i]->sub2video.ref);
av_freep(&input_streams[i]->filters);
av_freep(&input_streams[i]);
@@ -686,7 +664,6 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
}
}
#if FF_API_DEINTERLACE
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)
{
AVCodecContext *dec;
@@ -697,7 +674,7 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
dec = ist->st->codec;
/* deinterlace : must be done before any resize */
if (FF_API_DEINTERLACE && do_deinterlace) {
if (do_deinterlace) {
int size;
/* create temporary picture */
@@ -727,7 +704,6 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
*picture = *picture2;
*bufp = buf;
}
#endif
static void do_subtitle_out(AVFormatContext *s,
OutputStream *ost,
@@ -896,9 +872,8 @@ static void do_video_out(AVFormatContext *s,
video_size += pkt.size;
write_frame(s, &pkt, ost);
} else {
int got_packet, forced_keyframe = 0;
int got_packet;
AVFrame big_picture;
double pts_time;
big_picture = *in_picture;
/* better than nothing: use input picture interlaced
@@ -922,41 +897,11 @@ static void do_video_out(AVFormatContext *s,
big_picture.quality = ost->st->codec->global_quality;
if (!enc->me_threshold)
big_picture.pict_type = 0;
pts_time = big_picture.pts != AV_NOPTS_VALUE ?
big_picture.pts * av_q2d(enc->time_base) : NAN;
if (ost->forced_kf_index < ost->forced_kf_count &&
big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
ost->forced_kf_index++;
forced_keyframe = 1;
} else if (ost->forced_keyframes_pexpr) {
double res;
ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
res = av_expr_eval(ost->forced_keyframes_pexpr,
ost->forced_keyframes_expr_const_values, NULL);
av_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n",
ost->forced_keyframes_expr_const_values[FKF_N],
ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
ost->forced_keyframes_expr_const_values[FKF_T],
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
res);
if (res) {
forced_keyframe = 1;
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] =
ost->forced_keyframes_expr_const_values[FKF_N];
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] =
ost->forced_keyframes_expr_const_values[FKF_T];
ost->forced_keyframes_expr_const_values[FKF_N_FORCED] += 1;
}
ost->forced_keyframes_expr_const_values[FKF_N] += 1;
}
if (forced_keyframe) {
big_picture.pict_type = AV_PICTURE_TYPE_I;
av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time);
ost->forced_kf_index++;
}
update_benchmark(NULL);
ret = avcodec_encode_video2(enc, &pkt, &big_picture, &got_packet);
update_benchmark("encode_video %d.%d", ost->file_index, ost->index);
@@ -1116,12 +1061,6 @@ static int reap_filters(void)
case AVMEDIA_TYPE_AUDIO:
avfilter_copy_buf_props(filtered_frame, picref);
filtered_frame->pts = frame_pts;
if (!(ost->st->codec->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
ost->st->codec->channels != av_frame_get_channels(filtered_frame)) {
av_log(NULL, AV_LOG_ERROR,
"Audio filter graph output is not normalized and encoder does not support parameter changes\n");
break;
}
do_audio_out(of->ctx, ost, filtered_frame);
break;
default:
@@ -1228,7 +1167,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
p = psnr(error / scale);
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%c:%2.2f ", type[j], p);
av_bprintf(&buf_script, "stream_%d_%d_psnr_%c=%2.2f\n",
ost->file_index, ost->index, type[j] | 32, p);
ost->file_index, ost->index, type[i] | 32, p);
}
p = psnr(error_sum / scale_sum);
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "*:%2.2f ", psnr(error_sum / scale_sum));
@@ -1276,10 +1215,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
if (print_stats || is_last_report) {
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
fprintf(stderr, "%s \r", buf);
} else
av_log(NULL, AV_LOG_INFO, "%s \r", buf);
av_log(NULL, AV_LOG_INFO, "%s \r", buf);
fflush(stderr);
}
@@ -1506,8 +1442,6 @@ int guess_input_channel_layout(InputStream *ist)
if (!dec->channel_layout) {
char layout_name[256];
if (dec->channels > ist->guess_layout_max)
return 0;
dec->channel_layout = av_get_default_channel_layout(dec->channels);
if (!dec->channel_layout)
return 0;
@@ -1682,9 +1616,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
}
pkt->size = 0;
#if FF_API_DEINTERLACE
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
#endif
rate_emu_sleep(ist);
@@ -1910,10 +1842,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
ist->st->codec->sample_rate;
break;
case AVMEDIA_TYPE_VIDEO:
if (ist->framerate.num) {
int64_t next_dts = av_rescale_q(ist->next_dts, AV_TIME_BASE_Q, av_inv_q(ist->framerate));
ist->next_dts = av_rescale_q(next_dts + 1, av_inv_q(ist->framerate), AV_TIME_BASE_Q);
} else if (pkt->duration) {
if (pkt->duration) {
ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
} else if(ist->st->codec->time_base.num != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict + 1 : ist->st->codec->ticks_per_frame;
@@ -1940,7 +1869,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
static void print_sdp(void)
{
char sdp[16384];
char sdp[2048];
int i;
AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files);
@@ -1968,7 +1897,7 @@ static int init_input_stream(int ist_index, char *error, int error_len)
return AVERROR(EINVAL);
}
ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !(FF_API_DEINTERLACE && do_deinterlace);
ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !do_deinterlace;
if (codec->type == AVMEDIA_TYPE_VIDEO && ist->dr1) {
ist->st->codec->get_buffer = codec_get_buffer;
ist->st->codec->release_buffer = codec_release_buffer;
@@ -2001,25 +1930,19 @@ static InputStream *get_input_stream(OutputStream *ost)
return NULL;
}
static int compare_int64(const void *a, const void *b)
{
int64_t va = *(int64_t *)a, vb = *(int64_t *)b;
return va < vb ? -1 : va > vb ? +1 : 0;
}
static void parse_forced_key_frames(char *kf, OutputStream *ost,
AVCodecContext *avctx)
{
char *p;
int n = 1, i, size, index = 0;
int64_t t, *pts;
int n = 1, i;
int64_t t;
for (p = kf; *p; p++)
if (*p == ',')
n++;
size = n;
pts = av_malloc(sizeof(*pts) * size);
if (!pts) {
ost->forced_kf_count = n;
ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
if (!ost->forced_kf_pts) {
av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
exit(1);
}
@@ -2031,43 +1954,11 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost,
if (next)
*next++ = 0;
if (!memcmp(p, "chapters", 8)) {
AVFormatContext *avf = output_files[ost->file_index]->ctx;
int j;
if (avf->nb_chapters > INT_MAX - size ||
!(pts = av_realloc_f(pts, size += avf->nb_chapters - 1,
sizeof(*pts)))) {
av_log(NULL, AV_LOG_FATAL,
"Could not allocate forced key frames array.\n");
exit(1);
}
t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0;
t = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
for (j = 0; j < avf->nb_chapters; j++) {
AVChapter *c = avf->chapters[j];
av_assert1(index < size);
pts[index++] = av_rescale_q(c->start, c->time_base,
avctx->time_base) + t;
}
} else {
t = parse_time_or_die("force_key_frames", p, 1);
av_assert1(index < size);
pts[index++] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
}
t = parse_time_or_die("force_key_frames", p, 1);
ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
p = next;
}
av_assert0(index == size);
qsort(pts, size, sizeof(*pts), compare_int64);
ost->forced_kf_count = size;
ost->forced_kf_pts = pts;
}
static void report_new_stream(int input_index, AVPacket *pkt)
@@ -2154,10 +2045,9 @@ static int transcode_init(void)
codec->codec_type = icodec->codec_type;
if (!codec->codec_tag) {
unsigned int codec_tag;
if (!oc->oformat->codec_tag ||
av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == codec->codec_id ||
!av_codec_get_tag2(oc->oformat->codec_tag, icodec->codec_id, &codec_tag))
av_codec_get_tag(oc->oformat->codec_tag, icodec->codec_id) <= 0)
codec->codec_tag = icodec->codec_tag;
}
@@ -2216,8 +2106,6 @@ static int transcode_init(void)
codec->time_base = icodec->time_base;
}
if (ist && !ost->frame_rate.num)
ost->frame_rate = ist->framerate;
if(ost->frame_rate.num)
codec->time_base = av_inv_q(ost->frame_rate);
@@ -2236,7 +2124,7 @@ static int transcode_init(void)
codec->frame_size = icodec->frame_size;
codec->audio_service_type = icodec->audio_service_type;
codec->block_align = icodec->block_align;
if((codec->block_align == 1 || codec->block_align == 1152 || codec->block_align == 576) && codec->codec_id == AV_CODEC_ID_MP3)
if((codec->block_align == 1 || codec->block_align == 1152) && codec->codec_id == AV_CODEC_ID_MP3)
codec->block_align= 0;
if(codec->codec_id == AV_CODEC_ID_AC3)
codec->block_align= 0;
@@ -2310,7 +2198,7 @@ static int transcode_init(void)
codec->sample_fmt = ost->filter->filter->inputs[0]->format;
codec->sample_rate = ost->filter->filter->inputs[0]->sample_rate;
codec->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
codec->channels = avfilter_link_get_channels(ost->filter->filter->inputs[0]);
codec->channels = av_get_channel_layout_nb_channels(codec->channel_layout);
codec->time_base = (AVRational){ 1, codec->sample_rate };
break;
case AVMEDIA_TYPE_VIDEO:
@@ -2342,23 +2230,9 @@ static int transcode_init(void)
codec->bits_per_raw_sample = frame_bits_per_raw_sample;
}
if (ost->forced_keyframes) {
if (!strncmp(ost->forced_keyframes, "expr:", 5)) {
ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5,
forced_keyframes_const_names, NULL, NULL, NULL, NULL, 0, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR,
"Invalid force_key_frames expression '%s'\n", ost->forced_keyframes+5);
return ret;
}
ost->forced_keyframes_expr_const_values[FKF_N] = 0;
ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0;
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN;
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN;
} else {
parse_forced_key_frames(ost->forced_keyframes, ost, ost->st->codec);
}
}
if (ost->forced_keyframes)
parse_forced_key_frames(ost->forced_keyframes, ost,
ost->st->codec);
break;
case AVMEDIA_TYPE_SUBTITLE:
codec->time_base = (AVRational){1, 1000};
@@ -2447,20 +2321,13 @@ static int transcode_init(void)
if (ost->st->codec->me_threshold)
input_streams[ost->source_index]->st->codec->debug |= FF_DEBUG_MV;
} else {
av_opt_set_dict(ost->st->codec, &ost->opts);
}
}
/* init input streams */
for (i = 0; i < nb_input_streams; i++)
if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
for (i = 0; i < nb_output_streams; i++) {
ost = output_streams[i];
avcodec_close(ost->st->codec);
}
if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
goto dump_format;
}
/* discard unused programs */
for (i = 0; i < nb_input_files; i++) {
@@ -3243,8 +3110,6 @@ static int transcode(void)
av_freep(&ost->st->codec->subtitle_header);
av_free(ost->forced_kf_pts);
av_dict_free(&ost->opts);
av_dict_free(&ost->swr_opts);
av_dict_free(&ost->resample_opts);
}
}
}
@@ -3350,7 +3215,8 @@ int main(int argc, char **argv)
exit(1);
ti = getutime() - ti;
if (do_benchmark) {
printf("bench: utime=%0.3fs\n", ti / 1000000.0);
int maxrss = getmaxrss() / 1024;
printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
}
exit(received_nb_signals ? 255 : 0);

View File

@@ -41,7 +41,6 @@
#include "libavutil/avutil.h"
#include "libavutil/dict.h"
#include "libavutil/eval.h"
#include "libavutil/fifo.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
@@ -114,7 +113,6 @@ typedef struct OptionsContext {
int chapters_input_file;
int64_t recording_time;
int64_t stop_time;
uint64_t limit_filesize;
float mux_preload;
float mux_max_delay;
@@ -173,8 +171,6 @@ typedef struct OptionsContext {
int nb_pass;
SpecifierOpt *passlogfiles;
int nb_passlogfiles;
SpecifierOpt *guess_layout_max;
int nb_guess_layout_max;
} OptionsContext;
typedef struct InputFilter {
@@ -199,7 +195,6 @@ typedef struct FilterGraph {
const char *graph_desc;
AVFilterGraph *graph;
int reconfiguration;
InputFilter **inputs;
int nb_inputs;
@@ -234,7 +229,6 @@ typedef struct InputStream {
AVDictionary *opts;
AVRational framerate; /* framerate forced with -r */
int top_field_first;
int guess_layout_max;
int resample_height;
int resample_width;
@@ -292,17 +286,6 @@ typedef struct InputFile {
#endif
} InputFile;
enum forced_keyframes_const {
FKF_N,
FKF_N_FORCED,
FKF_PREV_FORCED_N,
FKF_PREV_FORCED_T,
FKF_T,
FKF_NB
};
extern const char *const forced_keyframes_const_names[];
typedef struct OutputStream {
int file_index; /* file index */
int index; /* stream index in the output file */
@@ -334,8 +317,6 @@ typedef struct OutputStream {
int forced_kf_count;
int forced_kf_index;
char *forced_keyframes;
AVExpr *forced_keyframes_pexpr;
double forced_keyframes_expr_const_values[FKF_NB];
/* audio only */
int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */
@@ -348,9 +329,10 @@ typedef struct OutputStream {
char *avfilter;
int64_t sws_flags;
int64_t swr_filter_type;
int64_t swr_dither_method;
double swr_dither_scale;
AVDictionary *opts;
AVDictionary *swr_opts;
AVDictionary *resample_opts;
int finished; /* no more packets should be written for this stream */
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
int stream_copy;

View File

@@ -24,8 +24,6 @@
#include "libavfilter/avfiltergraph.h"
#include "libavfilter/buffersink.h"
#include "libavresample/avresample.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
@@ -43,15 +41,12 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = mjpeg_formats;
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p =ljpeg_formats;
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
@@ -144,7 +139,7 @@ static char *choose_ ## var ## s(OutputStream *ost) \
if (ost->st->codec->var != none) { \
get_name(ost->st->codec->var); \
return av_strdup(name); \
} else if (ost->enc && ost->enc->supported_list) { \
} else if (ost->enc->supported_list) { \
const type *p; \
AVIOContext *s = NULL; \
uint8_t *ret; \
@@ -372,16 +367,12 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
char *sample_fmts, *sample_rates, *channel_layouts;
char name[255];
int ret;
AVABufferSinkParams *params = av_abuffersink_params_alloc();
if (!params)
return AVERROR(ENOMEM);
params->all_channel_counts = 1;
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&ofilter->filter,
avfilter_get_by_name("ffabuffersink"),
name, NULL, params, fg->graph);
av_freep(&params);
name, NULL, NULL, fg->graph);
if (ret < 0)
return ret;
@@ -531,7 +522,7 @@ static int sub2video_prepare(InputStream *ist)
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
palettes for all rectangles are identical or compatible */
ist->resample_pix_fmt = ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32);
if (ret < 0)
@@ -629,25 +620,20 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilter *filter = avfilter_get_by_name("abuffer");
InputStream *ist = ifilter->ist;
int pad_idx = in->pad_idx;
AVBPrint args;
char name[255];
char args[255], name[255];
int ret;
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
":channel_layout=0x%"PRIx64,
1, ist->st->codec->sample_rate,
ist->st->codec->sample_rate,
av_get_sample_fmt_name(ist->st->codec->sample_fmt));
if (ist->st->codec->channel_layout)
av_bprintf(&args, ":channel_layout=0x%"PRIx64,
ist->st->codec->channel_layout);
else
av_bprintf(&args, ":channels=%d", ist->st->codec->channels);
av_get_sample_fmt_name(ist->st->codec->sample_fmt),
ist->st->codec->channel_layout);
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter,
name, args.str, NULL,
name, args, NULL,
fg->graph)) < 0)
return ret;
@@ -678,8 +664,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
if (audio_drift_threshold != 0.1)
av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
if (!fg->reconfiguration)
av_strlcatf(args, sizeof(args), ":first_pts=0");
AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
}
@@ -737,29 +721,20 @@ int configure_filtergraph(FilterGraph *fg)
if (simple) {
OutputStream *ost = fg->outputs[0]->ost;
char args[512];
AVDictionaryEntry *e = NULL;
char args[255];
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
fg->graph->scale_sws_opts = av_strdup(args);
args[0] = 0;
while ((e = av_dict_get(ost->swr_opts, "", e,
AV_DICT_IGNORE_SUFFIX))) {
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
}
if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
if (ost->swr_dither_method)
av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
if (ost->swr_dither_scale != 1.0)
av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
if (strlen(args))
args[strlen(args)-1] = 0;
av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
args[0] = '\0';
while ((e = av_dict_get(fg->outputs[0]->ost->resample_opts, "", e,
AV_DICT_IGNORE_SUFFIX))) {
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
}
if (strlen(args))
args[strlen(args) - 1] = '\0';
fg->graph->resample_lavr_opts = av_strdup(args);
}
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
@@ -801,7 +776,6 @@ int configure_filtergraph(FilterGraph *fg)
}
}
fg->reconfiguration = 1;
return 0;
}

View File

@@ -81,7 +81,7 @@ int copy_ts = 0;
int copy_tb = -1;
int debug_ts = 0;
int exit_on_error = 0;
int print_stats = -1;
int print_stats = 1;
int qp_hist = 0;
int stdin_interaction = 1;
int frame_bits_per_raw_sample = 0;
@@ -126,7 +126,6 @@ static void uninit_options(OptionsContext *o, int is_input)
av_freep(&o->stream_maps);
av_freep(&o->audio_channel_maps);
av_freep(&o->streamid_map);
av_freep(&o->attachments);
if (is_input)
recording_time = o->recording_time;
@@ -144,13 +143,24 @@ static void init_options(OptionsContext *o, int is_input)
"-t is not an input option, keeping it for the next output;"
" consider fixing your command line.\n");
} else
o->recording_time = INT64_MAX;
o->stop_time = INT64_MAX;
o->recording_time = INT64_MAX;
o->mux_max_delay = 0.7;
o->limit_filesize = UINT64_MAX;
o->chapters_input_file = INT_MAX;
}
static int opt_frame_crop(void *optctx, const char *opt, const char *arg)
{
av_log(NULL, AV_LOG_FATAL, "Option '%s' has been removed, use the crop filter instead\n", opt);
return AVERROR(EINVAL);
}
static int opt_pad(void *optctx, const char *opt, const char *arg)
{
av_log(NULL, AV_LOG_FATAL, "Option '%s' has been removed, use the pad filter instead\n", opt);
return -1;
}
static int opt_sameq(void *optctx, const char *opt, const char *arg)
{
av_log(NULL, AV_LOG_ERROR, "Option '%s' was removed. "
@@ -606,8 +616,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
break;
case AVMEDIA_TYPE_AUDIO:
ist->guess_layout_max = INT_MAX;
MATCH_PER_STREAM_OPT(guess_layout_max, i, ist->guess_layout_max, ic, st);
guess_input_channel_layout(ist);
ist->resample_sample_fmt = dec->sample_fmt;
@@ -957,8 +965,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
preset, ost->file_index, ost->index);
exit(1);
}
} else {
ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
}
avcodec_get_context_defaults3(st->codec, ost->enc);
@@ -1005,12 +1011,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
av_opt_get_int(o->g->sws_opts, "sws_flags", 0, &ost->sws_flags);
av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0);
if (ost->enc && av_get_exact_bits_per_sample(ost->enc->id) == 24)
av_dict_set(&ost->swr_opts, "output_sample_bits", "24", 0);
av_dict_copy(&ost->resample_opts, o->g->resample_opts, 0);
av_opt_get_int (o->g->swr_opts, "filter_type" , 0, &ost->swr_filter_type);
av_opt_get_int (o->g->swr_opts, "dither_method", 0, &ost->swr_dither_method);
av_opt_get_double(o->g->swr_opts, "dither_scale" , 0, &ost->swr_dither_scale);
ost->source_index = source_index;
if (source_index >= 0) {
@@ -1659,20 +1662,6 @@ loop_end:
exit(1);
}
if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) {
o->stop_time = INT64_MAX;
av_log(NULL, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n");
}
if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) {
if (o->stop_time <= o->start_time) {
av_log(NULL, AV_LOG_WARNING, "-to value smaller than -ss; ignoring -to.\n");
o->stop_time = INT64_MAX;
} else {
o->recording_time = o->stop_time - o->start_time;
}
}
GROW_ARRAY(output_files, nb_output_files);
if (!(output_files[nb_output_files - 1] = av_mallocz(sizeof(*output_files[0]))))
exit(1);
@@ -1706,8 +1695,7 @@ loop_end:
print_error(filename, err);
exit(1);
}
} else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename))
assert_file_overwrite(filename);
}
if (o->mux_preload) {
uint8_t buf[64];
@@ -2129,14 +2117,12 @@ static int opt_vsync(void *optctx, const char *opt, const char *arg)
return 0;
}
#if FF_API_DEINTERLACE
static int opt_deinterlace(void *optctx, const char *opt, const char *arg)
{
av_log(NULL, AV_LOG_WARNING, "-%s is deprecated, use -filter:v yadif instead\n", opt);
do_deinterlace = 1;
return 0;
}
#endif
static int opt_timecode(void *optctx, const char *opt, const char *arg)
{
@@ -2311,7 +2297,7 @@ static int open_files(OptionGroupList *l, const char *inout,
inout, g->arg);
return ret;
}
av_log(NULL, AV_LOG_DEBUG, "Successfully opened the file.\n");
av_log(NULL, AV_LOG_DEBUG, "Successfully openened the file.\n");
}
return 0;
@@ -2409,8 +2395,6 @@ const OptionDef options[] = {
{ "t", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(recording_time) },
"record or transcode \"duration\" seconds of audio/video",
"duration" },
{ "to", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(stop_time) },
"record or transcode stop time", "time_stop" },
{ "fs", HAS_ARG | OPT_INT64 | OPT_OFFSET, { .off = OFFSET(limit_filesize) },
"set the limit file size in bytes", "limit_size" },
{ "ss", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(start_time) },
@@ -2477,7 +2461,7 @@ const OptionDef options[] = {
{ "profile", HAS_ARG | OPT_EXPERT | OPT_PERFILE, { .func_arg = opt_profile },
"set profile", "profile" },
{ "filter", HAS_ARG | OPT_STRING | OPT_SPEC, { .off = OFFSET(filters) },
"set stream filtergraph", "filter_graph" },
"set stream filterchain", "filter_list" },
{ "reinit_filter", HAS_ARG | OPT_INT | OPT_SPEC, { .off = OFFSET(reinit_filters) },
"reinit filtergraph on input parameter changes", "" },
{ "filter_complex", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex },
@@ -2504,6 +2488,24 @@ const OptionDef options[] = {
"set pixel format", "format" },
{ "bits_per_raw_sample", OPT_VIDEO | OPT_INT | HAS_ARG, { &frame_bits_per_raw_sample },
"set the number of bits per raw sample", "number" },
{ "croptop", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
"Removed, use the crop filter instead", "size" },
{ "cropbottom", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
"Removed, use the crop filter instead", "size" },
{ "cropleft", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
"Removed, use the crop filter instead", "size" },
{ "cropright", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
"Removed, use the crop filter instead", "size" },
{ "padtop", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
"Removed, use the pad filter instead", "size" },
{ "padbottom", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
"Removed, use the pad filter instead", "size" },
{ "padleft", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
"Removed, use the pad filter instead", "size" },
{ "padright", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
"Removed, use the pad filter instead", "size" },
{ "padcolor", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
"Removed, use the pad filter instead", "color" },
{ "intra", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &intra_only },
"deprecated use -g 1" },
{ "vn", OPT_VIDEO | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(video_disable) },
@@ -2524,10 +2526,8 @@ const OptionDef options[] = {
"select the pass number (1 to 3)", "n" },
{ "passlogfile", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC, { .off = OFFSET(passlogfiles) },
"select two pass log file name prefix", "prefix" },
#if FF_API_DEINTERLACE
{ "deinterlace", OPT_VIDEO | OPT_EXPERT , { .func_arg = opt_deinterlace },
"this option is deprecated, use the yadif filter instead" },
#endif
{ "psnr", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &do_psnr },
"calculate PSNR of compressed frames" },
{ "vstats", OPT_VIDEO | OPT_EXPERT , { &opt_vstats },
@@ -2535,7 +2535,7 @@ const OptionDef options[] = {
{ "vstats_file", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { opt_vstats_file },
"dump video coding statistics to file", "file" },
{ "vf", OPT_VIDEO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_video_filters },
"set video filters", "filter_graph" },
"video filters", "filter list" },
{ "intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC, { .off = OFFSET(intra_matrices) },
"specify intra matrix coeffs", "matrix" },
{ "inter_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC, { .off = OFFSET(inter_matrices) },
@@ -2580,9 +2580,7 @@ const OptionDef options[] = {
{ "channel_layout", OPT_AUDIO | HAS_ARG | OPT_EXPERT | OPT_PERFILE, { .func_arg = opt_channel_layout },
"set channel layout", "layout" },
{ "af", OPT_AUDIO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_audio_filters },
"set audio filters", "filter_graph" },
{ "guess_layout_max", OPT_AUDIO | HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT, { .off = OFFSET(guess_layout_max) },
"set the maximum number of channels to try to guess the channel layout" },
"audio filters", "filter list" },
/* subtitle options */
{ "sn", OPT_SUBTITLE | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(subtitle_disable) },

307
ffplay.c
View File

@@ -86,9 +86,6 @@ const int program_birth_year = 2003;
/* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */
#define AUDIO_DIFF_AVG_NB 20
/* polls for possible required screen refresh at least this often, should be less than 1/fps */
#define REFRESH_RATE 0.01
/* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
/* TODO: We assume that a decoded and resampled frame fits into this buffer */
#define SAMPLE_ARRAY_SIZE (8 * 65536)
@@ -119,6 +116,7 @@ typedef struct PacketQueue {
typedef struct VideoPicture {
double pts; // presentation timestamp for this picture
int64_t pos; // byte position in file
int skip;
SDL_Overlay *bmp;
int width, height; /* source height & width */
AVRational sample_aspect_ratio;
@@ -139,7 +137,7 @@ typedef struct SubPicture {
typedef struct AudioParams {
int freq;
int channels;
int64_t channel_layout;
int channel_layout;
enum AVSampleFormat fmt;
} AudioParams;
@@ -152,6 +150,7 @@ enum {
typedef struct VideoState {
SDL_Thread *read_tid;
SDL_Thread *video_tid;
SDL_Thread *refresh_tid;
AVInputFormat *iformat;
int no_background;
int abort_request;
@@ -176,7 +175,6 @@ typedef struct VideoState {
double external_clock_speed; ///< speed of the external clock
double audio_clock;
int audio_clock_serial;
double audio_diff_cum; /* used for AV difference average computation */
double audio_diff_avg_coef;
double audio_diff_threshold;
@@ -184,11 +182,11 @@ typedef struct VideoState {
AVStream *audio_st;
PacketQueue audioq;
int audio_hw_buf_size;
DECLARE_ALIGNED(16,uint8_t,audio_buf2)[AVCODEC_MAX_AUDIO_FRAME_SIZE * 4];
uint8_t silence_buf[SDL_AUDIO_BUFFER_SIZE];
uint8_t *audio_buf;
uint8_t *audio_buf1;
unsigned int audio_buf_size; /* in bytes */
unsigned int audio_buf1_size;
int audio_buf_index; /* in bytes */
int audio_write_buf_size;
AVPacket audio_pkt_temp;
@@ -213,7 +211,6 @@ typedef struct VideoState {
int rdft_bits;
FFTSample *rdft_data;
int xpos;
double last_vis_time;
SDL_Thread *subtitle_tid;
int subtitle_stream;
@@ -232,14 +229,14 @@ typedef struct VideoState {
double frame_last_returned_time;
double frame_last_filter_delay;
int64_t frame_last_dropped_pos;
double video_clock; // pts of last decoded frame / predicted pts of next decoded frame
int video_stream;
AVStream *video_st;
PacketQueue videoq;
double video_current_pts; // current displayed pts
double video_current_pts; // current displayed pts (different from video_clock if frame fifos are used)
double video_current_pts_drift; // video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
int64_t video_current_pos; // current displayed file pos
double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity
int video_clock_serial;
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
int pictq_size, pictq_rindex, pictq_windex;
SDL_mutex *pictq_mutex;
@@ -260,6 +257,7 @@ typedef struct VideoState {
FrameBuffer *buffer_pool;
#endif
int refresh;
int last_video_stream, last_audio_stream, last_subtitle_stream;
SDL_cond *continue_read_thread;
@@ -271,13 +269,10 @@ static const char *input_filename;
static const char *window_title;
static int fs_screen_width;
static int fs_screen_height;
static int default_width = 640;
static int default_height = 480;
static int screen_width = 0;
static int screen_height = 0;
static int audio_disable;
static int video_disable;
static int subtitle_disable;
static int wanted_stream[AVMEDIA_TYPE_NB] = {
[AVMEDIA_TYPE_AUDIO] = -1,
[AVMEDIA_TYPE_VIDEO] = -1,
@@ -309,7 +304,7 @@ static enum ShowMode show_mode = SHOW_MODE_NONE;
static const char *audio_codec_name;
static const char *subtitle_codec_name;
static const char *video_codec_name;
double rdftspeed = 0.02;
static int rdftspeed = 20;
static int64_t cursor_last_shown;
static int cursor_hidden = 0;
#if CONFIG_AVFILTER
@@ -323,6 +318,7 @@ static int64_t audio_callback_time;
static AVPacket flush_pkt;
#define FF_ALLOC_EVENT (SDL_USEREVENT)
#define FF_REFRESH_EVENT (SDL_USEREVENT + 1)
#define FF_QUIT_EVENT (SDL_USEREVENT + 2)
static SDL_Surface *screen;
@@ -975,6 +971,7 @@ static void stream_close(VideoState *is)
/* XXX: use a special url_shutdown call to abort parse cleanly */
is->abort_request = 1;
SDL_WaitThread(is->read_tid, NULL);
SDL_WaitThread(is->refresh_tid, NULL);
packet_queue_destroy(&is->videoq);
packet_queue_destroy(&is->audioq);
packet_queue_destroy(&is->subtitleq);
@@ -996,7 +993,8 @@ static void stream_close(VideoState *is)
SDL_DestroyCond(is->subpq_cond);
SDL_DestroyCond(is->continue_read_thread);
#if !CONFIG_AVFILTER
sws_freeContext(is->img_convert_ctx);
if (is->img_convert_ctx)
sws_freeContext(is->img_convert_ctx);
#endif
av_free(is);
}
@@ -1025,30 +1023,29 @@ static void sigterm_handler(int sig)
exit(123);
}
static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp)
static int video_open(VideoState *is, int force_set_video_mode)
{
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
int w,h;
VideoPicture *vp = &is->pictq[is->pictq_rindex];
SDL_Rect rect;
if (is_full_screen) flags |= SDL_FULLSCREEN;
else flags |= SDL_RESIZABLE;
if (vp && vp->width) {
calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
default_width = rect.w;
default_height = rect.h;
}
if (is_full_screen && fs_screen_width) {
w = fs_screen_width;
h = fs_screen_height;
} else if (!is_full_screen && screen_width) {
w = screen_width;
h = screen_height;
} else if (vp->width) {
calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
w = rect.w;
h = rect.h;
} else {
w = default_width;
h = default_height;
w = 640;
h = 480;
}
if (screen && is->width == screen->w && screen->w == w
&& is->height== screen->h && screen->h == h && !force_set_video_mode)
@@ -1072,18 +1069,33 @@ static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp
static void video_display(VideoState *is)
{
if (!screen)
video_open(is, 0, NULL);
video_open(is, 0);
if (is->audio_st && is->show_mode != SHOW_MODE_VIDEO)
video_audio_display(is);
else if (is->video_st)
video_image_display(is);
}
static int refresh_thread(void *opaque)
{
VideoState *is= opaque;
while (!is->abort_request) {
SDL_Event event;
event.type = FF_REFRESH_EVENT;
event.user.data1 = opaque;
if (!is->refresh && (!is->paused || is->force_refresh)) {
is->refresh = 1;
SDL_PushEvent(&event);
}
//FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly
av_usleep(is->audio_st && is->show_mode != SHOW_MODE_VIDEO ? rdftspeed*1000 : 5000);
}
return 0;
}
/* get the current audio clock value */
static double get_audio_clock(VideoState *is)
{
if (is->audio_clock_serial != is->audioq.serial)
return NAN;
if (is->paused) {
return is->audio_current_pts;
} else {
@@ -1094,8 +1106,6 @@ static double get_audio_clock(VideoState *is)
/* get the current video clock value */
static double get_video_clock(VideoState *is)
{
if (is->video_clock_serial != is->videoq.serial)
return NAN;
if (is->paused) {
return is->video_current_pts;
} else {
@@ -1157,8 +1167,7 @@ static void update_external_clock_pts(VideoState *is, double pts)
}
static void check_external_clock_sync(VideoState *is, double pts) {
double ext_clock = get_external_clock(is);
if (isnan(ext_clock) || fabs(ext_clock - pts) > AV_NOSYNC_THRESHOLD) {
if (fabs(get_external_clock(is) - pts) > AV_NOSYNC_THRESHOLD) {
update_external_clock_pts(is, pts);
}
}
@@ -1192,7 +1201,6 @@ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_by
if (seek_by_bytes)
is->seek_flags |= AVSEEK_FLAG_BYTE;
is->seek_req = 1;
SDL_CondSignal(is->continue_read_thread);
}
}
@@ -1210,20 +1218,6 @@ static void stream_toggle_pause(VideoState *is)
is->paused = !is->paused;
}
static void toggle_pause(VideoState *is)
{
stream_toggle_pause(is);
is->step = 0;
}
static void step_to_next_frame(VideoState *is)
{
/* if the stream is paused unpause it, then step */
if (is->paused)
stream_toggle_pause(is);
is->step = 1;
}
static double compute_target_delay(double delay, VideoState *is)
{
double sync_threshold, diff;
@@ -1238,7 +1232,7 @@ static double compute_target_delay(double delay, VideoState *is)
delay to compute the threshold. I still don't know
if it is the best guess */
sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);
if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) {
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
if (diff <= -sync_threshold)
delay = 0;
else if (diff >= sync_threshold)
@@ -1263,23 +1257,20 @@ static void pictq_next_picture(VideoState *is) {
SDL_UnlockMutex(is->pictq_mutex);
}
static int pictq_prev_picture(VideoState *is) {
static void pictq_prev_picture(VideoState *is) {
VideoPicture *prevvp;
int ret = 0;
/* update queue size and signal for the previous picture */
prevvp = &is->pictq[(is->pictq_rindex + VIDEO_PICTURE_QUEUE_SIZE - 1) % VIDEO_PICTURE_QUEUE_SIZE];
if (prevvp->allocated && prevvp->serial == is->videoq.serial) {
if (prevvp->allocated && !prevvp->skip) {
SDL_LockMutex(is->pictq_mutex);
if (is->pictq_size < VIDEO_PICTURE_QUEUE_SIZE - 1) {
if (--is->pictq_rindex == -1)
is->pictq_rindex = VIDEO_PICTURE_QUEUE_SIZE - 1;
is->pictq_size++;
ret = 1;
}
SDL_CondSignal(is->pictq_cond);
SDL_UnlockMutex(is->pictq_mutex);
}
return ret;
}
static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial) {
@@ -1289,13 +1280,12 @@ static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial
is->video_current_pts_drift = is->video_current_pts - time;
is->video_current_pos = pos;
is->frame_last_pts = pts;
is->video_clock_serial = serial;
if (is->videoq.serial == serial)
check_external_clock_sync(is, is->video_current_pts);
}
/* called to display each frame */
static void video_refresh(void *opaque, double *remaining_time)
static void video_refresh(void *opaque)
{
VideoState *is = opaque;
VideoPicture *vp;
@@ -1306,19 +1296,12 @@ static void video_refresh(void *opaque, double *remaining_time)
if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime)
check_external_clock_speed(is);
if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st) {
time = av_gettime() / 1000000.0;
if (is->force_refresh || is->last_vis_time + rdftspeed < time) {
video_display(is);
is->last_vis_time = time;
}
*remaining_time = FFMIN(*remaining_time, is->last_vis_time + rdftspeed - time);
}
if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st)
video_display(is);
if (is->video_st) {
int redisplay = 0;
if (is->force_refresh)
redisplay = pictq_prev_picture(is);
pictq_prev_picture(is);
retry:
if (is->pictq_size == 0) {
SDL_LockMutex(is->pictq_mutex);
@@ -1333,9 +1316,8 @@ retry:
/* dequeue the picture */
vp = &is->pictq[is->pictq_rindex];
if (vp->serial != is->videoq.serial) {
if (vp->skip) {
pictq_next_picture(is);
redisplay = 0;
goto retry;
}
@@ -1351,10 +1333,8 @@ retry:
delay = compute_target_delay(is->frame_last_duration, is);
time= av_gettime()/1000000.0;
if (time < is->frame_timer + delay) {
*remaining_time = FFMIN(is->frame_timer + delay - time, *remaining_time);
if (time < is->frame_timer + delay)
return;
}
if (delay > 0)
is->frame_timer += delay * FFMAX(1, floor((time-is->frame_timer) / delay));
@@ -1366,11 +1346,9 @@ retry:
if (is->pictq_size > 1) {
VideoPicture *nextvp = &is->pictq[(is->pictq_rindex + 1) % VIDEO_PICTURE_QUEUE_SIZE];
duration = nextvp->pts - vp->pts;
if(!is->step && (redisplay || framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){
if (!redisplay)
is->frame_drops_late++;
if(!is->step && (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){
is->frame_drops_late++;
pictq_next_picture(is);
redisplay = 0;
goto retry;
}
}
@@ -1481,7 +1459,7 @@ static void alloc_picture(VideoState *is)
avfilter_unref_bufferp(&vp->picref);
#endif
video_open(is, 0, vp);
video_open(is, 0);
vp->bmp = SDL_CreateYUVOverlay(vp->width, vp->height,
SDL_YV12_OVERLAY,
@@ -1519,13 +1497,29 @@ static void duplicate_right_border_pixels(SDL_Overlay *bmp) {
}
}
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos, int serial)
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos, int serial)
{
VideoPicture *vp;
double frame_delay, pts = pts1;
/* compute the exact PTS for the picture if it is omitted in the stream
* pts1 is the dts of the pkt / pts of the frame */
if (pts != 0) {
/* update video clock with pts, if present */
is->video_clock = pts;
} else {
pts = is->video_clock;
}
/* update video clock for next frame */
frame_delay = av_q2d(is->video_st->codec->time_base);
/* for MPEG2, the frame can be repeated, so we update the
clock accordingly */
frame_delay += src_frame->repeat_pict * (frame_delay * 0.5);
is->video_clock += frame_delay;
#if defined(DEBUG_SYNC) && 0
printf("frame_type=%c pts=%0.3f\n",
av_get_picture_type_char(src_frame->pict_type), pts);
printf("frame_type=%c clock=%0.3f pts=%0.3f\n",
av_get_picture_type_char(src_frame->pict_type), pts, pts1);
#endif
/* wait until we have space to put a new picture */
@@ -1625,6 +1619,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
vp->pts = pts;
vp->pos = pos;
vp->skip = 0;
vp->serial = serial;
/* now we can update the picture count */
@@ -1639,7 +1634,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt, int *serial)
{
int got_picture;
int got_picture, i;
if (packet_queue_get(&is->videoq, pkt, 1, serial) < 0)
return -1;
@@ -1649,6 +1644,9 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
SDL_LockMutex(is->pictq_mutex);
// Make sure there are no long delay timers (ideally we should just flush the queue but that's harder)
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
is->pictq[i].skip = 1;
}
while (is->pictq_size && !is->videoq.abort_request) {
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
}
@@ -1686,7 +1684,7 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
double clockdiff = get_video_clock(is) - get_master_clock(is);
double dpts = av_q2d(is->video_st->time_base) * *pts;
double ptsdiff = dpts - is->frame_last_pts;
if (!isnan(clockdiff) && fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
if (fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
ptsdiff > 0 && ptsdiff < AV_NOSYNC_THRESHOLD &&
clockdiff + ptsdiff - is->frame_last_filter_delay < 0) {
is->frame_last_dropped_pos = pkt->pos;
@@ -1755,7 +1753,6 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
if (!buffersink_params)
return AVERROR(ENOMEM);
av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags);
graph->scale_sws_opts = av_strdup(sws_flags_str);
@@ -1817,7 +1814,6 @@ static int video_thread(void *arg)
int last_w = 0;
int last_h = 0;
enum AVPixelFormat last_format = -2;
int last_serial = -1;
if (codec->codec->capabilities & CODEC_CAP_DR1) {
is->use_dr1 = 1;
@@ -1848,14 +1844,9 @@ static int video_thread(void *arg)
#if CONFIG_AVFILTER
if ( last_w != frame->width
|| last_h != frame->height
|| last_format != frame->format
|| last_serial != serial) {
av_log(NULL, AV_LOG_DEBUG,
"Video frame changed from size:%dx%d format:%s serial:%d to size:%dx%d format:%s serial:%d\n",
last_w, last_h,
(const char *)av_x_if_null(av_get_pix_fmt_name(last_format), "none"), last_serial,
frame->width, frame->height,
(const char *)av_x_if_null(av_get_pix_fmt_name(frame->format), "none"), serial);
|| last_format != frame->format) {
av_log(NULL, AV_LOG_INFO, "Frame changed from size:%dx%d to size:%dx%d\n",
last_w, last_h, frame->width, frame->height);
avfilter_graph_free(&graph);
graph = avfilter_graph_alloc();
if ((ret = configure_video_filters(graph, is, vfilters, frame)) < 0) {
@@ -1871,7 +1862,6 @@ static int video_thread(void *arg)
last_w = frame->width;
last_h = frame->height;
last_format = frame->format;
last_serial = serial;
}
frame->pts = pts_int;
@@ -2047,7 +2037,7 @@ static int synchronize_audio(VideoState *is, int nb_samples)
diff = get_audio_clock(is) - get_master_clock(is);
if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) {
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum;
if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
/* not enough measures to have a correct estimate */
@@ -2062,9 +2052,9 @@ static int synchronize_audio(VideoState *is, int nb_samples)
max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100));
wanted_nb_samples = FFMIN(FFMAX(wanted_nb_samples, min_nb_samples), max_nb_samples);
}
av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n",
av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
diff, avg_diff, wanted_nb_samples - nb_samples,
is->audio_clock, is->audio_diff_threshold);
is->audio_clock, is->video_clock, is->audio_diff_threshold);
}
} else {
/* too big difference : may be initial PTS errors, so
@@ -2077,14 +2067,8 @@ static int synchronize_audio(VideoState *is, int nb_samples)
return wanted_nb_samples;
}
/**
* Decode one audio frame and return its uncompressed size.
*
* The processed audio frame is decoded, converted if required, and
* stored in is->audio_buf, with size in bytes given by the return
* value.
*/
static int audio_decode_frame(VideoState *is)
/* decode one audio frame and returns its uncompressed size */
static int audio_decode_frame(VideoState *is, double *pts_ptr)
{
AVPacket *pkt_temp = &is->audio_pkt_temp;
AVPacket *pkt = &is->audio_pkt;
@@ -2092,7 +2076,7 @@ static int audio_decode_frame(VideoState *is)
int len1, len2, data_size, resampled_data_size;
int64_t dec_channel_layout;
int got_frame;
av_unused double audio_clock0;
double pts;
int new_packet = 0;
int flush_complete = 0;
int wanted_nb_samples;
@@ -2106,9 +2090,6 @@ static int audio_decode_frame(VideoState *is)
} else
avcodec_get_frame_defaults(is->frame);
if (is->audioq.serial != is->audio_pkt_temp_serial)
break;
if (is->paused)
return -1;
@@ -2131,13 +2112,13 @@ static int audio_decode_frame(VideoState *is)
flush_complete = 1;
continue;
}
data_size = av_samples_get_buffer_size(NULL, av_frame_get_channels(is->frame),
data_size = av_samples_get_buffer_size(NULL, is->frame->channels,
is->frame->nb_samples,
is->frame->format, 1);
dec_channel_layout =
(is->frame->channel_layout && av_frame_get_channels(is->frame) == av_get_channel_layout_nb_channels(is->frame->channel_layout)) ?
is->frame->channel_layout : av_get_default_channel_layout(av_frame_get_channels(is->frame));
(is->frame->channel_layout && is->frame->channels == av_get_channel_layout_nb_channels(is->frame->channel_layout)) ?
is->frame->channel_layout : av_get_default_channel_layout(is->frame->channels);
wanted_nb_samples = synchronize_audio(is, is->frame->nb_samples);
if (is->frame->format != is->audio_src.fmt ||
@@ -2151,21 +2132,20 @@ static int audio_decode_frame(VideoState *is)
0, NULL);
if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) {
fprintf(stderr, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n",
is->frame->sample_rate, av_get_sample_fmt_name(is->frame->format), av_frame_get_channels(is->frame),
is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
is->frame->sample_rate, av_get_sample_fmt_name(is->frame->format), (int)is->frame->channels,
is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
break;
}
is->audio_src.channel_layout = dec_channel_layout;
is->audio_src.channels = av_frame_get_channels(is->frame);
is->audio_src.channels = is->frame->channels;
is->audio_src.freq = is->frame->sample_rate;
is->audio_src.fmt = is->frame->format;
}
if (is->swr_ctx) {
const uint8_t **in = (const uint8_t **)is->frame->extended_data;
uint8_t **out = &is->audio_buf1;
int out_count = (int64_t)wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate + 256;
int out_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, out_count, is->audio_tgt.fmt, 0);
uint8_t *out[] = {is->audio_buf2};
int out_count = sizeof(is->audio_buf2) / is->audio_tgt.channels / av_get_bytes_per_sample(is->audio_tgt.fmt);
if (wanted_nb_samples != is->frame->nb_samples) {
if (swr_set_compensation(is->swr_ctx, (wanted_nb_samples - is->frame->nb_samples) * is->audio_tgt.freq / is->frame->sample_rate,
wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate) < 0) {
@@ -2173,9 +2153,6 @@ static int audio_decode_frame(VideoState *is)
break;
}
}
av_fast_malloc(&is->audio_buf1, &is->audio_buf1_size, out_size);
if (!is->audio_buf1)
return AVERROR(ENOMEM);
len2 = swr_convert(is->swr_ctx, out, out_count, in, is->frame->nb_samples);
if (len2 < 0) {
fprintf(stderr, "swr_convert() failed\n");
@@ -2185,22 +2162,24 @@ static int audio_decode_frame(VideoState *is)
fprintf(stderr, "warning: audio buffer is probably too small\n");
swr_init(is->swr_ctx);
}
is->audio_buf = is->audio_buf1;
is->audio_buf = is->audio_buf2;
resampled_data_size = len2 * is->audio_tgt.channels * av_get_bytes_per_sample(is->audio_tgt.fmt);
} else {
is->audio_buf = is->frame->data[0];
resampled_data_size = data_size;
}
audio_clock0 = is->audio_clock;
/* if no pts, then compute it */
pts = is->audio_clock;
*pts_ptr = pts;
is->audio_clock += (double)data_size /
(av_frame_get_channels(is->frame) * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
(is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
#ifdef DEBUG
{
static double last_clock;
printf("audio: delay=%0.3f clock=%0.3f clock0=%0.3f\n",
printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
is->audio_clock - last_clock,
is->audio_clock, audio_clock0);
is->audio_clock, pts);
last_clock = is->audio_clock;
}
#endif
@@ -2212,7 +2191,7 @@ static int audio_decode_frame(VideoState *is)
av_free_packet(pkt);
memset(pkt_temp, 0, sizeof(*pkt_temp));
if (is->audioq.abort_request) {
if (is->paused || is->audioq.abort_request) {
return -1;
}
@@ -2233,7 +2212,6 @@ static int audio_decode_frame(VideoState *is)
/* if update the audio clock with the pts */
if (pkt->pts != AV_NOPTS_VALUE) {
is->audio_clock = av_q2d(is->audio_st->time_base)*pkt->pts;
is->audio_clock_serial = is->audio_pkt_temp_serial;
}
}
}
@@ -2245,12 +2223,13 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
int audio_size, len1;
int bytes_per_sec;
int frame_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, 1, is->audio_tgt.fmt, 1);
double pts;
audio_callback_time = av_gettime();
while (len > 0) {
if (is->audio_buf_index >= is->audio_buf_size) {
audio_size = audio_decode_frame(is);
audio_size = audio_decode_frame(is, &pts);
if (audio_size < 0) {
/* if error, just output silence */
is->audio_buf = is->silence_buf;
@@ -2275,7 +2254,7 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
/* Let's assume the audio driver that is used by SDL has two periods. */
is->audio_current_pts = is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / bytes_per_sec;
is->audio_current_pts_drift = is->audio_current_pts - audio_callback_time / 1000000.0;
if (is->audioq.serial == is->audio_clock_serial)
if (is->audioq.serial == is->audio_pkt_temp_serial)
check_external_clock_sync(is, is->audio_current_pts);
}
@@ -2459,7 +2438,6 @@ static void stream_component_close(VideoState *is, int stream_index)
av_free_packet(&is->audio_pkt);
swr_free(&is->swr_ctx);
av_freep(&is->audio_buf1);
is->audio_buf1_size = 0;
is->audio_buf = NULL;
avcodec_free_frame(&is->frame);
@@ -2636,7 +2614,7 @@ static int read_thread(void *arg)
wanted_stream[AVMEDIA_TYPE_AUDIO],
st_index[AVMEDIA_TYPE_VIDEO],
NULL, 0);
if (!video_disable && !subtitle_disable)
if (!video_disable)
st_index[AVMEDIA_TYPE_SUBTITLE] =
av_find_best_stream(ic, AVMEDIA_TYPE_SUBTITLE,
wanted_stream[AVMEDIA_TYPE_SUBTITLE],
@@ -2659,6 +2637,7 @@ static int read_thread(void *arg)
if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]);
}
is->refresh_tid = SDL_CreateThread(refresh_thread, is);
if (is->show_mode == SHOW_MODE_NONE)
is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT;
@@ -2719,15 +2698,14 @@ static int read_thread(void *arg)
packet_queue_put(&is->videoq, &flush_pkt);
}
if (is->seek_flags & AVSEEK_FLAG_BYTE) {
update_external_clock_pts(is, NAN);
//FIXME: use a cleaner way to signal obsolete external clock...
update_external_clock_pts(is, (double)AV_NOPTS_VALUE);
} else {
update_external_clock_pts(is, seek_target / (double)AV_TIME_BASE);
}
}
is->seek_req = 0;
eof = 0;
if (is->paused)
step_to_next_frame(is);
}
if (is->queue_attachments_req) {
avformat_queue_attached_pictures(ic);
@@ -2855,12 +2833,11 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
is->continue_read_thread = SDL_CreateCond();
update_external_clock_pts(is, NAN);
//FIXME: use a cleaner way to signal obsolete external clock...
update_external_clock_pts(is, (double)AV_NOPTS_VALUE);
update_external_clock_speed(is, 1.0);
is->audio_current_pts_drift = -av_gettime() / 1000000.0;
is->video_current_pts_drift = is->audio_current_pts_drift;
is->audio_clock_serial = -1;
is->video_clock_serial = -1;
is->av_sync_type = av_sync_type;
is->read_tid = SDL_CreateThread(read_thread, is);
if (!is->read_tid) {
@@ -2937,40 +2914,30 @@ static void toggle_full_screen(VideoState *is)
is->pictq[i].reallocate = 1;
#endif
is_full_screen = !is_full_screen;
video_open(is, 1, NULL);
video_open(is, 1);
}
static void toggle_pause(VideoState *is)
{
stream_toggle_pause(is);
is->step = 0;
}
static void step_to_next_frame(VideoState *is)
{
/* if the stream is paused unpause it, then step */
if (is->paused)
stream_toggle_pause(is);
is->step = 1;
}
static void toggle_audio_display(VideoState *is)
{
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
int next = is->show_mode;
do {
next = (next + 1) % SHOW_MODE_NB;
} while (next != is->show_mode && (next == SHOW_MODE_VIDEO && !is->video_st || next != SHOW_MODE_VIDEO && !is->audio_st));
if (is->show_mode != next) {
fill_rectangle(screen,
is->xleft, is->ytop, is->width, is->height,
bgcolor, 1);
is->force_refresh = 1;
is->show_mode = next;
}
}
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) {
double remaining_time = 0.0;
SDL_PumpEvents();
while (!SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) {
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) {
SDL_ShowCursor(0);
cursor_hidden = 1;
}
if (remaining_time > 0.0)
av_usleep((int64_t)(remaining_time * 1000000.0));
remaining_time = REFRESH_RATE;
if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh))
video_refresh(is, &remaining_time);
SDL_PumpEvents();
}
is->show_mode = (is->show_mode + 1) % SHOW_MODE_NB;
fill_rectangle(screen,
is->xleft, is->ytop, is->width, is->height,
bgcolor, 1);
}
/* handle an event sent by the GUI */
@@ -2981,7 +2948,7 @@ static void event_loop(VideoState *cur_stream)
for (;;) {
double x;
refresh_loop_wait_event(cur_stream, &event);
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_KEYDOWN:
if (exit_on_keydown) {
@@ -3015,6 +2982,7 @@ static void event_loop(VideoState *cur_stream)
break;
case SDLK_w:
toggle_audio_display(cur_stream);
cur_stream->force_refresh = 1;
break;
case SDLK_PAGEUP:
incr = 600.0;
@@ -3049,8 +3017,6 @@ static void event_loop(VideoState *cur_stream)
stream_seek(cur_stream, pos, incr, 1);
} else {
pos = get_master_clock(cur_stream);
if (isnan(pos))
pos = (double)cur_stream->seek_pos / AV_TIME_BASE;
pos += incr;
if (cur_stream->ic->start_time != AV_NOPTS_VALUE && pos < cur_stream->ic->start_time / (double)AV_TIME_BASE)
pos = cur_stream->ic->start_time / (double)AV_TIME_BASE;
@@ -3120,6 +3086,14 @@ static void event_loop(VideoState *cur_stream)
case FF_ALLOC_EVENT:
alloc_picture(event.user.data1);
break;
case FF_REFRESH_EVENT:
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) {
SDL_ShowCursor(0);
cursor_hidden = 1;
}
video_refresh(event.user.data1);
cur_stream->refresh = 0;
break;
default:
break;
}
@@ -3238,7 +3212,6 @@ static const OptionDef options[] = {
{ "fs", OPT_BOOL, { &is_full_screen }, "force full screen" },
{ "an", OPT_BOOL, { &audio_disable }, "disable audio" },
{ "vn", OPT_BOOL, { &video_disable }, "disable video" },
{ "sn", OPT_BOOL, { &subtitle_disable }, "disable subtitling" },
{ "ast", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_AUDIO] }, "select desired audio stream", "stream_number" },
{ "vst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_VIDEO] }, "select desired video stream", "stream_number" },
{ "sst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_SUBTITLE] }, "select desired subtitle stream", "stream_number" },
@@ -3268,7 +3241,7 @@ static const OptionDef options[] = {
{ "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
{ "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" },
#if CONFIG_AVFILTER
{ "vf", OPT_STRING | HAS_ARG, { &vfilters }, "set video filters", "filter_graph" },
{ "vf", OPT_STRING | HAS_ARG, { &vfilters }, "video filters", "filter list" },
#endif
{ "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" },
{ "showmode", HAS_ARG, { .func_arg = opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" },

View File

@@ -203,7 +203,6 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
vald /= pow(10, index * 3);
prefix_string = decimal_unit_prefixes[index];
}
vali = vald;
}
if (show_float || (use_value_prefix && vald != (long long int)vald))
@@ -1473,11 +1472,11 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
print_time("pkt_pts_time", frame->pkt_pts, &stream->time_base);
print_ts ("pkt_dts", frame->pkt_dts);
print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base);
print_duration_ts ("pkt_duration", av_frame_get_pkt_duration(frame));
print_duration_time("pkt_duration_time", av_frame_get_pkt_duration(frame), &stream->time_base);
if (av_frame_get_pkt_pos (frame) != -1) print_fmt ("pkt_pos", "%"PRId64, av_frame_get_pkt_pos(frame));
print_duration_ts ("pkt_duration", frame->pkt_duration);
print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base);
if (frame->pkt_pos != -1) print_fmt ("pkt_pos", "%"PRId64, frame->pkt_pos);
else print_str_opt("pkt_pos", "N/A");
if (av_frame_get_pkt_size(frame) != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
if (frame->pkt_size != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
else print_str_opt("pkt_size", "N/A");
switch (stream->codec->codec_type) {

View File

@@ -328,14 +328,6 @@ static AVLFG random_state;
static FILE *logfile = NULL;
static void htmlstrip(char *s) {
while (s && *s) {
s += strspn(s, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,. ");
if (*s)
*s++ = '?';
}
}
static int64_t ffm_read_write_index(int fd)
{
uint8_t buf[8];
@@ -1133,7 +1125,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
if (av_strncasecmp(p, "Pragma:", 7) == 0) {
const char *q = p + 7;
while (*q && *q != '\n' && av_isspace(*q))
while (*q && *q != '\n' && isspace(*q))
q++;
if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
@@ -1155,7 +1147,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
if (stream_no < ratelen && stream_no >= 0)
rates[stream_no] = rate_no;
while (*q && *q != '\n' && !av_isspace(*q))
while (*q && *q != '\n' && !isspace(*q))
q++;
}
@@ -1266,7 +1258,7 @@ static void get_word(char *buf, int buf_size, const char **pp)
p = *pp;
skip_spaces(&p);
q = buf;
while (!av_isspace(*p) && *p != '\0') {
while (!isspace(*p) && *p != '\0') {
if ((q - buf) < buf_size - 1)
*q++ = *p;
p++;
@@ -1283,7 +1275,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
int quote;
p = *pp;
while (av_isspace(*p)) p++;
while (isspace(*p)) p++;
q = buf;
quote = 0;
if (*p == '\"' || *p == '\'')
@@ -1293,7 +1285,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
if (*p == quote)
break;
} else {
if (av_isspace(*p))
if (isspace(*p))
break;
}
if (*p == '\0')
@@ -1397,7 +1389,7 @@ static IPAddressACL* parse_dynamic_acl(FFStream *stream, HTTPContext *c)
break;
line_num++;
p = line;
while (av_isspace(*p))
while (isspace(*p))
p++;
if (*p == '\0' || *p == '#')
continue;
@@ -1548,7 +1540,7 @@ static int http_parse_request(HTTPContext *c)
for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
if (av_strncasecmp(p, "User-Agent:", 11) == 0) {
useragent = p + 11;
if (*useragent && *useragent != '\n' && av_isspace(*useragent))
if (*useragent && *useragent != '\n' && isspace(*useragent))
useragent++;
break;
}
@@ -1676,7 +1668,7 @@ static int http_parse_request(HTTPContext *c)
char *eoh;
char hostbuf[260];
while (av_isspace(*hostinfo))
while (isspace(*hostinfo))
hostinfo++;
eoh = strchr(hostinfo, '\n');
@@ -1895,7 +1887,6 @@ static int http_parse_request(HTTPContext *c)
send_error:
c->http_error = 404;
q = c->buffer;
htmlstrip(msg);
snprintf(q, c->buffer_size,
"HTTP/1.0 404 Not Found\r\n"
"Content-type: text/html\r\n"
@@ -4109,7 +4100,7 @@ static int parse_ffconfig(const char *filename)
break;
line_num++;
p = line;
while (av_isspace(*p))
while (isspace(*p))
p++;
if (*p == '\0' || *p == '#')
continue;
@@ -4246,7 +4237,7 @@ static int parse_ffconfig(const char *filename)
get_arg(arg, sizeof(arg), &p);
p1 = arg;
fsize = strtod(p1, &p1);
switch(av_toupper(*p1)) {
switch(toupper(*p1)) {
case 'K':
fsize *= 1024;
break;

View File

@@ -130,7 +130,7 @@ typedef struct CFrameBuffer {
typedef struct FourXContext {
AVCodecContext *avctx;
DSPContext dsp;
AVFrame *current_picture, *last_picture;
AVFrame current_picture, last_picture;
GetBitContext pre_gb; ///< ac/dc prefix
GetBitContext gb;
GetByteContext g;
@@ -138,7 +138,7 @@ typedef struct FourXContext {
int mv[256];
VLC pre_vlc;
int last_dc;
DECLARE_ALIGNED(16, int16_t, block)[6][64];
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
void *bitstream_buffer;
unsigned int bitstream_buffer_size;
int version;
@@ -153,7 +153,7 @@ typedef struct FourXContext {
#define MULTIPLY(var, const) (((var) * (const)) >> 16)
static void idct(int16_t block[64])
static void idct(DCTELEM block[64])
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
@@ -261,9 +261,9 @@ static void init_mv(FourXContext *f)
for (i = 0; i < 256; i++) {
if (f->version > 1)
f->mv[i] = mv[i][0] + mv[i][1] * f->current_picture->linesize[0] / 2;
f->mv[i] = mv[i][0] + mv[i][1] * f->current_picture.linesize[0] / 2;
else
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * f->current_picture->linesize[0] / 2;
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * f->current_picture.linesize[0] / 2;
}
}
@@ -340,7 +340,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
int code = get_vlc2(&f->gb,
block_type_vlc[1 - (f->version > 1)][index].table,
BLOCK_TYPE_VLC_BITS, 1);
uint16_t *start = (uint16_t *)f->last_picture->data[0];
uint16_t *start = (uint16_t *)f->last_picture.data[0];
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
av_assert2(code >= 0 && code <= 6);
@@ -409,9 +409,9 @@ static int decode_p_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 *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;
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;
@@ -435,7 +435,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
extra > length - bytestream_size - bitstream_size - wordstream_size) {
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 AVERROR_INVALIDDATA;
return -1;
}
av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
@@ -471,7 +471,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
* decode block and dequantize.
* Note this is almost identical to MJPEG.
*/
static int decode_i_block(FourXContext *f, int16_t *block)
static int decode_i_block(FourXContext *f, DCTELEM *block)
{
int code, i, j, level, val;
@@ -521,10 +521,10 @@ static int decode_i_block(FourXContext *f, int16_t *block)
static inline void idct_put(FourXContext *f, int x, int y)
{
int16_t (*block)[64] = f->block;
int stride = f->current_picture->linesize[0] >> 1;
DCTELEM (*block)[64] = f->block;
int stride = f->current_picture.linesize[0] >> 1;
int i;
uint16_t *dst = ((uint16_t*)f->current_picture->data[0]) + y * stride + x;
uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
for (i = 0; i < 4; i++) {
block[i][0] += 0x80 * 8 * 8;
@@ -542,7 +542,7 @@ static inline void idct_put(FourXContext *f, int x, int y)
* cr = (-1b - 4g + 5r) / 14 */
for (y = 0; y < 8; y++) {
for (x = 0; x < 8; x++) {
int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] +
DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] +
2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize
int cb = block[4][x + 8 * y];
int cr = block[5][x + 8 * y];
@@ -567,14 +567,13 @@ static inline void idct_put(FourXContext *f, int x, int y)
static int decode_i_mb(FourXContext *f)
{
int ret;
int i;
f->dsp.clear_blocks(f->block[0]);
for (i = 0; i < 6; i++)
if ((ret = decode_i_block(f, f->block[i])) < 0)
return ret;
if (decode_i_block(f, f->block[i]) < 0)
return -1;
return 0;
}
@@ -599,10 +598,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
for (;;) {
int i;
if (ptr_end - ptr < FFMAX(end - start + 1, 0) + 1) {
av_log(f->avctx, AV_LOG_ERROR, "invalid data in read_huffman_tables\n");
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
return NULL;
}
for (i = start; i <= end; i++)
frequency[i] = *ptr++;
start = *ptr++;
@@ -616,11 +613,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
while ((ptr - buf) & 3)
ptr++; // 4byte align
if (ptr > ptr_end) {
av_log(f->avctx, AV_LOG_ERROR, "ptr overflow in read_huffman_tables\n");
return NULL;
}
for (j = 257; j < 512; j++) {
int min_freq[2] = { 256 * 256, 256 * 256 };
int smallest[2] = { 0, 0 };
@@ -688,8 +680,8 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
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;
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;
@@ -733,7 +725,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
{
int x, y, ret;
int x, y;
const int width = f->avctx->width;
const int height = f->avctx->height;
const unsigned int bitstream_size = AV_RL32(buf);
@@ -753,16 +745,12 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|| prestream_size > (1 << 26)) {
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
prestream_size, bitstream_size, length);
return AVERROR_INVALIDDATA;
return -1;
}
prestream = read_huffman_tables(f, prestream, buf + length - prestream);
if (!prestream) {
av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
return AVERROR_INVALIDDATA;
}
av_assert0(prestream <= buf + length);
if (!prestream)
return -1;
init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
@@ -782,8 +770,8 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
for (y = 0; y < height; y += 16) {
for (x = 0; x < width; x += 16) {
if ((ret = decode_i_mb(f)) < 0)
return ret;
if (decode_i_mb(f) < 0)
return -1;
idct_put(f, x, y);
}
@@ -802,8 +790,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int buf_size = avpkt->size;
FourXContext *const f = avctx->priv_data;
AVFrame *picture = data;
AVFrame *p;
int i, frame_4cc, frame_size, ret;
AVFrame *p, temp;
int i, frame_4cc, frame_size;
if (buf_size < 12)
return AVERROR_INVALIDDATA;
@@ -855,7 +843,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
// explicit check needed as memcpy below might not catch a NULL
if (!cfrm->data) {
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
return AVERROR(ENOMEM);
return -1;
}
memcpy(cfrm->data + cfrm->size, buf + 20, data_size);
@@ -878,47 +866,49 @@ static int decode_frame(AVCodecContext *avctx, void *data,
frame_size = buf_size - 12;
}
FFSWAP(AVFrame*, f->current_picture, f->last_picture);
temp = f->current_picture;
f->current_picture = f->last_picture;
f->last_picture = temp;
p = f->current_picture;
p = &f->current_picture;
avctx->coded_frame = p;
// alternatively we would have to use our own buffer management
avctx->flags |= CODEC_FLAG_EMU_EDGE;
p->reference= 3;
if ((ret = avctx->reget_buffer(avctx, p)) < 0) {
if (avctx->reget_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
return -1;
}
if (frame_4cc == AV_RL32("ifr2")) {
p->pict_type= AV_PICTURE_TYPE_I;
if ((ret = decode_i2_frame(f, buf - 4, frame_size + 4)) < 0) {
if (decode_i2_frame(f, buf - 4, frame_size + 4) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
return ret;
return -1;
}
} else if (frame_4cc == AV_RL32("ifrm")) {
p->pict_type= AV_PICTURE_TYPE_I;
if ((ret = decode_i_frame(f, buf, frame_size)) < 0) {
if (decode_i_frame(f, buf, frame_size) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
return ret;
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;
if ((ret = ff_get_buffer(avctx, f->last_picture)) < 0) {
if (!f->last_picture.data[0]) {
f->last_picture.reference = 3;
if (ff_get_buffer(avctx, &f->last_picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
return -1;
}
for (i=0; i<avctx->height; i++)
memset(f->last_picture->data[0] + i*f->last_picture->linesize[0], 0, 2*avctx->width);
memset(f->last_picture.data[0] + i*f->last_picture.linesize[0], 0, 2*avctx->width);
}
p->pict_type = AV_PICTURE_TYPE_P;
if ((ret = decode_p_frame(f, buf, frame_size)) < 0) {
if (decode_p_frame(f, buf, frame_size) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
return ret;
return -1;
}
} else if (frame_4cc == AV_RL32("snd_")) {
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n",
@@ -938,6 +928,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
static av_cold void common_init(AVCodecContext *avctx)
{
FourXContext * const f = avctx->priv_data;
ff_dsputil_init(&f->dsp, avctx);
f->avctx = avctx;
}
static av_cold int decode_init(AVCodecContext *avctx)
{
FourXContext * const f = avctx->priv_data;
@@ -951,9 +951,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
avcodec_get_frame_defaults(&f->current_picture);
avcodec_get_frame_defaults(&f->last_picture);
f->version = AV_RL32(avctx->extradata) >> 16;
ff_dsputil_init(&f->dsp, avctx);
f->avctx = avctx;
common_init(avctx);
init_vlcs(f);
if (f->version > 2)
@@ -961,14 +962,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
else
avctx->pix_fmt = AV_PIX_FMT_BGR555;
f->current_picture = avcodec_alloc_frame();
f->last_picture = avcodec_alloc_frame();
if (!f->current_picture || !f->last_picture) {
avcodec_free_frame(&f->current_picture);
avcodec_free_frame(&f->last_picture);
return AVERROR(ENOMEM);
}
return 0;
}
@@ -985,12 +978,10 @@ static av_cold int decode_end(AVCodecContext *avctx)
f->cfrm[i].allocated_size = 0;
}
ff_free_vlc(&f->pre_vlc);
if (f->current_picture->data[0])
avctx->release_buffer(avctx, f->current_picture);
if (f->last_picture->data[0])
avctx->release_buffer(avctx, f->last_picture);
avcodec_free_frame(&f->current_picture);
avcodec_free_frame(&f->last_picture);
if (f->current_picture.data[0])
avctx->release_buffer(avctx, &f->current_picture);
if (f->last_picture.data[0])
avctx->release_buffer(avctx, &f->last_picture);
return 0;
}

View File

@@ -68,16 +68,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
unsigned char count;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
int ret;
if (c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 0;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
if (ff_get_buffer(avctx, &c->pic) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
return -1;
}
/* Set data pointer after line lengths */
@@ -97,14 +96,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
/* Decode a row of this plane */
while (dlen > 0) {
if (dp + 1 >= buf + buf_size)
return AVERROR_INVALIDDATA;
return -1;
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
if (pixptr + count * planes > pixptr_end)
break;
if (dp + count > buf + buf_size)
return AVERROR_INVALIDDATA;
return -1;
while (count--) {
*pixptr = *dp++;
pixptr += planes;
@@ -182,7 +181,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
default:
av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n",
avctx->bits_per_coded_sample);
return AVERROR_INVALIDDATA;
return -1;
}
return 0;

View File

@@ -44,6 +44,7 @@
/** decoder context */
typedef struct EightSvxContext {
AVFrame frame;
uint8_t fib_acc[2];
const int8_t *table;
@@ -87,7 +88,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
EightSvxContext *esc = avctx->priv_data;
AVFrame *frame = data;
int buf_size;
int ch, ret;
int hdr_size = 2;
@@ -135,20 +135,21 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
frame->nb_samples = buf_size * 2;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
esc->frame.nb_samples = buf_size * 2;
if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
for (ch = 0; ch < avctx->channels; ch++) {
delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
delta_decode(esc->frame.data[ch], &esc->data[ch][esc->data_idx],
buf_size, &esc->fib_acc[ch], esc->table);
}
esc->data_idx += buf_size;
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = esc->frame;
return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels;
}
@@ -171,6 +172,9 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
}
avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
avcodec_get_frame_defaults(&esc->frame);
avctx->coded_frame = &esc->frame;
return 0;
}

View File

@@ -25,6 +25,7 @@ OBJS = allcodecs.o \
fmtconvert.o \
imgconvert.o \
jrevdct.o \
log2_tab.o \
mathtables.o \
options.o \
parser.o \
@@ -41,6 +42,7 @@ OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DWT) += dwt.o snow.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
@@ -48,10 +50,8 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
$(FFT-OBJS-yes)
OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
OBJS-$(CONFIG_H264PRED) += h264pred.o
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
OBJS-$(CONFIG_LPC) += lpc.o
@@ -69,7 +69,6 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SHARED) += log2_tab.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o
OBJS-$(CONFIG_VAAPI) += vaapi.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
@@ -159,7 +158,7 @@ OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
dca_parser.o synth_filter.o
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
dirac_arith.o mpeg12data.o dirac_dwt.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
@@ -189,7 +188,6 @@ OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o
OBJS-$(CONFIG_EVRC_DECODER) += evrcdec.o acelp_vectors.o lsp.o
OBJS-$(CONFIG_EXR_DECODER) += exr.o
OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
@@ -220,7 +218,6 @@ OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
mpeg4video.o mpeg4videodec.o flvdec.o\
intelh263dec.o
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
h263.o ituh263enc.o flvenc.o
OBJS-$(CONFIG_H264_DECODER) += h264.o \
@@ -231,7 +228,6 @@ 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_H264_VDA_DECODER) += vda_h264_dec.o
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
OBJS-$(CONFIG_IAC_DECODER) += imc.o
@@ -288,18 +284,15 @@ OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
timecode.o
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
timecode.o
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
@@ -396,8 +389,8 @@ 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 snow_dwt.o
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o snow_dwt.o \
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o \
h263.o ituh263enc.o
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
@@ -458,12 +451,12 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
intrax8.o intrax8dsp.o
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbis.o \
vorbis_data.o xiph.o
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
vorbis_data.o
@@ -487,10 +480,10 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
celp_filters.o \
acelp_vectors.o acelp_filters.o
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
msmpeg4.o msmpeg4data.o \
intrax8.o intrax8dsp.o
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
msmpeg4.o msmpeg4enc.o msmpeg4data.o \
mpeg4videodec.o ituh263dec.o h263dec.o
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
@@ -699,10 +692,8 @@ OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
vorbis_data.o vorbis_parser.o xiph.o
OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o

View File

@@ -32,6 +32,7 @@
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "dsputil.h"
#include "fft.h"
#include "mpeg4audio.h"
#include "sbr.h"
@@ -81,7 +82,7 @@ enum BandType {
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
};
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
enum ChannelPosition {
AAC_CHANNEL_OFF = 0,
@@ -259,10 +260,10 @@ typedef struct ChannelElement {
/**
* main AAC context
*/
struct AACContext {
typedef struct AACContext {
AVClass *class;
AVCodecContext *avctx;
AVFrame *frame;
AVFrame frame;
int is_saved; ///< Set if elements have stored overlap from previous frame.
DynamicRangeControl che_drc;
@@ -291,6 +292,7 @@ struct AACContext {
FFTContext mdct;
FFTContext mdct_small;
FFTContext mdct_ltp;
DSPContext dsp;
FmtConvertContext fmt_conv;
AVFloatDSPContext fdsp;
int random_state;
@@ -316,18 +318,6 @@ struct AACContext {
OutputConfiguration oc[2];
int warned_num_aac_frames;
/* aacdec functions pointers */
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
void (*apply_tns)(float coef[1024], TemporalNoiseShaping *tns,
IndividualChannelStream *ics, int decode);
void (*windowing_and_mdct_ltp)(AACContext *ac, float *out,
float *in, IndividualChannelStream *ics);
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
};
void ff_aacdec_init_mips(AACContext *c);
} AACContext;
#endif /* AVCODEC_AAC_H */

View File

@@ -34,7 +34,7 @@ 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);

View File

@@ -710,7 +710,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] = { 0 }, uplims[128];
float maxvals[128];
int fflag, minscaler;

View File

@@ -84,6 +84,7 @@
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "dsputil.h"
#include "fft.h"
#include "fmtconvert.h"
#include "lpc.h"
@@ -107,17 +108,11 @@
#if ARCH_ARM
# include "arm/aac.h"
#elif ARCH_MIPS
# include "mips/aacdec_mips.h"
#endif
static VLC vlc_scalefactors;
static VLC vlc_spectral[11];
static int output_configure(AACContext *ac,
uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
enum OCStatus oc_type, int get_new_frame);
#define overread_err "Input buffer exhausted before END element found\n"
static int count_channels(uint8_t (*layout)[3], int tags)
@@ -189,12 +184,9 @@ static int frame_configure_elements(AVCodecContext *avctx)
}
}
if (!avctx->channels)
return 1;
/* get output buffer */
ac->frame->nb_samples = 2048;
if ((ret = ff_get_buffer(avctx, ac->frame)) < 0) {
ac->frame.nb_samples = 2048;
if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@@ -202,7 +194,7 @@ static int frame_configure_elements(AVCodecContext *avctx)
/* map output channel pointers to AVFrame data */
for (ch = 0; ch < avctx->channels; ch++) {
if (ac->output_element[ch])
ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch];
}
return 0;
@@ -414,8 +406,6 @@ static void pop_output_configuration(AACContext *ac) {
ac->oc[1] = ac->oc[0];
ac->avctx->channels = ac->oc[1].channels;
ac->avctx->channel_layout = ac->oc[1].channel_layout;
output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 0);
}
}
@@ -784,15 +774,13 @@ static int decode_audio_specific_config(AACContext *ac,
{
GetBitContext gb;
int i;
int ret;
av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
for (i = 0; i < bit_size >> 3; i++)
av_dlog(avctx, "%02x ", data[i]);
av_dlog(avctx, "\n");
if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
return ret;
init_get_bits(&gb, data, bit_size);
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
return -1;
@@ -882,8 +870,6 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \
size);
static void aacdec_init(AACContext *ac);
static av_cold int aac_decode_init(AVCodecContext *avctx)
{
AACContext *ac = avctx->priv_data;
@@ -891,8 +877,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
ac->avctx = avctx;
ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
aacdec_init(ac);
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
if (avctx->extradata_size > 0) {
@@ -949,6 +933,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
ff_aac_sbr_init();
ff_dsputil_init(&ac->dsp, avctx);
ff_fmt_convert_init(&ac->fmt_conv, avctx);
avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
@@ -972,6 +957,9 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
cbrt_tableinit();
avcodec_get_frame_defaults(&ac->frame);
avctx->coded_frame = &ac->frame;
return 0;
}
@@ -1411,7 +1399,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
cfo[k] = ac->random_state;
}
band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
band_energy = ac->dsp.scalarproduct_float(cfo, cfo, off_len);
scale = sf[idx] / sqrtf(band_energy);
ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
}
@@ -1746,9 +1734,9 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
if (cpe->ms_mask[idx] &&
cpe->ch[0].band_type[idx] < NOISE_BT && cpe->ch[1].band_type[idx] < NOISE_BT) {
for (group = 0; group < ics->group_len[g]; group++) {
ac->fdsp.butterflies_float(ch0 + group * 128 + offsets[i],
ch1 + group * 128 + offsets[i],
offsets[i+1] - offsets[i]);
ac->dsp.butterflies_float(ch0 + group * 128 + offsets[i],
ch1 + group * 128 + offsets[i],
offsets[i+1] - offsets[i]);
}
}
}
@@ -2148,9 +2136,9 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
ac->fdsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
}
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
ac->fdsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
} else {
ac->fdsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
memset(in + 1024 + 576, 0, 448 * sizeof(float));
}
ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
@@ -2176,10 +2164,10 @@ static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
memset(&predTime[i], 0, (2048 - i) * sizeof(float));
ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
if (sce->tns.present)
ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
apply_tns(predFreq, &sce->tns, &sce->ics, 0);
for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
if (ltp->used[sfb])
@@ -2203,17 +2191,17 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce)
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy(saved_ltp, saved, 512 * sizeof(float));
memset(saved_ltp + 576, 0, 448 * sizeof(float));
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
for (i = 0; i < 64; i++)
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
memset(saved_ltp + 576, 0, 448 * sizeof(float));
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
for (i = 0; i < 64; i++)
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
} else { // LONG_STOP or ONLY_LONG
ac->fdsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
ac->dsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
for (i = 0; i < 512; i++)
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
}
@@ -2254,35 +2242,35 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
*/
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
ac->fdsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
ac->dsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
} else {
memcpy( out, saved, 448 * sizeof(float));
memcpy( out, saved, 448 * sizeof(float));
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
ac->fdsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
ac->fdsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
ac->fdsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
ac->fdsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
ac->fdsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
ac->dsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
ac->dsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
ac->dsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
ac->dsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
ac->dsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
} else {
ac->fdsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
memcpy( out + 576, buf + 64, 448 * sizeof(float));
ac->dsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
memcpy( out + 576, buf + 64, 448 * sizeof(float));
}
}
// buffer update
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
memcpy( saved, temp + 64, 64 * sizeof(float));
ac->fdsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
ac->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
ac->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
memcpy( saved, temp + 64, 64 * sizeof(float));
ac->dsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
ac->dsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
ac->dsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
memcpy( saved, buf + 512, 448 * sizeof(float));
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
memcpy( saved, buf + 512, 448 * sizeof(float));
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
} else { // LONG_STOP or ONLY_LONG
memcpy( saved, buf + 512, 512 * sizeof(float));
memcpy( saved, buf + 512, 512 * sizeof(float));
}
}
@@ -2391,25 +2379,25 @@ static void spectral_to_sample(AACContext *ac)
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
if (che->ch[0].ics.predictor_present) {
if (che->ch[0].ics.ltp.present)
ac->apply_ltp(ac, &che->ch[0]);
apply_ltp(ac, &che->ch[0]);
if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
ac->apply_ltp(ac, &che->ch[1]);
apply_ltp(ac, &che->ch[1]);
}
}
if (che->ch[0].tns.present)
ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
if (che->ch[1].tns.present)
ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
if (type <= TYPE_CPE)
apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
ac->imdct_and_windowing(ac, &che->ch[0]);
imdct_and_windowing(ac, &che->ch[0]);
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
ac->update_ltp(ac, &che->ch[0]);
update_ltp(ac, &che->ch[0]);
if (type == TYPE_CPE) {
ac->imdct_and_windowing(ac, &che->ch[1]);
imdct_and_windowing(ac, &che->ch[1]);
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
ac->update_ltp(ac, &che->ch[1]);
update_ltp(ac, &che->ch[1]);
}
if (ac->oc[1].m4ac.sbr > 0) {
ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
@@ -2489,8 +2477,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
int is_dmono, sce_count = 0;
ac->frame = data;
if (show_bits(gb, 12) == 0xfff) {
if (parse_adts_frame_header(ac, gb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
@@ -2562,6 +2548,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (pce_found) {
av_log(avctx, AV_LOG_ERROR,
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
pop_output_configuration(ac);
} else {
err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
if (!err)
@@ -2610,8 +2597,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
is_dmono = ac->dmono_mode && sce_count == 2 &&
ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
if (samples)
ac->frame->nb_samples = samples;
if (samples) {
ac->frame.nb_samples = samples;
*(AVFrame *)data = ac->frame;
}
*got_frame_ptr = !!samples;
if (is_dmono) {
@@ -2629,7 +2618,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (multiplier) {
int side_size;
const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
uint32_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
if (side && side_size>=4)
AV_WL32(side, 2*AV_RL32(side));
}
@@ -2681,9 +2670,6 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
if (ac->force_dmono_mode >= 0)
ac->dmono_mode = ac->force_dmono_mode;
if (INT_MAX / 8 <= buf_size)
return AVERROR_INVALIDDATA;
init_get_bits(&gb, buf, buf_size * 8);
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt)) < 0)
@@ -2773,7 +2759,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
if(latmctx->initialized) {
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
} else {
av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n");
av_log(avctx, AV_LOG_INFO, "initializing latmctx\n");
}
latmctx->initialized = 0;
@@ -2934,8 +2920,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
int muxlength, err;
GetBitContext gb;
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
return err;
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
// check for LOAS sync word
if (get_bits(&gb, 11) != LOAS_SYNC_WORD)
@@ -2989,17 +2974,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
return ret;
}
static void aacdec_init(AACContext *c)
{
c->imdct_and_windowing = imdct_and_windowing;
c->apply_ltp = apply_ltp;
c->apply_tns = apply_tns;
c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
c->update_ltp = update_ltp;
if(ARCH_MIPS)
ff_aacdec_init_mips(c);
}
/**
* AVOptions for Japanese DTV specific extensions (ADTS only)
*/

View File

@@ -34,6 +34,7 @@
#include "libavutil/opt.h"
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "mpeg4audio.h"
#include "kbdwin.h"
@@ -182,7 +183,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
}
#define WINDOW_FUNC(type) \
static void apply_ ##type ##_window(AVFloatDSPContext *fdsp, \
static void apply_ ##type ##_window(DSPContext *dsp, AVFloatDSPContext *fdsp, \
SingleChannelElement *sce, \
const float *audio)
@@ -192,8 +193,8 @@ WINDOW_FUNC(only_long)
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
float *out = sce->ret_buf;
fdsp->vector_fmul (out, audio, lwindow, 1024);
fdsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
fdsp->vector_fmul (out, audio, lwindow, 1024);
dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
}
WINDOW_FUNC(long_start)
@@ -204,7 +205,7 @@ WINDOW_FUNC(long_start)
fdsp->vector_fmul(out, audio, lwindow, 1024);
memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
fdsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
}
@@ -217,7 +218,7 @@ WINDOW_FUNC(long_stop)
memset(out, 0, sizeof(out[0]) * 448);
fdsp->vector_fmul(out + 448, audio + 448, swindow, 128);
memcpy(out + 576, audio + 576, sizeof(out[0]) * 448);
fdsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
dsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
}
WINDOW_FUNC(eight_short)
@@ -229,15 +230,15 @@ WINDOW_FUNC(eight_short)
int w;
for (w = 0; w < 8; w++) {
fdsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
fdsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
out += 128;
in += 128;
fdsp->vector_fmul_reverse(out, in, swindow, 128);
dsp->vector_fmul_reverse(out, in, swindow, 128);
out += 128;
}
}
static void (*const apply_window[4])(AVFloatDSPContext *fdsp,
static void (*const apply_window[4])(DSPContext *dsp, AVFloatDSPContext *fdsp,
SingleChannelElement *sce,
const float *audio) = {
[ONLY_LONG_SEQUENCE] = apply_only_long_window,
@@ -252,7 +253,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
int i;
float *output = sce->ret_buf;
apply_window[sce->ics.window_sequence[0]](&s->fdsp, sce, audio);
apply_window[sce->ics.window_sequence[0]](&s->dsp, &s->fdsp, sce, audio);
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
@@ -570,8 +571,10 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
start_ch += chans;
}
if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels)) < 0)
if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels))) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
return ret;
}
do {
int frame_bits;
@@ -689,6 +692,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
{
int ret = 0;
ff_dsputil_init(&s->dsp, avctx);
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
// window init

View File

@@ -25,6 +25,7 @@
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "aac.h"
#include "audio_frame_queue.h"
@@ -60,6 +61,7 @@ typedef struct AACEncContext {
PutBitContext pb;
FFTContext mdct1024; ///< long (1024 samples) frame transform context
FFTContext mdct128; ///< short (128 samples) frame transform context
DSPContext dsp;
AVFloatDSPContext fdsp;
float *planar_samples[6]; ///< saved preprocessed input

View File

@@ -21,13 +21,13 @@
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "get_bits.h"
#include "aacps.h"
#include "aacps_tablegen.h"
#include "aacpsdata.c"
#include "dsputil.h"
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
///< Baseline implies 10 or 20 stereo bands,
@@ -429,7 +429,6 @@ static void hybrid_synthesis(PSDSPContext *dsp, float out[2][38][64],
#define DECAY_SLOPE 0.05f
/// Number of frequency bands that can be addressed by the parameter index, b(k)
static const int NR_PAR_BANDS[] = { 20, 34 };
static const int NR_IPDOPD_BANDS[] = { 11, 17 };
/// Number of frequency bands that can be addressed by the sub subband index, k
static const int NR_BANDS[] = { 71, 91 };
/// Start frequency band for the all-pass filter decay slope
@@ -824,8 +823,7 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];
h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];
if (!PS_BASELINE && ps->enable_ipdopd && b < NR_IPDOPD_BANDS[is34]) {
if (!PS_BASELINE && ps->enable_ipdopd && b < ps->nr_ipdopd_par) {
//The spec say says to only run this smoother when enable_ipdopd
//is set but the reference decoder appears to run it constantly
float h11i, h12i, h21i, h22i;

View File

@@ -211,6 +211,4 @@ av_cold void ff_psdsp_init(PSDSPContext *s)
if (ARCH_ARM)
ff_psdsp_init_arm(s);
if (ARCH_MIPS)
ff_psdsp_init_mips(s);
}

View File

@@ -49,6 +49,5 @@ typedef struct PSDSPContext {
void ff_psdsp_init(PSDSPContext *s);
void ff_psdsp_init_arm(PSDSPContext *s);
void ff_psdsp_init_mips(PSDSPContext *s);
#endif /* LIBAVCODEC_AACPSDSP_H */

View File

@@ -541,10 +541,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
float thr = band->thr;
if (band->energy > thr) {
thr = sqrtf(thr);
thr = sqrtf(thr) + reduction;
thr *= thr;
thr *= thr;
thr = powf(thr, 0.25f) + reduction;
thr = powf(thr, 4.0f);
/* This deviates from the 3GPP spec to match the reference encoder.
* It performs min(thr_reduced, max(thr, energy/min_snr)) only for bands
@@ -584,15 +582,13 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
AacPsyBand *band = &pch->band[w+g];
float form_factor = 0.0f;
float Temp;
band->energy = 0.0f;
for (i = 0; i < band_sizes[g]; i++) {
band->energy += coefs[start+i] * coefs[start+i];
form_factor += sqrtf(fabs(coefs[start+i]));
}
Temp = band->energy > 0 ? sqrtf((float)band_sizes[g] / band->energy) : 0;
band->thr = band->energy * 0.001258925f;
band->nz_lines = form_factor * sqrtf(Temp);
band->nz_lines = band->energy>0 ? form_factor / powf(band->energy / band_sizes[g], 0.25f) : 0;
start += band_sizes[g];
}

View File

@@ -33,7 +33,6 @@
#include "fft.h"
#include "aacps.h"
#include "sbrdsp.h"
#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"
@@ -44,10 +43,6 @@
#define ENVELOPE_ADJUSTMENT_OFFSET 2
#define NOISE_FLOOR_OFFSET 6.0f
#if ARCH_MIPS
#include "mips/aacsbr_mips.h"
#endif /* ARCH_MIPS */
/**
* SBR VLC tables
*/
@@ -91,8 +86,6 @@ static const int8_t vlc_sbr_lav[10] =
#define SBR_VLC_ROW(name) \
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
static void aacsbr_func_ptr_init(AACSBRContext *c);
av_cold void ff_aac_sbr_init(void)
{
int n;
@@ -161,7 +154,6 @@ av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
ff_ps_ctx_init(&sbr->ps);
ff_sbrdsp_init(&sbr->dsp);
aacsbr_func_ptr_init(&sbr->c);
}
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
@@ -399,8 +391,6 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
max_qmf_subbands = 35;
} else if (sbr->sample_rate >= 48000)
max_qmf_subbands = 32;
else
av_assert0(0);
if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) {
av_log(ac->avctx, AV_LOG_ERROR,
@@ -1131,12 +1121,7 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
float fac = temp1 / (1.0f + temp2);
sbr->data[0].env_facs[e][k] = fac;
sbr->data[1].env_facs[e][k] = fac * temp2;
}
@@ -1145,12 +1130,7 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n_q; k++) {
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
float fac = temp1 / (1.0f + temp2);
sbr->data[0].noise_facs[e][k] = fac;
sbr->data[1].noise_facs[e][k] = fac * temp2;
}
@@ -1159,15 +1139,9 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
sbr->data[ch].env_facs[e][k] =
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
if (sbr->data[ch].env_facs[e][k] > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
sbr->data[ch].env_facs[e][k] = 1;
}
}
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
for (k = 0; k < sbr->n_q; k++)
sbr->data[ch].noise_facs[e][k] =
@@ -1182,8 +1156,7 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
* @param x pointer to the beginning of the first sample window
* @param W array of complex-valued samples split into subbands
*/
#ifndef sbr_qmf_analysis
static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct,
SBRDSPContext *sbrdsp, const float *in, float *x,
float z[320], float W[2][32][32][2], int buf_idx)
{
@@ -1200,15 +1173,13 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
x += 32;
}
}
#endif
/**
* Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank
* (14496-3 sp04 p206)
*/
#ifndef sbr_qmf_synthesis
static void sbr_qmf_synthesis(FFTContext *mdct,
SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp,
static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
float *out, float X[2][38][64],
float mdct_buf[2][64],
float *v0, int *v_off, const unsigned int div)
@@ -1239,7 +1210,7 @@ static void sbr_qmf_synthesis(FFTContext *mdct,
mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
}
dsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
fdsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div);
dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div);
@@ -1252,7 +1223,6 @@ static void sbr_qmf_synthesis(FFTContext *mdct,
out += 64 >> div;
}
}
#endif
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
* (14496-3 sp04 p214)
@@ -1698,13 +1668,13 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
}
for (ch = 0; ch < nch; ch++) {
/* decode channel */
sbr_qmf_analysis(&ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
(float*)sbr->qmf_filter_scratch,
sbr->data[ch].W, sbr->data[ch].Ypos);
sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W, sbr->data[ch].Ypos);
sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W, sbr->data[ch].Ypos);
sbr->data[ch].Ypos ^= 1;
if (sbr->start) {
sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
sbr_chirp(sbr, &sbr->data[ch]);
sbr_hf_gen(ac, sbr, sbr->X_high, sbr->X_low, sbr->alpha0, sbr->alpha1,
sbr->data[ch].bw_array, sbr->data[ch].t_env,
@@ -1715,14 +1685,14 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
if (!err) {
sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]);
sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
sbr->c.sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
sbr->X_high, sbr, &sbr->data[ch],
sbr->data[ch].e_a);
}
}
/* synthesis */
sbr->c.sbr_x_gen(sbr, sbr->X[ch],
sbr_x_gen(sbr, sbr->X[ch],
sbr->data[ch].Y[1-sbr->data[ch].Ypos],
sbr->data[ch].Y[ sbr->data[ch].Ypos],
sbr->X_low, ch);
@@ -1737,26 +1707,15 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
nch = 2;
}
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp,
L, sbr->X[0], sbr->qmf_filter_scratch,
sbr->data[0].synthesis_filterbank_samples,
&sbr->data[0].synthesis_filterbank_samples_offset,
downsampled);
if (nch == 2)
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp,
R, sbr->X[1], sbr->qmf_filter_scratch,
sbr->data[1].synthesis_filterbank_samples,
&sbr->data[1].synthesis_filterbank_samples_offset,
downsampled);
}
static void aacsbr_func_ptr_init(AACSBRContext *c)
{
c->sbr_lf_gen = sbr_lf_gen;
c->sbr_hf_assemble = sbr_hf_assemble;
c->sbr_x_gen = sbr_x_gen;
c->sbr_hf_inverse_filter = sbr_hf_inverse_filter;
if(ARCH_MIPS)
ff_aacsbr_func_ptr_init_mips(c);
}

View File

@@ -34,11 +34,11 @@
#include "sbr.h"
/** Initialize SBR. */
void ff_aac_sbr_init(void);
av_cold void ff_aac_sbr_init(void);
/** Initialize one SBR context. */
void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
/** Close one SBR context. */
void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
/** Decode one SBR element. */
int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
GetBitContext *gb, int crc, int cnt, int id_aac);
@@ -46,6 +46,4 @@ int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
float* L, float *R);
void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c);
#endif /* AVCODEC_AACSBR_H */

View File

@@ -29,6 +29,7 @@
#include <string.h>
#include "avcodec.h"
#include "dsputil.h"
#include "msrledec.h"
typedef struct AascContext {
@@ -80,7 +81,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AascContext *s = avctx->priv_data;
int compr, i, stride, psize, ret;
int compr, i, stride, psize;
if (buf_size < 4) {
av_log(avctx, AV_LOG_ERROR, "frame too short\n");
@@ -89,9 +90,9 @@ static int aasc_decode_frame(AVCodecContext *avctx,
s->frame.reference = 3;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
if (avctx->reget_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
return -1;
}
compr = AV_RL32(buf);
@@ -123,7 +124,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);
return AVERROR_INVALIDDATA;
return -1;
}
break;
default:

View File

@@ -147,7 +147,7 @@ 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;

View File

@@ -170,7 +170,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
ff_kbd_window_init(s->window, 5.0, 256);
ff_dsputil_init(&s->dsp, avctx);
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
ff_fmt_convert_init(&s->fmt_conv, avctx);
av_lfg_init(&s->dith_state, 0);
@@ -185,6 +184,9 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
}
s->downmixed = 1;
avcodec_get_frame_defaults(&s->frame);
avctx->coded_frame = &s->frame;
for (i = 0; i < AC3_MAX_CHANNELS; i++) {
s->xcfptr[i] = s->transform_coeffs[i];
s->dlyptr[i] = s->delay[i];
@@ -439,9 +441,8 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
int mantissa;
switch (bap) {
case 0:
/* random noise with approximate range of -0.707 to 0.707 */
if (dither)
mantissa = (((av_lfg_get(&s->dith_state)>>8)*181)>>8) - 5931008;
mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
else
mantissa = 0;
break;
@@ -605,15 +606,15 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
for (i = 0; i < 128; i++)
x[i] = s->transform_coeffs[ch][2 * i];
s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
s->dsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
for (i = 0; i < 128; i++)
x[i] = s->transform_coeffs[ch][2 * i + 1];
s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
} else {
s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
s->dsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(float));
}
}
@@ -1264,7 +1265,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
static int ac3_decode_frame(AVCodecContext * avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AC3DecodeContext *s = avctx->priv_data;
@@ -1336,10 +1336,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
if (!err) {
avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate;
}
/* channel config */
if (!err || (s->channels && s->out_channels != s->channels)) {
/* channel config */
s->out_channels = s->channels;
s->output_mode = s->channel_mode;
if (s->lfe_on)
@@ -1362,20 +1360,24 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
s->fbw_channels == s->out_channels)) {
set_downmix_coeffs(s);
}
} else if (!s->channels) {
av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
} else if (!s->out_channels) {
s->out_channels = avctx->channels;
if (s->out_channels < s->channels)
s->output_mode = s->out_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
}
if (avctx->channels != s->out_channels) {
av_log(avctx, AV_LOG_ERROR, "channel number mismatching on damaged frame\n");
return AVERROR_INVALIDDATA;
}
avctx->channels = s->out_channels;
/* set audio service type based on bitstream mode for AC-3 */
avctx->audio_service_type = s->bitstream_mode;
if (s->bitstream_mode == 0x7 && s->channels > 1)
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
/* get output buffer */
frame->nb_samples = s->num_blocks * 256;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
avctx->channels = s->out_channels;
s->frame.nb_samples = s->num_blocks * 256;
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@@ -1388,7 +1390,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
for (ch = 0; ch < s->channels; ch++) {
if (ch < s->out_channels)
s->outptr[channel_map[ch]] = (float *)frame->data[ch];
s->outptr[channel_map[ch]] = (float *)s->frame.data[ch];
}
for (blk = 0; blk < s->num_blocks; blk++) {
if (!err && decode_audio_block(s, blk)) {
@@ -1397,7 +1399,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
if (err)
for (ch = 0; ch < s->out_channels; ch++)
memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
memcpy(((float*)s->frame.data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
for (ch = 0; ch < s->out_channels; ch++)
output[ch] = s->outptr[channel_map[ch]];
for (ch = 0; ch < s->out_channels; ch++) {
@@ -1406,13 +1408,14 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
}
av_frame_set_decode_error_flags(frame, err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0);
s->frame.decode_error_flags = err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0;
/* keep last block for error concealment in next frame */
for (ch = 0; ch < s->out_channels; ch++)
memcpy(s->output[ch], output[ch], 1024);
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
return FFMIN(buf_size, s->frame_size);
}

View File

@@ -50,7 +50,6 @@
#ifndef AVCODEC_AC3DEC_H
#define AVCODEC_AC3DEC_H
#include "libavutil/float_dsp.h"
#include "libavutil/lfg.h"
#include "ac3.h"
#include "ac3dsp.h"
@@ -69,6 +68,7 @@
typedef struct AC3DecodeContext {
AVClass *class; ///< class for AVOptions
AVCodecContext *avctx; ///< parent context
AVFrame frame; ///< AVFrame for decoded output
GetBitContext gbc; ///< bitstream reader
///@name Bit stream information
@@ -199,7 +199,6 @@ typedef struct AC3DecodeContext {
///@name Optimization
DSPContext dsp; ///< for optimization
AVFloatDSPContext fdsp;
AC3DSPContext ac3dsp;
FmtConvertContext fmt_conv; ///< optimized conversion functions
///@}

View File

@@ -34,10 +34,10 @@
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "ac3dsp.h"
#include "ac3.h"
#include "fft.h"

View File

@@ -28,7 +28,6 @@
#include <stdint.h>
#include "libavutil/internal.h"
/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
@@ -133,7 +132,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
#else
int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords;
#endif
int av_uninit(blk), ch, bnd, i, j;
int blk, ch, bnd, i, j;
CoefSumType energy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][16] = {{{0}}};
int cpl_start, num_cpl_coefs;
@@ -260,7 +259,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd];
blk1 = blk+1;
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd];
@@ -337,7 +336,7 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
{
int nb_coefs;
int blk, bnd;
AC3Block *block, *block0 = NULL;
AC3Block *block, *block0;
if (s->channel_mode != AC3_CHMODE_STEREO)
return;
@@ -435,7 +434,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
ff_ac3_quantize_mantissas(s);
if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)) < 0)
if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)))
return ret;
ff_ac3_output_frame(s, avpkt->data);

View File

@@ -21,10 +21,10 @@
*/
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "dsputil.h"
#include "acelp_pitch_delay.h"
#include "celp_math.h"
@@ -132,7 +132,7 @@ float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
// Note 10^(0.05 * -10log(average x2)) = 1/sqrt((average x2)).
float val = fixed_gain_factor *
exp2f(M_LOG2_10 * 0.05 *
(avpriv_scalarproduct_float_c(pred_table, prediction_error, 4) +
(ff_scalarproduct_float_c(pred_table, prediction_error, 4) +
energy_mean)) /
sqrtf(fixed_mean_energy);

View File

@@ -23,8 +23,8 @@
#include <inttypes.h>
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "dsputil.h"
#include "acelp_vectors.h"
const uint8_t ff_fc_2pulses_9bits_track1[16] =
@@ -203,7 +203,7 @@ void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
int size, float alpha, float *gain_mem)
{
int i;
float postfilter_energ = avpriv_scalarproduct_float_c(in, in, size);
float postfilter_energ = ff_scalarproduct_float_c(in, in, size);
float gain_scale_factor = 1.0;
float mem = *gain_mem;
@@ -224,7 +224,7 @@ void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
float sum_of_squares, const int n)
{
int i;
float scalefactor = avpriv_scalarproduct_float_c(in, in, n);
float scalefactor = ff_scalarproduct_float_c(in, in, n);
if (scalefactor)
scalefactor = sqrt(sum_of_squares / scalefactor);
for (i = 0; i < n; i++)

View File

@@ -85,6 +85,7 @@ static const int swf_index_tables[4][16] = {
/* end of tables */
typedef struct ADPCMDecodeContext {
AVFrame frame;
ADPCMChannelStatus status[6];
int vqa_version; /**< VQA version. Used for ADPCM_IMA_WS */
} ADPCMDecodeContext;
@@ -158,6 +159,9 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
}
avcodec_get_frame_defaults(&c->frame);
avctx->coded_frame = &c->frame;
return 0;
}
@@ -449,11 +453,9 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
* @param[out] coded_samples set to the number of samples as coded in the
* packet, or 0 if the codec does not encode the
* number of samples in each frame.
* @param[out] approx_nb_samples set to non-zero if the number of samples
* returned is an approximation.
*/
static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int buf_size, int *coded_samples, int *approx_nb_samples)
int buf_size, int *coded_samples)
{
ADPCMDecodeContext *s = avctx->priv_data;
int nb_samples = 0;
@@ -462,7 +464,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int header_size;
*coded_samples = 0;
*approx_nb_samples = 0;
if(ch <= 0)
return 0;
@@ -533,12 +534,10 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case AV_CODEC_ID_ADPCM_EA_R2:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_le32(gb);
*approx_nb_samples = 1;
break;
case AV_CODEC_ID_ADPCM_EA_R3:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_be32(gb);
*approx_nb_samples = 1;
break;
}
*coded_samples -= *coded_samples % 28;
@@ -620,7 +619,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ADPCMDecodeContext *c = avctx->priv_data;
@@ -630,31 +628,31 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int16_t **samples_p;
int st; /* stereo */
int count1, count2;
int nb_samples, coded_samples, approx_nb_samples, ret;
int nb_samples, coded_samples, ret;
GetByteContext gb;
bytestream2_init(&gb, buf, buf_size);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples, &approx_nb_samples);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples);
if (nb_samples <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;
}
/* get output buffer */
frame->nb_samples = nb_samples;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
c->frame.nb_samples = nb_samples;
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
samples = (short *)frame->data[0];
samples_p = (int16_t **)frame->extended_data;
samples = (short *)c->frame.data[0];
samples_p = (int16_t **)c->frame.extended_data;
/* use coded_samples when applicable */
/* it is always <= nb_samples, so the output buffer will be large enough */
if (coded_samples) {
if (!approx_nb_samples && coded_samples != nb_samples)
if (coded_samples != nb_samples)
av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
frame->nb_samples = nb_samples = coded_samples;
c->frame.nb_samples = nb_samples = coded_samples;
}
st = avctx->channels == 2 ? 1 : 0;
@@ -740,7 +738,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
}
for (i = 0; i < avctx->channels; i++) {
samples = (int16_t *)frame->data[i];
samples = (int16_t *)c->frame.data[i];
cs = &c->status[i];
for (n = nb_samples >> 1; n > 0; n--) {
int v = bytestream2_get_byteu(&gb);
@@ -868,9 +866,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*samples++ = c->status[0].predictor + c->status[1].predictor;
*samples++ = c->status[0].predictor - c->status[1].predictor;
}
if ((bytestream2_tell(&gb) & 1))
bytestream2_skip(&gb, 1);
break;
}
case AV_CODEC_ID_ADPCM_IMA_ISS:
@@ -1140,7 +1135,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
}
}
frame->nb_samples = count * 28;
c->frame.nb_samples = count * 28;
bytestream2_seek(&gb, 0, SEEK_END);
break;
}
@@ -1383,7 +1378,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = c->frame;
return bytestream2_tell(&gb);
}

View File

@@ -19,6 +19,7 @@
*/
#include "avcodec.h"
#include "get_bits.h"
#include "put_bits.h"
#include "bytestream.h"
#include "adpcm.h"
@@ -494,7 +495,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
else
pkt_size = avctx->block_align;
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)) < 0)
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)))
return ret;
dst = avpkt->data;
@@ -557,11 +558,10 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
put_bits(&pb, 7, status->step_index);
if (avctx->trellis > 0) {
uint8_t buf[64];
adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status,
adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
64, 1);
for (i = 0; i < 64; i++)
put_bits(&pb, 4, buf[i ^ 1]);
status->prev_sample = status->predictor;
} else {
for (i = 0; i < 64; i += 2) {
int t1, t2;

View File

@@ -40,6 +40,7 @@ typedef struct ADXChannelState {
} ADXChannelState;
typedef struct ADXContext {
AVFrame frame;
int channels;
ADXChannelState prev[2];
int header_parsed;

View File

@@ -52,6 +52,9 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
avcodec_get_frame_defaults(&c->frame);
avctx->coded_frame = &c->frame;
return 0;
}
@@ -95,7 +98,6 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
static int adx_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
int buf_size = avpkt->size;
ADXContext *c = avctx->priv_data;
int16_t **samples;
@@ -141,12 +143,12 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
frame->nb_samples = num_blocks * BLOCK_SAMPLES;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
c->frame.nb_samples = num_blocks * BLOCK_SAMPLES;
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
samples = (int16_t **)frame->extended_data;
samples = (int16_t **)c->frame.extended_data;
samples_offset = 0;
while (num_blocks--) {
@@ -162,7 +164,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
samples_offset += BLOCK_SAMPLES;
}
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = c->frame;
return buf - avpkt->data;
}

View File

@@ -107,14 +107,6 @@ static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
return HEADER_SIZE;
}
#if FF_API_OLD_ENCODE_AUDIO
static av_cold int adx_encode_close(AVCodecContext *avctx)
{
av_freep(&avctx->coded_frame);
return 0;
}
#endif
static av_cold int adx_encode_init(AVCodecContext *avctx)
{
ADXContext *c = avctx->priv_data;
@@ -126,8 +118,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
avctx->frame_size = BLOCK_SAMPLES;
#if FF_API_OLD_ENCODE_AUDIO
if (!(avctx->coded_frame = avcodec_alloc_frame()))
return AVERROR(ENOMEM);
avcodec_get_frame_defaults(&c->frame);
avctx->coded_frame = &c->frame;
#endif
/* the cutoff can be adjusted, but this seems to work pretty well */
@@ -175,9 +167,6 @@ AVCodec ff_adpcm_adx_encoder = {
.id = AV_CODEC_ID_ADPCM_ADX,
.priv_data_size = sizeof(ADXContext),
.init = adx_encode_init,
#if FF_API_OLD_ENCODE_AUDIO
.close = adx_encode_close,
#endif
.encode2 = adx_encode_frame,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },

View File

@@ -58,6 +58,7 @@
typedef struct {
AVCodecContext *avctx;
AVFrame frame;
GetBitContext gb;
int channels;
@@ -253,7 +254,7 @@ static void append_extra_bits(int32_t *buffer[2], int32_t *extra_bits_buffer[2],
buffer[ch][i] = (buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
}
static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
int channels)
{
ALACContext *alac = avctx->priv_data;
@@ -288,8 +289,8 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}
if (!alac->nb_samples) {
/* get output buffer */
frame->nb_samples = output_samples;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
alac->frame.nb_samples = output_samples;
if ((ret = ff_get_buffer(avctx, &alac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@@ -301,7 +302,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
alac->nb_samples = output_samples;
if (alac->direct_output) {
for (ch = 0; ch < channels; ch++)
alac->output_samples_buffer[ch] = (int32_t *)frame->extended_data[ch_index + ch];
alac->output_samples_buffer[ch] = (int32_t *)alac->frame.extended_data[ch_index + ch];
}
if (is_compressed) {
@@ -389,7 +390,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
switch(alac->sample_size) {
case 16: {
for (ch = 0; ch < channels; ch++) {
int16_t *outbuffer = (int16_t *)frame->extended_data[ch_index + ch];
int16_t *outbuffer = (int16_t *)alac->frame.extended_data[ch_index + ch];
for (i = 0; i < alac->nb_samples; i++)
*outbuffer++ = alac->output_samples_buffer[ch][i];
}}
@@ -404,7 +405,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}else{
switch(alac->sample_size) {
case 16: {
int16_t *outbuffer = ((int16_t *)frame->extended_data[0]) + ch_index;
int16_t *outbuffer = ((int16_t *)alac->frame.extended_data[0]) + ch_index;
for (i = 0; i < alac->nb_samples; i++) {
for (ch = 0; ch < channels; ch++)
*outbuffer++ = alac->output_samples_buffer[ch][i];
@@ -413,7 +414,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}
break;
case 24: {
int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
for (i = 0; i < alac->nb_samples; i++) {
for (ch = 0; ch < channels; ch++)
*outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
@@ -422,7 +423,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}
break;
case 32: {
int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
for (i = 0; i < alac->nb_samples; i++) {
for (ch = 0; ch < channels; ch++)
*outbuffer++ = alac->output_samples_buffer[ch][i];
@@ -440,7 +441,6 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
ALACContext *alac = avctx->priv_data;
AVFrame *frame = data;
enum AlacRawDataBlockType element;
int channels;
int ch, ret, got_end;
@@ -469,7 +469,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
ret = decode_element(avctx, frame,
ret = decode_element(avctx, data,
ff_alac_channel_layout_offsets[alac->channels - 1][ch],
channels);
if (ret < 0 && get_bits_left(&alac->gb))
@@ -487,7 +487,8 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
avpkt->size * 8 - get_bits_count(&alac->gb));
}
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = alac->frame;
return avpkt->size;
}
@@ -615,6 +616,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
return ret;
}
avcodec_get_frame_defaults(&alac->frame);
avctx->coded_frame = &alac->frame;
return 0;
}

View File

@@ -21,6 +21,7 @@
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "lpc.h"
#include "mathops.h"
@@ -274,7 +275,7 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
// generate warm-up samples
residual[0] = samples[0];
for (i = 1; i <= lpc.lpc_order; i++)
residual[i] = sign_extend(samples[i] - samples[i-1], s->write_sample_size);
residual[i] = samples[i] - samples[i-1];
// perform lpc on remaining samples
for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
@@ -613,7 +614,7 @@ static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
else
max_frame_size = s->max_coded_frame_size;
if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)) < 0)
if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)))
return ret;
/* use verbatim mode for compression_level 0 */

View File

@@ -74,23 +74,18 @@ void avcodec_register_all(void)
/* hardware accelerators */
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
REGISTER_HWACCEL(H263_VDPAU, h263_vdpau);
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
REGISTER_HWACCEL(H264_VAAPI, h264_vaapi);
REGISTER_HWACCEL(H264_VDA, h264_vda);
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau);
REGISTER_HWACCEL(MPEG2_DXVA2, mpeg2_dxva2);
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2);
REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi);
REGISTER_HWACCEL(WMV3_VDPAU, wmv3_vdpau);
/* video codecs */
REGISTER_ENCODER(A64MULTI, a64multi);
@@ -323,7 +318,6 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (DCA, dca);
REGISTER_DECODER(DSICINAUDIO, dsicinaudio);
REGISTER_ENCDEC (EAC3, eac3);
REGISTER_DECODER(EVRC, evrc);
REGISTER_DECODER(FFWAVESYNTH, ffwavesynth);
REGISTER_ENCDEC (FLAC, flac);
REGISTER_ENCDEC (G723_1, g723_1);
@@ -489,8 +483,7 @@ void avcodec_register_all(void)
REGISTER_ENCODER(LIBVO_AACENC, libvo_aacenc);
REGISTER_ENCODER(LIBVO_AMRWBENC, libvo_amrwbenc);
REGISTER_ENCDEC (LIBVORBIS, libvorbis);
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
REGISTER_ENCDEC (LIBVPX, libvpx);
REGISTER_ENCODER(LIBX264, libx264);
REGISTER_ENCODER(LIBX264RGB, libx264rgb);
REGISTER_ENCODER(LIBXAVS, libxavs);

View File

@@ -19,21 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "libavcodec/dsputil.h"
#include "dsputil_alpha.h"
#include "asm.h"
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
#if 0
/* These functions were the base for the optimized assembler routines,
and remain here for documentation purposes. */
static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
ptrdiff_t line_size)
static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
int line_size)
{
int i = 8;
uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */
@@ -56,8 +55,8 @@ static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
} while (--i);
}
void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
ptrdiff_t line_size)
void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
int line_size)
{
int h = 8;
/* Keep this function a leaf function by generating the constants
@@ -101,9 +100,9 @@ void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
}
#endif
static void clear_blocks_axp(int16_t *blocks) {
static void clear_blocks_axp(DCTELEM *blocks) {
uint64_t *p = (uint64_t *) blocks;
int n = sizeof(int16_t) * 6 * 64;
int n = sizeof(DCTELEM) * 6 * 64;
do {
p[0] = 0;
@@ -212,8 +211,8 @@ static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4)
#define MAKE_OP(OPNAME, SUFF, OPKIND, STORE) \
static void OPNAME ## _pixels ## SUFF ## _axp \
(uint8_t *restrict block, const uint8_t *restrict pixels, \
ptrdiff_t line_size, int h) \
(uint8_t *av_restrict block, const uint8_t *av_restrict pixels, \
int line_size, int h) \
{ \
if ((size_t) pixels & 0x7) { \
OPKIND(uldq, STORE); \
@@ -223,8 +222,8 @@ static void OPNAME ## _pixels ## SUFF ## _axp \
} \
\
static void OPNAME ## _pixels16 ## SUFF ## _axp \
(uint8_t *restrict block, const uint8_t *restrict pixels, \
ptrdiff_t line_size, int h) \
(uint8_t *av_restrict block, const uint8_t *av_restrict pixels, \
int line_size, int h) \
{ \
OPNAME ## _pixels ## SUFF ## _axp(block, pixels, line_size, h); \
OPNAME ## _pixels ## SUFF ## _axp(block + 8, pixels + 8, line_size, h); \
@@ -263,13 +262,13 @@ PIXOP(put_no_rnd, STORE);
PIXOP(avg_no_rnd, STORE);
static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
int line_size, int h)
{
put_pixels_axp_asm(block, pixels, line_size, h);
put_pixels_axp_asm(block + 8, pixels + 8, line_size, h);
}
av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
{
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
@@ -289,10 +288,10 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
c->avg_pixels_tab[0][2] = avg_pixels16_y2_axp;
c->avg_pixels_tab[0][3] = avg_pixels16_xy2_axp;
c->avg_no_rnd_pixels_tab[0] = avg_no_rnd_pixels16_axp;
c->avg_no_rnd_pixels_tab[1] = avg_no_rnd_pixels16_x2_axp;
c->avg_no_rnd_pixels_tab[2] = avg_no_rnd_pixels16_y2_axp;
c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy2_axp;
c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_axp;
c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_axp;
c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_axp;
c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_axp;
c->put_pixels_tab[1][0] = put_pixels_axp_asm;
c->put_pixels_tab[1][1] = put_pixels_x2_axp;
@@ -309,6 +308,11 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
c->avg_pixels_tab[1][2] = avg_pixels_y2_axp;
c->avg_pixels_tab[1][3] = avg_pixels_xy2_axp;
c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels_axp;
c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels_x2_axp;
c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels_y2_axp;
c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels_xy2_axp;
c->clear_blocks = clear_blocks_axp;
}

View File

@@ -19,27 +19,26 @@
#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#include <stddef.h>
#include <stdint.h>
#include "libavcodec/dsputil.h"
void ff_simple_idct_axp(int16_t *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_axp(DCTELEM *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);
void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size, int h);
void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
int line_size);
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
int line_size);
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, int line_size);
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
void get_pixels_mvi(DCTELEM *av_restrict block,
const uint8_t *av_restrict pixels, int line_size);
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
int stride);
int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);

View File

@@ -135,7 +135,7 @@ $aligned:
.end put_pixels_axp_asm
/************************************************************************
* void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
* void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* int line_size)
*/
.align 6
@@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm:
.end put_pixels_clamped_mvi_asm
/************************************************************************
* void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
* void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* int line_size)
*/
.align 6

View File

@@ -19,11 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/dsputil.h"
#include "dsputil_alpha.h"
#include "asm.h"
void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, int line_size)
void get_pixels_mvi(DCTELEM *av_restrict block,
const uint8_t *av_restrict pixels, int line_size)
{
int h = 8;
@@ -39,7 +40,7 @@ void get_pixels_mvi(int16_t *restrict block,
} while (--h);
}
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
int stride) {
int h = 8;
uint64_t mask = 0x4040;

View File

@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegvideo.h"
#include "asm.h"
static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs,
static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,
uint64_t qscale, uint64_t qadd)
{
uint64_t qmul = qscale << 1;
@@ -69,12 +69,12 @@ static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs,
}
}
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block,
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,
int n, int qscale)
{
int n_coeffs;
uint64_t qadd;
int16_t block0 = block[0];
DCTELEM block0 = block[0];
if (!s->h263_aic) {
if (n < 4)
@@ -96,14 +96,14 @@ static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block,
block[0] = block0;
}
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, int16_t *block,
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,
int n, int qscale)
{
int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]];
dct_unquantize_h263_axp(block, n_coeffs, qscale, (qscale - 1) | 1);
}
av_cold void ff_MPV_common_init_axp(MpegEncContext *s)
void ff_MPV_common_init_axp(MpegEncContext *s)
{
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_axp;
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_axp;

View File

@@ -26,6 +26,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/dsputil.h"
#include "dsputil_alpha.h"
#include "asm.h"
@@ -43,7 +44,7 @@
#define COL_SHIFT 20
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
static inline int idct_row(int16_t *row)
static inline int idct_row(DCTELEM *row)
{
int a0, a1, a2, a3, b0, b1, b2, b3, t;
uint64_t l, r, t2;
@@ -151,7 +152,7 @@ static inline int idct_row(int16_t *row)
return 2;
}
static inline void idct_col(int16_t *col)
static inline void idct_col(DCTELEM *col)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
@@ -228,7 +229,7 @@ static inline void idct_col(int16_t *col)
/* If all rows but the first one are zero after row transformation,
all rows will be identical after column transformation. */
static inline void idct_col2(int16_t *col)
static inline void idct_col2(DCTELEM *col)
{
int i;
uint64_t l, r;
@@ -250,7 +251,7 @@ static inline void idct_col2(int16_t *col)
stq(l, col + 14 * 4); stq(r, col + 15 * 4);
}
void ff_simple_idct_axp(int16_t *block)
void ff_simple_idct_axp(DCTELEM *block)
{
int i;
@@ -290,13 +291,13 @@ void ff_simple_idct_axp(int16_t *block)
}
}
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block)
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_simple_idct_axp(block);
put_pixels_clamped_axp_p(block, dest, line_size);
}
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block)
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_simple_idct_axp(block);
add_pixels_clamped_axp_p(block, dest, line_size);

View File

@@ -192,6 +192,7 @@ typedef struct {
typedef struct {
AVCodecContext *avctx;
AVFrame frame;
ALSSpecificConfig sconf;
GetBitContext gb;
DSPContext dsp;
@@ -284,14 +285,12 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac = {0};
MPEG4AudioConfig m4ac;
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;
int ret;
if ((ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size)) < 0)
return ret;
init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata,
avctx->extradata_size * 8, 1);
@@ -1449,7 +1448,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
AVPacket *avpkt)
{
ALSDecContext *ctx = avctx->priv_data;
AVFrame *frame = data;
ALSSpecificConfig *sconf = &ctx->sconf;
const uint8_t *buffer = avpkt->data;
int buffer_size = avpkt->size;
@@ -1479,8 +1477,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
ctx->frame_id++;
/* get output buffer */
frame->nb_samples = ctx->cur_frame_length;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
ctx->frame.nb_samples = ctx->cur_frame_length;
if ((ret = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
return ret;
}
@@ -1488,7 +1486,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
// transform decoded frame into output format
#define INTERLEAVE_OUTPUT(bps) \
{ \
int##bps##_t *dest = (int##bps##_t*)frame->data[0]; \
int##bps##_t *dest = (int##bps##_t*)ctx->frame.data[0]; \
shift = bps - ctx->avctx->bits_per_raw_sample; \
if (!ctx->cs_switch) { \
for (sample = 0; sample < ctx->cur_frame_length; sample++) \
@@ -1512,7 +1510,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
int swap = HAVE_BIGENDIAN != sconf->msb_first;
if (ctx->avctx->bits_per_raw_sample == 24) {
int32_t *src = (int32_t *)frame->data[0];
int32_t *src = (int32_t *)ctx->frame.data[0];
for (sample = 0;
sample < ctx->cur_frame_length * avctx->channels;
@@ -1533,7 +1531,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
if (swap) {
if (ctx->avctx->bits_per_raw_sample <= 16) {
int16_t *src = (int16_t*) frame->data[0];
int16_t *src = (int16_t*) ctx->frame.data[0];
int16_t *dest = (int16_t*) ctx->crc_buffer;
for (sample = 0;
sample < ctx->cur_frame_length * avctx->channels;
@@ -1541,12 +1539,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
*dest++ = av_bswap16(src[sample]);
} else {
ctx->dsp.bswap_buf((uint32_t*)ctx->crc_buffer,
(uint32_t *)frame->data[0],
(uint32_t *)ctx->frame.data[0],
ctx->cur_frame_length * avctx->channels);
}
crc_source = ctx->crc_buffer;
} else {
crc_source = frame->data[0];
crc_source = ctx->frame.data[0];
}
ctx->crc = av_crc(ctx->crc_table, ctx->crc, crc_source,
@@ -1562,7 +1560,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
}
}
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = ctx->frame;
bytes_read = invalid_frame ? buffer_size :
(get_bits_count(&ctx->gb) + 7) >> 3;
@@ -1759,6 +1759,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_dsputil_init(&ctx->dsp, avctx);
avcodec_get_frame_defaults(&ctx->frame);
avctx->coded_frame = &ctx->frame;
return 0;
}

View File

@@ -44,8 +44,8 @@
#include <math.h>
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "dsputil.h"
#include "libavutil/common.h"
#include "libavutil/avassert.h"
#include "celp_math.h"
@@ -98,6 +98,7 @@
#define AMR_AGC_ALPHA 0.9
typedef struct AMRContext {
AVFrame avframe; ///< AVFrame for decoded samples
AMRNBFrame frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc)
uint8_t bad_frame_indicator; ///< bad frame ? 1 : 0
enum Mode cur_frame_mode;
@@ -184,6 +185,9 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx)
for (i = 0; i < 4; i++)
p->prediction_error[i] = MIN_ENERGY;
avcodec_get_frame_defaults(&p->avframe);
avctx->coded_frame = &p->avframe;
ff_acelp_filter_init(&p->acelpf_ctx);
ff_acelp_vectors_init(&p->acelpv_ctx);
ff_celp_filter_init(&p->celpf_ctx);
@@ -806,7 +810,7 @@ static int synthesis(AMRContext *p, float *lpc,
// emphasize pitch vector contribution
if (p->pitch_gain[4] > 0.5 && !overflow) {
float energy = p->celpm_ctx.dot_productf(excitation, excitation,
AMR_SUBFRAME_SIZE);
AMR_SUBFRAME_SIZE);
float pitch_factor =
p->pitch_gain[4] *
(p->cur_frame_mode == MODE_12k2 ?
@@ -907,7 +911,7 @@ static void postfilter(AMRContext *p, float *lpc, float *buf_out)
float *samples = p->samples_in + LP_FILTER_ORDER; // Start of input
float speech_gain = p->celpm_ctx.dot_productf(samples, samples,
AMR_SUBFRAME_SIZE);
AMR_SUBFRAME_SIZE);
float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER]; // Output of pole filter
const float *gamma_n, *gamma_d; // Formant filter factor table
@@ -950,7 +954,6 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
{
AMRContext *p = avctx->priv_data; // pointer to private data
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
float *buf_out; // pointer to the output data buffer
@@ -962,12 +965,12 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
const float *synth_fixed_vector; // pointer to the fixed vector that synthesis should use
/* get output buffer */
frame->nb_samples = AMR_BLOCK_SIZE;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
p->avframe.nb_samples = AMR_BLOCK_SIZE;
if ((ret = ff_get_buffer(avctx, &p->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
buf_out = (float *)frame->data[0];
buf_out = (float *)p->avframe.data[0];
p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
if (p->cur_frame_mode == NO_DATA) {
@@ -1015,8 +1018,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
p->fixed_gain[4] =
ff_amr_set_fixed_gain(fixed_gain_factor,
p->celpm_ctx.dot_productf(p->fixed_vector,
p->fixed_vector,
AMR_SUBFRAME_SIZE) /
p->fixed_vector,
AMR_SUBFRAME_SIZE) /
AMR_SUBFRAME_SIZE,
p->prediction_error,
energy_mean[p->cur_frame_mode], energy_pred_fac);
@@ -1075,7 +1078,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
p->acelpv_ctx.weighted_vector_sumf(p->lsf_avg, p->lsf_avg, p->lsf_q[3],
0.84, 0.16, LP_FILTER_ORDER);
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = p->avframe;
/* return the amount of bytes consumed if everything was OK */
return frame_sizes_nb[p->cur_frame_mode] + 1; // +7 for rounding and +8 for TOC

View File

@@ -26,10 +26,10 @@
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "dsputil.h"
#include "lsp.h"
#include "celp_filters.h"
#include "celp_math.h"
@@ -45,6 +45,7 @@
#include "mips/amrwbdec_mips.h"
typedef struct {
AVFrame avframe; ///< AVFrame for decoded samples
AMRWBFrame frame; ///< AMRWB parameters decoded from bitstream
enum Mode fr_cur_mode; ///< mode index of current frame
uint8_t fr_quality; ///< frame quality index (FQI)
@@ -120,6 +121,9 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
for (i = 0; i < 4; i++)
ctx->prediction_error[i] = MIN_ENERGY;
avcodec_get_frame_defaults(&ctx->avframe);
avctx->coded_frame = &ctx->avframe;
ff_acelp_filter_init(&ctx->acelpf_ctx);
ff_acelp_vectors_init(&ctx->acelpv_ctx);
ff_celp_filter_init(&ctx->celpf_ctx);
@@ -608,11 +612,11 @@ static float voice_factor(float *p_vector, float p_gain,
CELPMContext *ctx)
{
double p_ener = (double) ctx->dot_productf(p_vector, p_vector,
AMRWB_SFR_SIZE) *
p_gain * p_gain;
AMRWB_SFR_SIZE) *
p_gain * p_gain;
double f_ener = (double) ctx->dot_productf(f_vector, f_vector,
AMRWB_SFR_SIZE) *
f_gain * f_gain;
AMRWB_SFR_SIZE) *
f_gain * f_gain;
return (p_ener - f_ener) / (p_ener + f_ener);
}
@@ -781,7 +785,7 @@ static void synthesis(AMRWBContext *ctx, float *lpc, float *excitation,
if (ctx->pitch_gain[0] > 0.5 && ctx->fr_cur_mode <= MODE_8k85) {
int i;
float energy = ctx->celpm_ctx.dot_productf(excitation, excitation,
AMRWB_SFR_SIZE);
AMRWB_SFR_SIZE);
// XXX: Weird part in both ref code and spec. A unknown parameter
// {beta} seems to be identical to the current pitch gain
@@ -842,8 +846,8 @@ static void upsample_5_4(float *out, const float *in, int o_size, CELPMContext *
for (k = 1; k < 5; k++) {
out[i] = ctx->dot_productf(in0 + int_part,
upsample_fir[4 - frac_part],
UPS_MEM_SIZE);
upsample_fir[4 - frac_part],
UPS_MEM_SIZE);
int_part++;
frac_part--;
i++;
@@ -889,8 +893,7 @@ static void scaled_hb_excitation(AMRWBContext *ctx, float *hb_exc,
const float *synth_exc, float hb_gain)
{
int i;
float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc,
AMRWB_SFR_SIZE);
float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc, AMRWB_SFR_SIZE);
/* Generate a white-noise excitation */
for (i = 0; i < AMRWB_SFR_SIZE_16k; i++)
@@ -1093,7 +1096,6 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AMRWBContext *ctx = avctx->priv_data;
AVFrame *frame = data;
AMRWBFrame *cf = &ctx->frame;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
@@ -1111,12 +1113,12 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
int sub, i, ret;
/* get output buffer */
frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
ctx->avframe.nb_samples = 4 * AMRWB_SFR_SIZE_16k;
if ((ret = ff_get_buffer(avctx, &ctx->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
buf_out = (float *)frame->data[0];
buf_out = (float *)ctx->avframe.data[0];
header_size = decode_mime_header(ctx, buf);
if (ctx->fr_cur_mode > MODE_SID) {
@@ -1187,8 +1189,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
ctx->fixed_gain[0] =
ff_amr_set_fixed_gain(fixed_gain_factor,
ctx->celpm_ctx.dot_productf(ctx->fixed_vector,
ctx->fixed_vector,
AMRWB_SFR_SIZE) /
ctx->fixed_vector,
AMRWB_SFR_SIZE) /
AMRWB_SFR_SIZE,
ctx->prediction_error,
ENERGY_MEAN, energy_pred_fac);
@@ -1262,7 +1264,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(ctx->isp[3][0]));
memcpy(ctx->isf_past_final, ctx->isf_cur, LP_ORDER * sizeof(float));
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = ctx->avframe;
return expected_fr_size;
}

View File

@@ -114,7 +114,7 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *dst, *dst_end;
int count, ret;
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0){
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@@ -112,7 +112,7 @@ static void hscroll(AVCodecContext *avctx)
AnsiContext *s = avctx->priv_data;
int i;
if (s->y <= avctx->height - 2*s->font_height) {
if (s->y < avctx->height - s->font_height) {
s->y += s->font_height;
return;
}
@@ -165,7 +165,7 @@ static void draw_char(AVCodecContext *avctx, int c)
ff_draw_pc_font(s->frame.data[0] + s->y * s->frame.linesize[0] + s->x,
s->frame.linesize[0], s->font, s->font_height, c, fg, bg);
s->x += FONT_WIDTH;
if (s->x > avctx->width - FONT_WIDTH) {
if (s->x >= avctx->width) {
s->x = 0;
hscroll(avctx);
}
@@ -239,8 +239,6 @@ static int execute_code(AVCodecContext * avctx, int c)
default:
av_log_ask_for_sample(avctx, "unsupported screen mode\n");
}
s->x = av_clip(s->x, 0, width - FONT_WIDTH);
s->y = av_clip(s->y, 0, height - s->font_height);
if (width != avctx->width || height != avctx->height) {
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
@@ -337,8 +335,6 @@ static int execute_code(AVCodecContext * avctx, int c)
av_log_ask_for_sample(avctx, "unsupported escape code\n");
break;
}
s->x = av_clip(s->x, 0, avctx->width - FONT_WIDTH);
s->y = av_clip(s->y, 0, avctx->height - s->font_height);
return 0;
}
@@ -419,7 +415,7 @@ static int decode_frame(AVCodecContext *avctx,
switch(buf[0]) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] < 6553)
if (s->nb_args < MAX_NB_ARGS)
s->args[s->nb_args] = FFMAX(s->args[s->nb_args], 0) * 10 + buf[0] - '0';
break;
case ';':
@@ -438,8 +434,8 @@ static int decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_WARNING, "args overflow (%i)\n", s->nb_args);
if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] >= 0)
s->nb_args++;
if ((ret = execute_code(avctx, buf[0])) < 0)
return ret;
if (execute_code(avctx, buf[0]) < 0)
return -1;
s->state = STATE_NORMAL;
}
break;

View File

@@ -129,6 +129,7 @@ typedef struct APEPredictor {
typedef struct APEContext {
AVClass *class; ///< class for AVOptions
AVCodecContext *avctx;
AVFrame frame;
DSPContext dsp;
int channels;
int samples; ///< samples left to decode in current frame
@@ -234,6 +235,9 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
ff_dsputil_init(&s->dsp, avctx);
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
avcodec_get_frame_defaults(&s->frame);
avctx->coded_frame = &s->frame;
return 0;
filter_alloc_fail:
ape_decode_close(avctx);
@@ -822,7 +826,6 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
static int ape_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
APEContext *s = avctx->priv_data;
uint8_t *sample8;
@@ -903,8 +906,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8);
/* get output buffer */
frame->nb_samples = blockstodecode;
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
s->frame.nb_samples = blockstodecode;
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@@ -926,21 +929,21 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
switch (s->bps) {
case 8:
for (ch = 0; ch < s->channels; ch++) {
sample8 = (uint8_t *)frame->data[ch];
sample8 = (uint8_t *)s->frame.data[ch];
for (i = 0; i < blockstodecode; i++)
*sample8++ = (s->decoded[ch][i] + 0x80) & 0xff;
}
break;
case 16:
for (ch = 0; ch < s->channels; ch++) {
sample16 = (int16_t *)frame->data[ch];
sample16 = (int16_t *)s->frame.data[ch];
for (i = 0; i < blockstodecode; i++)
*sample16++ = s->decoded[ch][i];
}
break;
case 24:
for (ch = 0; ch < s->channels; ch++) {
sample24 = (int32_t *)frame->data[ch];
sample24 = (int32_t *)s->frame.data[ch];
for (i = 0; i < blockstodecode; i++)
*sample24++ = s->decoded[ch][i] << 8;
}
@@ -949,7 +952,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
s->samples -= blockstodecode;
*got_frame_ptr = 1;
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
return !s->samples ? avpkt->size : 0;
}

View File

@@ -1,5 +1,3 @@
ARCH_HEADERS = mathops.h
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
arm/ac3dsp_arm.o
@@ -17,7 +15,6 @@ OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_init_arm.o
OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_init_arm.o
@@ -26,10 +23,8 @@ ARMV6-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8_armv6.o \
arm/vp8dsp_init_armv6.o \
arm/vp8dsp_armv6.o
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o
OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
@@ -60,6 +55,9 @@ ARMV6-OBJS += arm/dsputil_init_armv6.o \
VFP-OBJS-$(HAVE_ARMV6) += arm/fmtconvert_vfp.o
VFP-OBJS += arm/dsputil_vfp.o \
arm/dsputil_init_vfp.o \
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
arm/fft_fixed_neon.o \
@@ -68,14 +66,12 @@ NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o \
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
arm/h264idct_neon.o \
arm/h264cmc_neon.o \
NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o \
NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_neon.o \
@@ -88,8 +84,7 @@ NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
NEON-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_neon.o
NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_neon.o \
arm/rv40dsp_neon.o \
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
arm/h264cmc_neon.o \
NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o

View File

@@ -22,9 +22,8 @@
#define AVCODEC_ARM_DCA_H
#include <stdint.h>
#include "config.h"
#include "libavcodec/mathops.h"
#include "libavutil/intmath.h"
#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB
@@ -34,44 +33,46 @@ static inline int decode_blockcodes(int code1, int code2, int levels,
{
int v0, v1, v2, v3, v4, v5;
__asm__ ("smmul %0, %6, %10 \n"
"smmul %3, %7, %10 \n"
"smlabb %6, %0, %9, %6 \n"
"smlabb %7, %3, %9, %7 \n"
"smmul %1, %0, %10 \n"
"smmul %4, %3, %10 \n"
"sub %6, %6, %8, lsr #1 \n"
"sub %7, %7, %8, lsr #1 \n"
"smlabb %0, %1, %9, %0 \n"
"smlabb %3, %4, %9, %3 \n"
"smmul %2, %1, %10 \n"
"smmul %5, %4, %10 \n"
"str %6, [%11, #0] \n"
"str %7, [%11, #16] \n"
"sub %0, %0, %8, lsr #1 \n"
"sub %3, %3, %8, lsr #1 \n"
"smlabb %1, %2, %9, %1 \n"
"smlabb %4, %5, %9, %4 \n"
"smmul %6, %2, %10 \n"
"smmul %7, %5, %10 \n"
"str %0, [%11, #4] \n"
"str %3, [%11, #20] \n"
"sub %1, %1, %8, lsr #1 \n"
"sub %4, %4, %8, lsr #1 \n"
"smlabb %2, %6, %9, %2 \n"
"smlabb %5, %7, %9, %5 \n"
"str %1, [%11, #8] \n"
"str %4, [%11, #24] \n"
"sub %2, %2, %8, lsr #1 \n"
"sub %5, %5, %8, lsr #1 \n"
"str %2, [%11, #12] \n"
"str %5, [%11, #28] \n"
: "=&r"(v0), "=&r"(v1), "=&r"(v2),
__asm__ ("smmul %8, %14, %18 \n"
"smmul %11, %15, %18 \n"
"smlabb %14, %8, %17, %14 \n"
"smlabb %15, %11, %17, %15 \n"
"smmul %9, %8, %18 \n"
"smmul %12, %11, %18 \n"
"sub %14, %14, %16, lsr #1 \n"
"sub %15, %15, %16, lsr #1 \n"
"smlabb %8, %9, %17, %8 \n"
"smlabb %11, %12, %17, %11 \n"
"smmul %10, %9, %18 \n"
"smmul %13, %12, %18 \n"
"str %14, %0 \n"
"str %15, %4 \n"
"sub %8, %8, %16, lsr #1 \n"
"sub %11, %11, %16, lsr #1 \n"
"smlabb %9, %10, %17, %9 \n"
"smlabb %12, %13, %17, %12 \n"
"smmul %14, %10, %18 \n"
"smmul %15, %13, %18 \n"
"str %8, %1 \n"
"str %11, %5 \n"
"sub %9, %9, %16, lsr #1 \n"
"sub %12, %12, %16, lsr #1 \n"
"smlabb %10, %14, %17, %10 \n"
"smlabb %13, %15, %17, %13 \n"
"str %9, %2 \n"
"str %12, %6 \n"
"sub %10, %10, %16, lsr #1 \n"
"sub %13, %13, %16, lsr #1 \n"
"str %10, %3 \n"
"str %13, %7 \n"
: "=m"(values[0]), "=m"(values[1]),
"=m"(values[2]), "=m"(values[3]),
"=m"(values[4]), "=m"(values[5]),
"=m"(values[6]), "=m"(values[7]),
"=&r"(v0), "=&r"(v1), "=&r"(v2),
"=&r"(v3), "=&r"(v4), "=&r"(v5),
"+&r"(code1), "+&r"(code2)
: "r"(levels - 1), "r"(-levels),
"r"(ff_inverse[levels]), "r"(values)
: "memory");
: "r"(levels - 1), "r"(-levels), "r"(ff_inverse[levels]));
return code1 | code2;
}

View File

@@ -19,27 +19,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "libavutil/arm/cpu.h"
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_j_rev_dct_arm(int16_t *data);
void ff_simple_idct_arm(int16_t *data);
void ff_j_rev_dct_arm(DCTELEM *data);
void ff_simple_idct_arm(DCTELEM *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
@@ -48,33 +48,33 @@ CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_j_rev_dct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_j_rev_dct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_simple_idct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_simple_idct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);
}
av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
{
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
int cpu_flags = av_get_cpu_flags();
@@ -121,5 +121,6 @@ av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx);
if (have_vfp(cpu_flags)) ff_dsputil_init_vfp(c, avctx);
if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx);
}

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