wma lossless: reuse scalarproduct_and_madd_int16

This is done by padding the coefficient buffer with 0s, because the order
may be only a multiple of 4, and the DSP function requires batches of 8.

However, no sample with such a case was found, so request one if it uses
that kind of order.

Approximate relative speedup depending on instruction set:
plain C: -6%
mmxext:  51%
sse2:    54%

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Allow >2G for skip_initial_bytes.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
build: add fminf() emulation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avutil/libm: fix fminf typo

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mov: fix "warning: variable altitude set but not used" warning

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avutil/libm: use FFMIN instead of fmin()

MSVC apparently doesnt support fmin() either

Suggested/Found-by: ubitux, Daemon404, nevcairiel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpeg2: add sequence display extension information

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
avcodec options: add enum option for color_primaries

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
avcodec options: add enum option for color_trc

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
avcodec options: add enum option for colorspace

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
avcodec options: add enum option for color_range

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
adpcm: Fix trellis encoding of IMA QT

This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
fate: enable adpcm-ima_qt-trellis

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
adpcm: Write the proper predictor in trellis mode in IMA QT

The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avutil/libm: Replace macro based fminf() by function

This avoids issues when the FFMIN parameter evaluation has side effects

Reviewed-by: Clément Bœsch <u@pkh.me>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avfilter/avf_showcqt: avoid using fminf()

The loop with fminf() changes from 18093856 to 17403218 dezicycles (gcc 4.6.3, sandybridge i7)

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
fate: enable fate-seek-acodec-adpcm-ima_qt-trellis

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/adpcmenc: fix integer overflow / undefined behavior in STORE_NODE()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
oggenc: Set the right AVOption size for the pref_duration option

On big endian machines, the default value set via the faulty
AVOption ended up as 2^32 times too big.

This fixes the fate-lavf-ogg test which currently is broken on
big endian machines, broken since 3831362. Since that commit,
a final zero-sized packet is written to the ogg muxer in that test,
which caused different flushing behaviour on little and big endian
depending on whether the pref_duration option was handled as it
should or not.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
adpcm: Avoid reading out of bounds in the IMA QT trellis encoder

This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>