dsputil: make add_hfyu_left_prediction_sse4() support unaligned src.

This makes add_hfyu_left_prediction_sse4() handle sources that are not
16-byte aligned in its own function rather than by proxying the call to
add_hfyu_left_prediction_ssse3(). This fixes a crash on Win64, since the
sse4 version clobberes xmm6, but the ssse3 version (which uses MMX regs)
does not restore it, thus leading to XMM clobbering and RSP being off.

Fixes bug 342.
lagarith: pad RGB buffer by 1 byte.

For left HFYU prediction, we predict from the buffer buf+1 using 8- or
16-byte reads. This means that aligning the buffer by 16 bytes is in
itself not sufficient, because if the width itself is 16- or 8-byte
aligned, the buffer will not be padded, and thus a read of size 16 at
buf+1 will overflow boundaries at the right edge. Padding the buffer by
1 byte is sufficient to not overflow its boundaries.

Fixes bug 342.
lagarith: fix color plane inversion for YUY2 output.
wmapro: prevent division by zero when sample rate is unspecified

This fixes Bugzilla #327:

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Revert "wmapro: prevent division by zero when sample rate is unspecified"

This reverts commit 36936080239ba9e162f9f5d0f722ce579cb606cf. It was
already applied; no idea why it didn't error out while re-applying it.
x86: build: replace mmx2 by mmxext

Refactoring mmx2/mmxext YASM code with cpuflags will force renames.
So switching to a consistent naming scheme beforehand is sensible.
The name "mmxext" is more official and widespread and also the name
of the CPU flag, as reported e.g. by the Linux kernel.
x86: dct32: port to cpuflags
fft: 3dnow: fix register name typo in DECL_IMDCT macro

Signed-off-by: Diego Biurrun <diego@biurrun.de>
ARM: vp56: allow inline asm to build with clang

The clang integrated assembler does not support pre-UAL syntax,
while gcc requires pre-UAL syntax for ARM code.  A patch[1] for
clang to support the old syntax as well has been ignored since
January.

This patch chooses the syntax appropriate for each compiler,
allowing both to build the code.  Notably, this change allows
building for iphone with the latest Apple Xcode update.

[1] http://llvm.org/bugs/show_bug.cgi?id=11855

Signed-off-by: Mans Rullgard <mans@mansr.com>
ARMv6: vp8: fix stack allocation with Apple's assembler

In the GNU assembler, a relational expression, bizarrely, has the
value -1 if true, whereas in Apple's it is +1.  This patch makes
sure the correct expression is used in both cases.

Signed-off-by: Mans Rullgard <mans@mansr.com>
fate: add tests for lagarith lossless video codec.

Based on patch by Oana Stratulat <oanaandreeastratulat@gmail.com>.
fate: force pix_fmt in lagarith-rgb32 test

This makes big and little endian systems use the same output
format.

Signed-off-by: Mans Rullgard <mans@mansr.com>
lavr: fix handling of custom mix matrices

Adds some validation for changing parameters after setting the matrix and
fixes a bug in the conversion path setup.
movtextenc: 3GPP TS 26.245 Timed Text Encoder.

This change introduces a basic encoder for 3GPP Timed Text subtitles,
also known as TX3G, Quicktime subtitles, or "movtext" in the existing
code.

This initial change doesn't attempt to write styling information,
and just writes the plain text of the subtitles. I intend to add
support for styles eventually, but it's challenging due to a lack
of existing players that support them.

Note that an additional change is required to the mov/mp4 muxer to
write empty subtitle packets to indicate subtitle duration.

Signed-off-by: Philip Langdale <philipl@overt.org>
movenc: Handle need for extra packets to express subtitle duration.

As packet duration is not stored inherently in MPEG4 containers,
subtitles have their duration expressed by storing an additional
empty packet with a pts matching the desired end time of the real
subtitle. Additionally, it is generally expected that all streams
start at time = 0, so an empty packet needs to be inserted at the
beginning of the stream, before the first real subtitle.

Unfortunately, ffmpeg lacks a proper way to express that a subtitle
might map to multiple packets, so the muxer is the only place we
can handle this.

Signed-off-by: Philip Langdale <philipl@overt.org>
avformat/srtdec: Write duration into packet from srt demuxer.

The current demuxer does not bother to write packet durations,
which makes it impossible to remux into a new format.

Signed-off-by: Philip Langdale <philipl@overt.org>
zerocodec: Cosmetics

Be consistent with error messages and code formatting.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
zerocodec: Fix memleak in decode_frame

If there was a failure inflating, or reinitializing
the zstream, the current frame's buffer would be lost.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
movtextenc: Remove dangling reference to movtext.h

This is a reference that leaked in from my future work to
support styling.

Signed-off-by: Philip Langdale <philipl@overt.org>
Merge remote-tracking branch 'dwbuiten/master'

* dwbuiten/master:
  zerocodec: Fix memleak in decode_frame
  zerocodec: Cosmetics

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