aarch64: assembler in clang-3.4 ignores the division by two

Values are positive powers of two, so just replace it with right shift.
build: handle library dependencies in configure

Instead of setting FFLIBS in each library Makefile configure
exports FFLIBS-$library in config.mak.
lavf: properly document the distinction between flags and ctx_flags
build: do not append $(FFLIBS-) to $(FFLIBS) if $(NAME) is not defined

Avoids including disabled library Makefiles.
lavc: add a native Opus decoder.

Initial implementation by Andrew D'Addesio <modchipv12@gmail.com> during
GSoC 2012.

Completion by Anton Khirnov <anton@khirnov.net>, sponsored by the
Mozilla Corporation.

Further contributions by:
Christophe Gisquet <christophe.gisquet@gmail.com>
Janne Grunau <janne-libav@jannau.net>
Luca Barbato <lu_zero@gentoo.org>
lavf: add AVFMT_FLAG_BITEXACT.

Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's
codec context.

Using codec options inside lavf is fragile and can easily break when the
muxing codec context is not the encoding context.
lavf: drop the zero-sized packets hack

There should not be any valid reason anymore for passing completely
empty packets to lavf.
OTOH side data-only packets can be useful.
lavc: preserve the original private data in avcodec_copy_context()

If a non-NULL codec was passed to avcodec_alloc_context3(), private data
will be already allocated in dest.
lavc: properly handle subtitle_header in avcodec_copy_context()
build: add avresample after avcodec to FFLIBS

avcodec might depend on avresample and with --as-needed required symbols
might be get removed if avresample is linked before avcodec.
Fixes link failures of avprobe and avplay on aarch64 with
--enable-neon-clobber-test.
configure: fix enable-libopus help string
aarch64: opus NEON iMDCT and FFT

Opus celt decoding 11% faster and the iMDCT over 2.5 times faster on
Apple's A7.
FATE/opus: increase fuzz for the celt tests

This seems to be needed on some 32bit arches.
avisynth: set duration of audio streams

Signed-off-by: Anton Khirnov <anton@khirnov.net>
build: Support building using clang-usan and disable-optimization

Clang Undefined Behaviour Sanitizer seems to make non-constant constant
expressions, making the compilation fail when they are used within
inline assembly if no optimization is requested.

Add -O1 to the cflags to hide the misbehaviour.

Bug-Id: 683
hlsenc: Set the default codecs to AAC and H264

Most HLS implementation only support these codecs.

Signed-off-by: Martin Storsjö <martin@martin.st>
riff: Pass block_align to estimate frame duration

Fix incorrect wSamplesPerBlock(=0) written for ADPCM_IMA_WAV

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
lavc: remove the locking code in avcodec_close()

This function should not modify any global state, so there should be no
reason for any locking.
lavc: add avcodec_free_context().

Right now, the caller has to manually manage some allocated
AVCodecContext fields, like extradata or subtitle_header. This is
fragile and prone to leaks, especially if we want to add more such
fields in the future.

The only reason for this behaviour is so that the AVStream codec context
can be reused for decoding. Such reuse is discouraged anyway, so this
commit is the first step to deprecating it.
4xm: allocate extradata properly.

Pad it with the required amount of zeros, check for malloc failure.