platform/upstream/libav.git
12 years agoasplit: don't leak the input buffer.
Anton Khirnov [Tue, 3 Jul 2012 09:26:45 +0000 (11:26 +0200)]
asplit: don't leak the input buffer.

12 years agoaf_resample: fix request_frame() behavior.
Anton Khirnov [Wed, 4 Jul 2012 14:46:17 +0000 (16:46 +0200)]
af_resample: fix request_frame() behavior.

Make sure that an output frame has really been produced before returning
0.

12 years agoaf_asyncts: fix request_frame() behavior.
Anton Khirnov [Wed, 4 Jul 2012 14:46:17 +0000 (16:46 +0200)]
af_asyncts: fix request_frame() behavior.

Make sure that an output frame has really been produced before returning
0.

12 years agolibx264: support aspect ratio switching
JULIAN GARDNER [Sun, 8 Jul 2012 14:33:47 +0000 (17:33 +0300)]
libx264: support aspect ratio switching

Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years agomatroskadec: honor error_recognition when encountering unknown elements.
Anton Khirnov [Sat, 7 Jul 2012 15:15:27 +0000 (17:15 +0200)]
matroskadec: honor error_recognition when encountering unknown elements.

12 years agolavr: resampling: add support for s32p, fltp, and dblp internal sample formats
Justin Ruggles [Mon, 28 May 2012 01:44:55 +0000 (21:44 -0400)]
lavr: resampling: add support for s32p, fltp, and dblp internal sample formats

Based partially on implementation by Michael Niedermayer <michaelni@gmx.at> in
libswresample in FFmpeg. See commits:
7f1ae79d38c4edba9dbd31d7bf797e525298ac55
24ab1abfb6d55bf330022df4b10d7aec80b3f116

12 years agolavr: resampling: add filter type and Kaiser window beta to AVOptions
Justin Ruggles [Sat, 26 May 2012 18:50:02 +0000 (14:50 -0400)]
lavr: resampling: add filter type and Kaiser window beta to AVOptions

12 years agolavr: Use AV_SAMPLE_FMT_NONE to auto-select the internal sample format
Justin Ruggles [Fri, 1 Jun 2012 19:19:45 +0000 (15:19 -0400)]
lavr: Use AV_SAMPLE_FMT_NONE to auto-select the internal sample format

Also make this the default value.

12 years agolavr: mix: validate internal sample format in ff_audio_mix_init()
Justin Ruggles [Fri, 1 Jun 2012 19:12:03 +0000 (15:12 -0400)]
lavr: mix: validate internal sample format in ff_audio_mix_init()

12 years agocmutils: include shellapi.h on Win32 (for CommandLineToArgvW).
Ronald S. Bultje [Sat, 7 Jul 2012 20:46:26 +0000 (13:46 -0700)]
cmutils: include shellapi.h on Win32 (for CommandLineToArgvW).

This is required for CommandLineToArgvW. Normally, shellapi.h is included
implicitly by windows.h, but if we define WIN32_LEAN_AND_MEAN (or some of
the other earlier headers have included windows.h with that option),
windows.h doesn't include this one.

Thus explicitly include the headers we really need, for clarity and
compatibility.

12 years agox86/timer: implement an intrinsic-based version for rdtsc (AV_READ_TIME).
Ronald S. Bultje [Sat, 7 Jul 2012 20:30:11 +0000 (13:30 -0700)]
x86/timer: implement an intrinsic-based version for rdtsc (AV_READ_TIME).

12 years agoid3v2: add a mimetype for bmp pictures.
Anton Khirnov [Fri, 6 Jul 2012 20:35:10 +0000 (22:35 +0200)]
id3v2: add a mimetype for bmp pictures.

12 years agoflacdec: be less strict when parsing attached pictures.
Anton Khirnov [Fri, 6 Jul 2012 20:30:17 +0000 (22:30 +0200)]
flacdec: be less strict when parsing attached pictures.

Only return an error if memory allocation fails or error recognition is
set to explode. Otherwise just print an error message and continue
reading the file.

12 years agoflacdec: don't create an attached picture stream until we have all information.
Anton Khirnov [Fri, 6 Jul 2012 20:21:09 +0000 (22:21 +0200)]
flacdec: don't create an attached picture stream until we have all information.

