mov: Parse EC3SpecificBox (dec3 atom).

Skip to parse fields for additional independent substreams and its
associated dependent substreams since libavcodec's E-AC-3 decoder does not
support them yet.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
avio: make avio_close(NULL) a no-op

Its behaviour in line with ffurl_close(NULL).
segment: reorder seg_write_header allocation

As pointed by Paul B Mahol <onemda@gmail.com> the previous code could
lead to null pointer dereference.
libschroedingerdec: check malloc

Signed-off-by: Diego Biurrun <diego@biurrun.de>
h264: (trivial) remove unneeded macro argument in x86/cabac.h

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
h264: use one table instead of several for cabac functions

The reason is this is easier for PIC code (in particular on darwin...).
Keep the old names as pointers (static in cabac_functions.h so gcc
knows these are just immediate offsets) so the c code can nicely stay the same
(alternatively could use offsets directly in the functions needing the
tables). This should produce the same code as before with non-pic and better
code (confirmed) with pic.

The assembly uses the new table but still won't work for PIC case.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
h264: new assembly version of get_cabac for x86_64 with PIC

This adds a hand-optimized assembly version for get_cabac much like the
existing one, but it works if the table offsets are RIP-relative.
Compared to the non-RIP-relative version this adds 2 lea instructions
and it needs one extra register. get_cabac() gets about 40% faster, for
an overall speedup of about 5%.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
lavc: add a channel_layout field to AVFrame.

The field is filled with the codec context information.

FIXME need a minor version bump.
lavc: add a sample_rate field to AVFrame.

The field is filled with the codec context information.
lavc: minor bump for the new fields in AVFrame.
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  h264: new assembly version of get_cabac for x86_64 with PIC
  h264: use one table instead of several for cabac functions
  h264: (trivial) remove unneeded macro argument in x86/cabac.h
  libschroedingerdec: check malloc
  segment: reorder seg_write_header allocation
  avio: make avio_close(NULL) a no-op
  mov: Parse EC3SpecificBox (dec3 atom).

Conflicts:
	libavcodec/cabac.c
	libavcodec/x86/cabac.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
swr: float_to_int32_sse2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: float_to_int16_sse2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
nutdec: replace assert with av_assert0.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
nutdec: minor simplification.

Also fixes an (incorrect) "control reaches end of non-void function"
warning with some compilers.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
rmenc: more than 2 streams are not currently possible.

It is possible that just extending the RMMuxContext.streams
array would avoid it.
It is also possible that two audio streams will fail to mux
correctly as well, though at least it should not crash for
this reason.
I do not feel like checking either of these.
This patch fixes trac issue #1022 (at least it makes it
exit with a proper error message instead of crashing).

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
swr: int32_to_int16_mmx/sse

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: add set_audiodata_fmt() and use it to simplify code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: add sample format to AudioData

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: use memcpy when input and output match

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>