avformat: AviSynth demuxer rewrite

Directly loads AviSynth through LoadLibrary instead of relying on
Video for Windows, and supports using AvxSynth (via dlopen) to
open scripts on Linux and OS X.

Error messages from AviSynth/AvxSynth are now reported through
av_log and exit, rather than the traditional behavior of generating
an error video that the user would need to watch to diagnose.

The main rewrite was authored by d s <avxsynth.testing@gmail.com>
from the AvxSynth team, with additional contributions by

Oka Motofumi <chikuzen.mo@gmail.com>
Stephen Hutchinson <qyot27@gmail.com>
Diego Biurrun <diego@biurrun.de>
Anton Khirnov <anton@khirnov.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
mjpegdec: use the AVFrame API properly.
p*menc: use the AVFrame API properly.
mxpegdec: use the AVFrame API properly.
pthread_frame: use the AVFrame API properly.

Remove the extended_data workaround, all decoders should now handle this
properly.
lavc: remove the extended_data workarounds.

All decoders should now handle it properly.
lavc: use buf[0] instead of data[0] as the indicator of an allocated frame

data[0] may be NULL for valid frames with hwaccel pixel formats.
lavc: remove a pointless check in decode_audio4()

av_frame_unref() works fine on unallocated frames.
lavc/decode_video(): always unref the frame if there is no output in decode_video

Not just on failure. This is the same thing that is done in the audio
path and should prevent leaks in decoders that allocate a frame, but
then end up not writing into it.
frame: copy flags in av_frame_copy_props()

Flags can be considered metadata (at least those that are defined now).
frame: cosmetics, reindent
lavc: rework handling of refcounted_frames=0

Use only proper AVFrame API (no assigning of whole frames, since that
hardcodes sizeof(AVFrame) into lavc).

Make a copy of the side data, so the caller can use av_frame_unref/free
on non-refcounted frames, eliminating the need for
avcodec_get_frame_defaults()/avcodec_free_frame().
ac3dec: make drc_scale exponentially

The a52 spec suggests that "partial compression" should scale the
drc value in this manner.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
dv: use AVFrame API properly
avcodec: Use av_reallocp where suitable

Signed-off-by: Martin Storsjö <martin@martin.st>
configure: detect Solaris libc

Add preprocessor flags for API availability as necessary.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
configure: Prefix libc-related variables with "libc_"

Simplifies host/target libc detection splitting.
Merge commit 'f0b234ab9e406efee85c17eb435db646092a943b'

* commit 'f0b234ab9e406efee85c17eb435db646092a943b':
  avformat: AviSynth demuxer rewrite

Conflicts:
	configure
	libavformat/avisynth.c

See: b9ad009475f3afb76bd2fbd92936dc4d4cd441ec (as well as later commits)
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Add support for picture_ptr field in MJpegDecodeContext

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit e0e3b8b297bae5144f23fd4b46a1309857040b63)

Conflicts:

	libavcodec/jpeglsdec.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5'

* commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5':
  mjpegdec: use the AVFrame API properly.

Conflicts:
	libavcodec/mjpegdec.c

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