This way we don't end with an invalid stream if parsing the picture
fails.

12 years agomxfdec: replace x>>av_log2(sizeof(..)) by x/sizeof(..).
Ronald S. Bultje [Wed, 4 Jul 2012 15:13:43 +0000 (08:13 -0700)]
mxfdec: replace x>>av_log2(sizeof(..)) by x/sizeof(..).

Also replace x>>av_log2(sizeof(..)) + 1 by x/sizeof(..). The +1 is
probably meant to emulate av_log2_ceil(sizeof(..)) in cases where ".."
is not a power of two.

12 years agox86: h264_intrapred: Don't add the 'd' suffix to the SPLATB_REG macro
Martin Storsjö [Fri, 6 Jul 2012 07:53:43 +0000 (10:53 +0300)]
x86: h264_intrapred: Don't add the 'd' suffix to the SPLATB_REG macro

The SPLATB_REG macro already adds the 'd' suffix internally.

This fixes building on Win64, which has been broken since 878e66902.

This worked for unix, where r2 happened to be rdx in this case, which
with the first suffix rdxd was mapped to eax, and eaxd is defined back
to eax. On win64 however, r2 happened to be R8 in this case, and
R8d mapps to R8D just fine, but there's no mapping for R8Dd to anything.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoconfigure: add functions for testing code fragments
Mans Rullgard [Wed, 4 Jul 2012 22:06:25 +0000 (23:06 +0100)]
configure: add functions for testing code fragments

This simplifies testing arbitrary code fragments within a function
body.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agoaf_amix: avoid spurious EAGAIN.
Anton Khirnov [Thu, 5 Jul 2012 19:51:44 +0000 (21:51 +0200)]
af_amix: avoid spurious EAGAIN.

Input on/off state can change in request_samples(), which can result in
a state where only the first input is active. get_available_samples()
will then return 0, and request_frame() will fail with EAGAIN even
though there is data on the single active input.

Take this into account and check the number of active inputs again after
calling request_samples().

12 years agoaf_amix: return AVERROR(EAGAIN) when request_frame didn't produce output.
Anton Khirnov [Thu, 5 Jul 2012 18:28:10 +0000 (20:28 +0200)]
af_amix: return AVERROR(EAGAIN) when request_frame didn't produce output.

0 should only be returned when there was at least one output frame.

12 years agoaf_amix: only consider negative return codes as errors.
Anton Khirnov [Wed, 4 Jul 2012 16:55:14 +0000 (18:55 +0200)]
af_amix: only consider negative return codes as errors.

12 years agoavconv: use only meaningful timestamps in start time check.
Anton Khirnov [Wed, 4 Jul 2012 00:56:38 +0000 (02:56 +0200)]
avconv: use only meaningful timestamps in start time check.

12 years agoavconv: fix the check for -ss as an output option.
Anton Khirnov [Wed, 4 Jul 2012 00:53:25 +0000 (02:53 +0200)]
avconv: fix the check for -ss as an output option.

start time is already substracted from the frame timestamp, so it needs
to be checked against 0, not start time.

12 years agomss3: add forgotten 'static' qualifier for private table
Kostya Shishkov [Fri, 6 Jul 2012 07:22:46 +0000 (09:22 +0200)]
mss3: add forgotten 'static' qualifier for private table

12 years agolavc: options: add planar names for request_sample_fmt
Mans Rullgard [Fri, 29 Jun 2012 14:23:03 +0000 (15:23 +0100)]
lavc: options: add planar names for request_sample_fmt

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflacdec: add planar output support
Mans Rullgard [Mon, 2 Jul 2012 23:29:30 +0000 (00:29 +0100)]
flacdec: add planar output support

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflvdec: Treat all nellymoser versions as the same codec
Martin Storsjö [Thu, 5 Jul 2012 06:47:29 +0000 (09:47 +0300)]
flvdec: Treat all nellymoser versions as the same codec

This avoids creating new AVStreams for them when switching between
different variants of them, since we can handle changes between
different sample rates of nellymoser within the same stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoqdm2: remove broken and disabled dump_context() debug function
Diego Biurrun [Thu, 5 Jul 2012 11:20:57 +0000 (13:20 +0200)]
qdm2: remove broken and disabled dump_context() debug function

