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