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>
snow: remove a VLA used for edge emulation

Signed-off-by: Martin Storsjö <martin@martin.st>
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.
flvdec: initial stream switch support

Codec change midstream gets mapped to a separate stream.
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>
attributes: drop pointless define guards

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

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

inspired by a clang-scan report.
misc typo and wording fixes
anm: fix a few Doxygen comments
cosmetics: Consistently use C-style comments with multiple inclusion guards
ismindex: Properly report errors reading the MFRA atom

Signed-off-by: Martin Storsjö <martin@martin.st>
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>
flacenc: add option for forcing stereo decorrelation mode

This is mainly useful for testing.

Signed-off-by: Mans Rullgard <mans@mansr.com>
fate: add flac encode/decode tests with various options

Signed-off-by: Mans Rullgard <mans@mansr.com>
flacdec: remove curr_bps from FLACContext

This value does not need to be persistent across calls.
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>
flac: make FLAC_CHMODE_* constants consecutive
flacdec: factor out code setting avctx->sample_fmt
FATE: add a test for itunes cover art.
FATE: add a test for apetag cover art