12 years agox86: h264_intrapred: use newly introduced SPLAT* and PSHUFLW macros
Diego Biurrun [Wed, 4 Jul 2012 13:32:16 +0000 (15:32 +0200)]
x86: h264_intrapred: use newly introduced SPLAT* and PSHUFLW macros

12 years agox86inc: add SPLATB_LOAD, SPLATB_REG, PSHUFLW macros
Loren Merritt [Wed, 4 Jul 2012 11:07:49 +0000 (11:07 +0000)]
x86inc: add SPLATB_LOAD, SPLATB_REG, PSHUFLW macros

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agox86inc: modify ALIGN to not generate long nops on i586
Loren Merritt [Tue, 3 Jul 2012 17:51:43 +0000 (17:51 +0000)]
x86inc: modify ALIGN to not generate long nops on i586

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agox86: h264_intrapred: port to cpuflag macros
Diego Biurrun [Tue, 3 Jul 2012 23:07:42 +0000 (01:07 +0200)]
x86: h264_intrapred: port to cpuflag macros

12 years agoavplay: update input filter pointer when the filtergraph is reset.
Anton Khirnov [Wed, 4 Jul 2012 09:35:18 +0000 (11:35 +0200)]
avplay: update input filter pointer when the filtergraph is reset.

Fixes an invalid read on size change.

12 years agoavconv: fix parsing of -force_key_frames option.
Reimar Döffinger [Mon, 30 Apr 2012 20:48:42 +0000 (22:48 +0200)]
avconv: fix parsing of -force_key_frames option.

Currently it always exits with an error when more than
one position is specified.

CC: libav-stable@libav.org
12 years agoh264: use templates to avoid excessive inlining
Mans Rullgard [Tue, 3 Jul 2012 22:16:11 +0000 (23:16 +0100)]
h264: use templates to avoid excessive inlining

Instead of inlining everything into ff_h264_hl_decode_mb(), use
explicit templating to create versions of the called functions
with constant parameters filled in.  This greatly speeds up
compilation of h264.c and reduces the code size without any
measurable impact on performance.

Compilation time for h264.c on an i7 goes from 30s to 5.5s.
Code size is reduced by 430kB.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoxtea: Make the count parameter match the documentation
Samuel Pitoiset [Thu, 5 Jul 2012 09:19:13 +0000 (11:19 +0200)]
xtea: Make the count parameter match the documentation

Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoblowfish: Make the count parameter match the documentation
Samuel Pitoiset [Thu, 5 Jul 2012 09:33:54 +0000 (11:33 +0200)]
blowfish: Make the count parameter match the documentation

Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agompegvideo: Don't use ff_mspel_motion() for vc1
Michael Niedermayer [Sun, 20 Nov 2011 16:19:25 +0000 (17:19 +0100)]
mpegvideo: Don't use ff_mspel_motion() for vc1

Using ff_mspel_motion assumes that s (a MpegEncContext
poiinter) really is a Wmv2Context.

This fixes crashes in error resilience on vc1/wmv3 videos.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoxtea: invert branch and loop precedence
Luca Barbato [Thu, 5 Jul 2012 07:52:04 +0000 (09:52 +0200)]
xtea: invert branch and loop precedence

Should slightly improve performance depending on the compiler used.

12 years agoblowfish: invert branch and loop precedence
Luca Barbato [Thu, 5 Jul 2012 07:50:59 +0000 (09:50 +0200)]
blowfish: invert branch and loop precedence

Should slightly improve performance depending on the compiler used.

12 years agoflvdec: optionally trust the metadata
Luca Barbato [Wed, 4 Jul 2012 11:33:41 +0000 (13:33 +0200)]
flvdec: optionally trust the metadata

In certain conditions video or audio frames might appear way later in the
stream.

12 years agoavconv: Set audio filter time base to the sample rate
Martin Storsjö [Sat, 30 Jun 2012 08:26:11 +0000 (11:26 +0300)]
avconv: Set audio filter time base to the sample rate

If the output frame size is smaller than the input sample rate,
and the input stream time base corresponds exactly to the input
frame size (getting input packet timestamps like 0, 1, 2, 3, 4 etc),
the output timestamps from the filter will be like
0, 1, 2, 3, 4, 4, 5 ..., leadning to non-monotone timestamps later.

