[fix] vf_expand crash, also add pass-through case
[fix] fix vdpau hw decoding

Didn't used ref-counted mp_image yet, so it just crashed.

Switch the vdpau hw decoding path to ref-counting. This is special,
because the VO allocated hardware surfaces. Move part of the allocation
to vo_vdpau.c, so that all the surface management code is in that file.
In theory, it would be cleaner to have the vdpau surface management and
hw decoder initialization on the decoder side, but that would mean some
huge refactoring.
[fix] allow lavc DR created frames to be referenced past decoder lifetime

Or in other words, allow images to live longer than the pool managed by
lavc_dr1.c. Revert the subtle change in dec_video.c, that worked around
this issue by freeing the filter chain before the decoder.
video: use libavutil pixel format descriptors

Replace the internal pixel format stuff with code that queries the
libavutil list of pixel format descriptors.

Trying to map IMGFMT_IS_RGB() etc. turned out extremely hacky.
mp_image: simplify image allocation

mp_image_alloc_planes() allocated images with minimal stride, even if
the resulting stride was unaligned. It was the responsibility of
vf_get_image() to set an image's width to something larger than
required to get an aligned stride, and then crop it. Always allocate
with aligned strides instead.

Get rid of IMGFMT_IF09 special handling. This format is not used
anymore. Get rid of swapped chroma plane allocation. This is not used
anywhere, and VOs like vo_xv and vo_direct3d do their own swapping.

Always round chroma width/height up instead of down. Consider 4:2:0 and
an uneven image size. For luma, the size was left uneven, and the chroma
size was rounded down. This doesn't make sense, because chroma would be
missing for the bottom/right border.
mp_image: change how palette is handled

According to DOCS/OUTDATED-tech/colorspaces.txt, the following formats
are supposed to be palettized:

    IMGFMT_BGR8
    IMGFMT_RGB8,
    IMGFMT_BGR4_CHAR
    IMGFMT_RGB4_CHAR
    IMGFMT_BGR4
    IMGFMT_RGB4

Of these, only BGR8 and RGB8 are actually treated as palettized in some
way. ffmpeg has only one palettized format (AV_PIX_FMT_PAL8), and
IMGFMT_BGR8 was inconsistently mapped to packed non-palettized RGB
formats too (AV_PIX_FMT_BGR8). Moreover, vf_scale.c contained messy
hacks to generate a palette when AV_PIX_FMT_BGR8 is output. (libswscale
does not support AV_PIX_FMT_PAL8 output in the first place.)

Get rid of all of this, and introduce IMGFMT_PAL8, which directly maps
to AV_PIX_FMT_PAL8. Remove the palette creation code from vf_scale.c.
IMGFMT_BGR8 maps to AV_PIX_FMT_RGB8 (don't ask me why it's swapped),
without any palette use. Enabling it in vo_x11 or using it as vf_scale
input seems to give correct results.
[fix] vdpau decoder

This decoder doesn't actually exist?
[fix] mp_image corrections

The qscale shouldn't be passed along if the image is copied either.

Squash with: "mp_image: refcounting helpers"
screenshot: simplify
mp_image: cleanup: remove support for non-refcounted images

The new_mp_image()/mp_image_new_empty() and mp_image_alloc_planes()
functions supported allocating non-refcounted mp_images and image data.
Remove them and the code required to support them.

It's still allowed to setup mp_images manually, you just can't allocate
image data with them anymore.
video: cleanup: move and rename vf_mpi_clear and vf_clone_attributes

These functions weren't specific to video filters and were misplaced
in vf.c. Move them to mp_image.c.

Fix the big endian test in vf_mpi_clear/mp_image_clear, which has been
messed up in 74df1d.