fft-test: Reduce variable scope where sensibly possible

Also merge variable declaration and initialization.
fft-test: Drop unnecessary pointer indirection for context structs
fft-test: Check memory allocations
fft-test: K&R formatting cosmetics

Also rearrange #includes into canonical order.
fft-test: Pass correct struct members to (i)dct functions

This fixes a number of incompatible pointer type warnings.
http: K&R formatting cosmetics

Also comment some #endifs and reshuffle headers into canonical order.
mpegenccontext: Remove unused opaque pointer

Signed-off-by: Diego Biurrun <diego@biurrun.de>
dct/rdft: Remove duplicate typedefs for context structs

The typedefs also exist in the avfft.h header and since typedefs cannot be
legally redefined in C, the code fails to compile with some compilers.

This reverts commits 11c7155cce and 57f1b1dcc7.
qpeldsp: Mark source pointer in qpel_mc_func function pointer const
vc1dsp: Add wrappers for {avg|put}_vc1_mspel_mc00_c

This avoids invoking the wrapped functions with too many arguments.
fft-test: Pass the right struct members instead of casting
mpegvideo: Drop unused MPEG_BUF_SIZE and CHROMA_444 defines
mpegvideo: Move ME_MAP_* defines to the only place they are used
mpegvideo: Move QMAT_SHIFT* defines to the only place they are used
output example: set the stream timebase

This is required by the new API.
output example: convert audio to the format supported by the encoder
hevcdsp: remove an unneeded variable in the loop filter

beta0 and beta1 will always be the same
hevc: SSE2 and SSSE3 loop filters

Additional contributions by James Almer <jamrial@gmail.com>,
Carl Eugen Hoyos <cehoyos@ag.or.at>, Fiona Glaser <fiona@x264.com> and
Anton Khirnov <anton@khirnov.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
avcodec: Mark argument in av_{parser|hwaccel|bitstream_filter}_next as const
avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const