A concrete example is input mp3 data having frame sizes of 1152
samples, transcoded to aac with 1024 sample frames.

By setting the audio filter time base to the sample rate, we will
get sensible timestamps for all output packets, regardless of
the ratio between the input and output frame sizes.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agovp8: Add ifdef guards around the sse2 loopfilter in the sse2slow branch too
Martin Storsjö [Wed, 4 Jul 2012 19:25:53 +0000 (22:25 +0300)]
vp8: Add ifdef guards around the sse2 loopfilter in the sse2slow branch too

This was missed in the the previous commit in 70a1c800.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agolavfi: reclassify showfiltfmts as a TESTPROG
Mans Rullgard [Wed, 4 Jul 2012 15:51:10 +0000 (16:51 +0100)]
lavfi: reclassify showfiltfmts as a TESTPROG

This tool uses lavfi internal symbols not accessible in shared
libraries.  TESTPROGS are linked statically to allow them use of
library internals not normally exported.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agograph2dot: fix printf format specifier
Diego Biurrun [Wed, 4 Jul 2012 14:55:13 +0000 (16:55 +0200)]
graph2dot: fix printf format specifier

tools/graph2dot.c:85: warning: format ‘%lld’ expects type ‘long long int’, but argument 4 has type ‘int’

12 years agoswscale: yuv2planeX 8bit >=sse2 functions need aligned stack on x86-32.
Martin Storsjö [Wed, 4 Jul 2012 04:11:23 +0000 (21:11 -0700)]
swscale: yuv2planeX 8bit >=sse2 functions need aligned stack on x86-32.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years agovp8: loopfilter >=sse2 functions need aligned stack on x86-32.
Martin Storsjö [Wed, 4 Jul 2012 04:11:36 +0000 (21:11 -0700)]
vp8: loopfilter >=sse2 functions need aligned stack on x86-32.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years agoamr: remove shift out of the AMR_BIT() macro.
Ronald S. Bultje [Wed, 4 Jul 2012 03:36:44 +0000 (20:36 -0700)]
amr: remove shift out of the AMR_BIT() macro.

MSVC doesn't like the offsetof(..) >> 1 construct, it interprets it as
a non-literal, thus causing use of this in static tables to fail
compilation.

12 years agodsputilenc: group yasm and inline asm function pointer assignment.
Ronald S. Bultje [Wed, 4 Jul 2012 04:00:05 +0000 (21:00 -0700)]
dsputilenc: group yasm and inline asm function pointer assignment.

12 years agomov: use forward declaration of a function instead of a table.
Ronald S. Bultje [Wed, 4 Jul 2012 03:49:49 +0000 (20:49 -0700)]
mov: use forward declaration of a function instead of a table.

MSVC gives a compile error on the tentative definition of
mov_default_parse_table[].

12 years agoClarify Doxygen comment for FF_API_* #defines.
Diego Biurrun [Tue, 3 Jul 2012 20:42:42 +0000 (22:42 +0200)]
Clarify Doxygen comment for FF_API_* #defines.

12 years agoconfigure: simplify get_version()
Diego Biurrun [Mon, 2 Jul 2012 21:04:09 +0000 (23:04 +0200)]
configure: simplify get_version()

All libs have version headers now, which allows hardcoding the path.

12 years agoCreate version.h headers for libraries that lack them
Diego Biurrun [Sun, 1 Jul 2012 09:51:30 +0000 (11:51 +0200)]
Create version.h headers for libraries that lack them

12 years agogitignore: Use full path instead of relative path to specify patterns
Diego Biurrun [Mon, 2 Jul 2012 20:49:42 +0000 (22:49 +0200)]
gitignore: Use full path instead of relative path to specify patterns

This avoids confusion from patterns meant to only match at the top
level matching files in subdirectories.

