Merge remote-tracking branch 'qatar/master'

* qatar/master:
  h264: K&R formatting cosmetics
  s3tc.h: Add missing #include to fix standalone header compilation.
  FATE: add capability for audio encode/decode tests with fuzzy psnr comparison
  FATE: allow a tolerance in the size comparison in do_tiny_psnr()
  FATE: use absolute difference from a target value in do_tiny_psnr()
  FATE: allow tests to set CMP_SHIFT to pass to tiny_psnr
  FATE: use $fuzz directly in do_tiny_psnr() instead of passing it around

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pcm: leave sample format conversion to libswresample

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavfi: add bbox filter

Also add bbox.h and bbox.c files, based on the remove-logo filter by
Robert Edele. These files are useful for sharing code with the pending
removelogo port.
lavfi/allfilters: fix weird vertical align
url: document url_read exact behaviour.
lavfi/crop: show input and output sample aspect ratio in the log
udp: fix non-blocking and interrupt handling.

In non-blocking mode, lowest-level read protocols are
supposed block only for a short amount of time to let
retry_transfer_wrapper() check for interrupts.

Also, checking the interrupt_callback in the receiving thread is
wrong, as interrupt_callback is not guaranteed to be thread-safe
and the job is already done by retry_transfer_wrapper(). The error
code was also incorrect.

Bug reported by Andrey Utkin.
FATE: add AC-3 and E-AC-3 encode/decode tests with fuzzy comparison
FATE: add WMAv1 and WMAv2 encode/decode tests with fuzzy comparison
FATE: remove WMA acodec tests
wmaenc: remove bit-exact hack

It may have improved cross-platform stability, but wasn't the only place in
the encoder with bitexact issues. It is no longer needed because we have FATE
tests for float encoders using fuzzy comparison.
vf_thumbnail: forward request_frame at least once.

The current version relied on poll_frame to request
the very first frame, that would not work if the
surrounding code does not call poll_frame.
fate: fix enc_dec_pcm tests with remote target

Signed-off-by: Mans Rullgard <mans@mansr.com>
resample: allocate a large enough output buffer

Fixes invalid writes and crashes when doing conversions such as stereo to 5.1
channels or sample rate conversion on 5.1 channels.
dsp: fix diff_bytes_mmx() with small width

Fixes Ticket1068

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

* qatar/master:
  resample: allocate a large enough output buffer
  fate: fix enc_dec_pcm tests with remote target
  wmaenc: remove bit-exact hack
  FATE: remove WMA acodec tests
  FATE: add WMAv1 and WMAv2 encode/decode tests with fuzzy comparison
  FATE: add AC-3 and E-AC-3 encode/decode tests with fuzzy comparison
  qtrle: Use bytestream2 functions to prevent buffer overreads.
  vqavideo: check malloc return values
  x11grab: fix a memory leak exposed by valgrind
  threads: fix old frames returned after avcodec_flush_buffers()
  MPV: always mark dummy frames as reference
  h264: fix deadlocks on incomplete reference frame decoding.
  mpeg4: report frame decoding completion at ff_MPV_frame_end().
  mimic: don't use self as reference, and report completion at end of decode().

Conflicts:
	libavcodec/h264.c
	libavcodec/qtrle.c
	libavcodec/resample.c
	libavcodec/vqavideo.c
	libavdevice/x11grab.c
	tests/ref/seek/wmav1_asf
	tests/ref/seek/wmav2_asf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pthread: Fix mixing of declarations and statements.

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

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
dv: Fix streamcopy input.

Fixes Ticket1042

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavfi/scale: document behavior with regards to the output sample aspect ratio

Also show the input and output sample aspect ratio in the log.