vdpau: add a postprocessing pseudo-filter

This factors out some code from vo_vdpau.c, especially deinterlacing
handling. The intention is to use this for vo_vdpau.c to make the logic
significantly easier, and to use it for vo_opengl (gl_hwdec_vdpau.c) to
allow selecting deinterlace and postprocessing modes.

As of this commit, the filter actually does nothing, since both vo_vdpau
and vo_opengl treat the generated images as normal vdpau images. This
will change in the following commits.
vf_vdpaupp: allow non-vdpau input

So you can use vdpau deinterlacing without using vdpau hardware
decoding.

vf_vavpp does something similar.
vo_opengl: make it work with vf_vdpaupp

This uses mp_vdpau_mixer_render(). The benefit is that it makes vdpau
deinterlacing just work. One additional minor advantage is that the
video mixer creation code is factored out (although that is a double-
edged sword).
vo_vdpau: support vf_vdpaupp

This is slightly incomplete: the mixer options, such as sharpen and
especially deinterlacing, are ignored. This also breaks automatic
enabling of interlacing with 'D' or --deinterlace. These issues will be
fixed later in the following commits.

Note that we keep all the custom vdpau queue stuff. This will also be
simplified later.
vdpau_mixer: allow overriding frame opts

So a caller can override the filter options dictated by vf_vdpaupp.
vo_vdpau: apply vo_vdpau postprocessing options

The previous commits changed vo_vdpau so that these options are set by
vf_vdpaupp, and the corresponding vo_vdpau were ignored. But for
compatibility, keep the "old" options working.

The value of this is questionable - maybe the vo_vdpau options should
just be removed. For now, at least demonstrate that it's possible.

The "deint" suboption still doesn't work, because the framerate doubling
logic required for some deint modes was moved to vf_vdpaupp. This
requires more elaborate workarounds.
vf_vdpaupp: allow toggling deinterlace

Basically makes the 'D' key work again. (But only if the filter is
already inserted.)
command: make enabling deinterlacing with vdpau work

This restores the capability of enabling deinterlacing with the
'cycle deinterlace' command with vo_vdpau, and also makes it work
with vo_opengl.
command: redo deinterlace filter probing

Give up on the deint_filters[] array, and probe using explicit code
instead. Add additional checks to test the pixel format to avoid
annoying warnings when a hardware deinterlacer is inserted when the
current video chain is obviously incompatible.
command, vo_vdpau: respect vdpau deint sub-option

This is a horrible hack to keep compatibility with the vo_vdpau deint
sub-option.
vo_vdpau: always use mp_image for internal buffer queue
video: move video frame queue from vo_vdpau.c to vo.c

Remove the special casing of vo_vdpau vs. other VOs. Replace the
complicated interaction between vo.c and vo_vdpau.c with a simple queue
in vo.c. VOs other than vdpau are handled by setting the length of the
queue to 1 (this is essentially what waiting_mpi was).

Note that vo_vdpau.c seems to have buffered only 1 or 2 frames into the
future, while the remaining 3 or 4 frames were past frames. So the new
code buffers 2 frames (vo_vdpau.c requests this queue length by setting
vo->max_video_queue to 2). It should probably be investigated why
vo_vdpau.c kept so many past frames.

The field vo->redrawing is removed. I'm not really sure what that would
be needed for; it seems pointless.

Future directions include making the interface between playloop and VO
simpler, as well as making rendering a frame a single operation, as
opposed to the weird 3-step sequence of rendering, drawing OSD, and
flipping.
vo_vdpau: keep colorspace flags

Since vdpau_mixer.c initializes the YUV conversion using the mp_image
flags, these images should have all flags set properly.
vf_vdpaupp: always provide past and future fields

Some non-deinterlacing filters (potentially denoising) also use
additional frames for filtering. The vdpau docs suggest providing at
least 1 future and 2 past _fields_, which means we need to provide 1
past frame (the future field is already the other field of the current
field, and both fields are in the same frame).

We can easily achieve this by buffering an additional frame in the non-
deint case.
video: fix screenshots with anamorphic video

(Again.)

This was caused by mp_image_set_params() not properly copying d_w/d_h,
because mp_image_set_size() resets them.
vo: verify format of queued image

Currently, only the configured format is accepted, so assert that the
playback core code (which handles format changes) is correct.
vf_lavfi: reinit after libavfilter EOF

Basically, if we feed the filter a new image even after the EOF state
has been reached (e.g. because the input stream "recovered"), we want
the filter to restart, instead of returning an error forever.
vf: mark auto-inserted conversion filters in verbose output

Nota that this flag is not set for other auto-inserted filters (like
deinterlacing or rotation).
vf: expose input parameters; clear parameters on failure

Preparation (and simplification) for following commits.
vf: add alternate functions for retrieving filter output

These replace vf_read_output_frame(), although we still emulate that
function. This change is preparation for another commit (and this is
basically just to reduce the diff and signal/noise ratio in that
commit).