12 years agompegvideo: remove VLAs
Ronald S. Bultje [Sun, 24 Jun 2012 18:19:24 +0000 (21:19 +0300)]
mpegvideo: remove VLAs

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoAdd XTEA encryption support in libavutil
Samuel Pitoiset [Tue, 3 Jul 2012 13:53:16 +0000 (15:53 +0200)]
Add XTEA encryption support in libavutil

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoAdd Blowfish encryption support in libavutil
Samuel Pitoiset [Tue, 3 Jul 2012 13:45:27 +0000 (15:45 +0200)]
Add Blowfish encryption support in libavutil

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoeval: Add the isinf() function and tests for it
Martin Storsjö [Sun, 1 Jul 2012 13:11:23 +0000 (16:11 +0300)]
eval: Add the isinf() function and tests for it

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoflacdec: move lpc filter to flacdsp
Mans Rullgard [Mon, 2 Jul 2012 12:51:04 +0000 (13:51 +0100)]
flacdec: move lpc filter to flacdsp

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflacdec: split off channel decorrelation as flacdsp
Mans Rullgard [Sun, 17 Jun 2012 14:10:40 +0000 (15:10 +0100)]
flacdec: split off channel decorrelation as flacdsp

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoavplay: Add an option for not limiting the input buffer size
Martin Storsjö [Tue, 3 Jul 2012 19:57:19 +0000 (22:57 +0300)]
avplay: Add an option for not limiting the input buffer size

For reading from normal files on disk, the queue limits for
demuxed data work fine, but for reading data from realtime
streams, they mean we're not reading from the input stream
at all once the queue limit has been reached. For TCP streams,
this means that writing to the socket from the peer side blocks
(potentially leading to the peer dropping data), and for UDP
streams it means that our kernel might drop data.

For some protocols/servers, the server initially sends a
large burst with data to fill client side buffers, but once
filled, we should keep reading to avoid dropping data.

For all realtime streams, it IMO makes sense to just buffer
as much as we get (rather in buffers in avplay.c than in
OS level buffers). With this option set, the input thread
should always be blocking waiting for more input data,
never sleeping waiting for the decoder to consume data.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoFATE: add a test for WMA cover art.
Anton Khirnov [Fri, 22 Jun 2012 17:02:06 +0000 (19:02 +0200)]
FATE: add a test for WMA cover art.

12 years agoFATE: add a test for apetag cover art
Anton Khirnov [Fri, 22 Jun 2012 11:16:18 +0000 (13:16 +0200)]
FATE: add a test for apetag cover art

12 years agoFATE: add a test for itunes cover art.
Anton Khirnov [Fri, 22 Jun 2012 05:24:45 +0000 (07:24 +0200)]
FATE: add a test for itunes cover art.

12 years agoflacdec: factor out code setting avctx->sample_fmt
Mans Rullgard [Mon, 2 Jul 2012 23:28:32 +0000 (00:28 +0100)]
flacdec: factor out code setting avctx->sample_fmt

12 years agoflac: make FLAC_CHMODE_* constants consecutive
Mans Rullgard [Sun, 17 Jun 2012 10:45:10 +0000 (11:45 +0100)]
flac: make FLAC_CHMODE_* constants consecutive

12 years agoflacdec: allocate sample buffers with av_malloc
Mans Rullgard [Mon, 2 Jul 2012 22:16:30 +0000 (23:16 +0100)]
flacdec: allocate sample buffers with av_malloc

The buffers are only allocated once, although it can happen from
any of a few different places, so there is no need to use realloc.
Using av_malloc() ensures they are aligned suitably for SIMD
optimisations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflacdec: remove curr_bps from FLACContext
Mans Rullgard [Mon, 2 Jul 2012 00:43:12 +0000 (01:43 +0100)]
flacdec: remove curr_bps from FLACContext

This value does not need to be persistent across calls.

12 years agofate: add flac encode/decode tests with various options
Mans Rullgard [Mon, 2 Jul 2012 15:07:42 +0000 (16:07 +0100)]
fate: add flac encode/decode tests with various options

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflacenc: add option for forcing stereo decorrelation mode
Mans Rullgard [Mon, 2 Jul 2012 13:52:05 +0000 (14:52 +0100)]
flacenc: add option for forcing stereo decorrelation mode

This is mainly useful for testing.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoismindex: Verify that all bitrate variants match
Martin Storsjö [Tue, 3 Jul 2012 11:58:52 +0000 (14:58 +0300)]
ismindex: Verify that all bitrate variants match

In Smooth Streaming, the fragments are addressed by time, and
the manifest only stores one list of time offests for all streams,
so all streams need to have identical fragment offsets. Warn if
this isn't the case, so that the user can fix the files instead of
getting failures at runtime when the fragments can't be found.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoismindex: Properly report errors reading the MFRA atom
Martin Storsjö [Tue, 3 Jul 2012 11:18:58 +0000 (14:18 +0300)]
ismindex: Properly report errors reading the MFRA atom

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agocosmetics: Consistently use C-style comments with multiple inclusion guards
Diego Biurrun [Mon, 2 Jul 2012 08:17:07 +0000 (10:17 +0200)]
cosmetics: Consistently use C-style comments with multiple inclusion guards

12 years agoanm: fix a few Doxygen comments
Diego Biurrun [Mon, 2 Jul 2012 18:40:26 +0000 (20:40 +0200)]
anm: fix a few Doxygen comments

12 years agomisc typo and wording fixes
Diego Biurrun [Wed, 13 Jun 2012 09:41:12 +0000 (11:41 +0200)]
misc typo and wording fixes

12 years agoattributes: add av_noreturn
Reinhard Tartler [Sun, 1 Jul 2012 17:38:40 +0000 (19:38 +0200)]
attributes: add av_noreturn

Also use it in the declaration of the various exit_program
implementations in avtools.

inspired by a clang-scan report.

12 years agoattributes: drop pointless define guards
Reinhard Tartler [Sun, 1 Jul 2012 18:36:03 +0000 (20:36 +0200)]
attributes: drop pointless define guards

the av_-prefixed attributes must not be defined outside of this file

12 years agoconfigure: do not disable av_always_inline with --enable-small
Mans Rullgard [Sun, 1 Jul 2012 19:21:10 +0000 (20:21 +0100)]
configure: do not disable av_always_inline with --enable-small

Currently, --enable-small turns av_always_inline into plain inline,
which is more or less ignored by the compiler.  While the intent of
this is probably to reduce code size by avoiding some inlining, it
has more far-reaching effects.

We use av_always_inline in two situations:

1. The body of a function is smaller than the call overhead.
   Instances of these are abundant in libavutil, the bswap.h
   functions being good examples.

2. The function is a template relying on constant propagation
   through inlined calls for sane code generation.  These are
   often found in motion compensation code.

Both of these types of functions should be inlined even if targeting
small code size.

Although GCC has heuristics for detecting the first of these types,
it is not always reliable, especially when the function uses inline
assembler, which is often the reason for having those functions in
the first place, so making it explicit is generally a good idea.

The size increase from inlining template-type functions is usually
much smaller than it seems due to different branches being mutually
exclusive between the different invocations.  The dead branches can,
however, only be removed after inlining and constant propagation have
been performed, which means the initial cost estimate for inlining
these is much higher than is actually the case, resulting in GCC
often making bad choices if left to its own devices.

Furthermore, the GCC inliner limits how much it allows a function to
grow due to automatic inlining of calls, and this appears to not take
call overhead into account.  When nested inlining is used, the limit
may be hit before the innermost level is reached.  In some cases, this
has prevented inlining of type 1 functions as defined above, resulting
in significant performance loss.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoflvdec: initial stream switch support
Luca Barbato [Sun, 1 Jul 2012 21:01:00 +0000 (23:01 +0200)]
flvdec: initial stream switch support

Codec change midstream gets mapped to a separate stream.

12 years agoavplay: fix write on freed memory for rawvideo
Luca Barbato [Thu, 28 Jun 2012 18:55:04 +0000 (20:55 +0200)]
avplay: fix write on freed memory for rawvideo

Do not assume avpacket and the decoded frames are independent.

To be absolutely sure and not sprinkle av_free_packet around the code
the call had been placed before getting the frame and on the error path.

12 years agosnow: remove a VLA used for edge emulation
Ronald S. Bultje [Mon, 2 Jul 2012 07:39:54 +0000 (10:39 +0300)]
snow: remove a VLA used for edge emulation

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agox86: lavfi: fix gradfun/yadif build with mmx/sse disabled
Mans Rullgard [Mon, 2 Jul 2012 22:04:04 +0000 (23:04 +0100)]
x86: lavfi: fix gradfun/yadif build with mmx/sse disabled

These functions are defined conditionally so any uses need to have
preprocessor guards.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agosnow: remove the runs[] VLA.
Ronald S. Bultje [Sat, 30 Jun 2012 17:34:39 +0000 (10:34 -0700)]
snow: remove the runs[] VLA.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agosnow: Check mallocs at init
Martin Storsjö [Mon, 2 Jul 2012 07:39:25 +0000 (10:39 +0300)]
snow: Check mallocs at init

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoflacdec: remove redundant setting of avctx->sample_fmt
Mans Rullgard [Mon, 2 Jul 2012 12:49:13 +0000 (13:49 +0100)]
flacdec: remove redundant setting of avctx->sample_fmt

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoasfdec: read attached pictures.
Anton Khirnov [Thu, 21 Jun 2012 20:17:43 +0000 (22:17 +0200)]
asfdec: read attached pictures.

12 years agoapetag: reindent
Anton Khirnov [Thu, 21 Jun 2012 17:02:40 +0000 (19:02 +0200)]
apetag: reindent

12 years agoapetag: export attached covers as video streams.
Anton Khirnov [Tue, 26 Jun 2012 16:58:39 +0000 (18:58 +0200)]
apetag: export attached covers as video streams.

12 years agoapetag: fix the amount of data read from binary tags.
Anton Khirnov [Tue, 26 Jun 2012 16:54:00 +0000 (18:54 +0200)]
apetag: fix the amount of data read from binary tags.

Substract the filename size from the data size.

12 years agoapetag: make sure avio_get_str() doesn't read more than it should.
Anton Khirnov [Tue, 26 Jun 2012 16:49:04 +0000 (18:49 +0200)]
apetag: make sure avio_get_str() doesn't read more than it should.

12 years agomov: read itunes cover art.
Anton Khirnov [Thu, 21 Jun 2012 16:24:27 +0000 (18:24 +0200)]
mov: read itunes cover art.

12 years agosnow: remove VLA in mc_block()
Mans Rullgard [Sun, 1 Jul 2012 14:39:22 +0000 (15:39 +0100)]
snow: remove VLA in mc_block()

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agointfloat: Don't use designated initializers in the public headers
Ronald S. Bultje [Mon, 2 Jul 2012 07:22:30 +0000 (10:22 +0300)]
intfloat: Don't use designated initializers in the public headers

intfloat.h is a public header, and is now (since a1245d5ca) included
by mathematics.h, which many external callers include.

This fixes building third party applications that include
mathematics.h in a language that doesn't support designated
initalizers.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agosnow: remove a VLA.
Ronald S. Bultje [Fri, 15 Jun 2012 16:59:57 +0000 (09:59 -0700)]
snow: remove a VLA.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agodoc: Remind devs to check return values, especially for malloc() et al
Diego Biurrun [Sat, 30 Jun 2012 13:35:57 +0000 (15:35 +0200)]
doc: Remind devs to check return values, especially for malloc() et al

12 years agoMS ATC Screen (aka MSS3) decoder
Kostya Shishkov [Thu, 28 Jun 2012 19:18:23 +0000 (21:18 +0200)]
MS ATC Screen (aka MSS3) decoder

12 years agovf_yadif: move x86 init code to x86/yadif.c
Mans Rullgard [Sun, 1 Jul 2012 12:08:17 +0000 (13:08 +0100)]
vf_yadif: move x86 init code to x86/yadif.c

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agovf_gradfun: move x86 init code to x86/gradfun.c
Mans Rullgard [Sun, 1 Jul 2012 11:51:30 +0000 (12:51 +0100)]
vf_gradfun: move x86 init code to x86/gradfun.c

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoroqvideo: Remove a totally unused dspcontext
Martin Storsjö [Sun, 1 Jul 2012 20:46:28 +0000 (23:46 +0300)]
roqvideo: Remove a totally unused dspcontext

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agosmacker: remove some unused code
Mans Rullgard [Sun, 1 Jul 2012 13:56:16 +0000 (14:56 +0100)]
smacker: remove some unused code

This removes some code apparently left over from vlc reader
debugging.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agodsicin: remove dead assignment
Mans Rullgard [Sun, 1 Jul 2012 13:28:50 +0000 (14:28 +0100)]
dsicin: remove dead assignment

Signed-off-by: Mans Rullgard <mans@mansr.com>