[fix] better logic

Should be simpler and more robust.
vo_direct3d: use new OSD API
libvo: remove eosd_packer.c

This contains about the same code as bitmap_packer.c. eosd_packer.c was
added first, and then not merged for a year - then it was added as
bitmap_packer.c with slightly different and incompatible interface. Now
replacing eosd_packer.c with bitmap_packer.c is finally done. So much
wasted work...
sub, VO: remove vo_osd_resized() function

VOs which could render the OSD in window size (as opposed to video size,
like vo_xv) and which could cache the OSD called this when the window
size changed. This was needed, because VOs used another OSD function to
check whether the OSD changed before passing the new window size to the
OSD code.

This was really just an artifact of OSD change detection, and now that
the affected VOs use the new OSD rendering API, it's done automatically.
sub: always go through sub.c for OSD rendering

Before this commit, vf_vo.c and vf_ass.c were manually calling the
subtitle decoder to retrieve images to render. In particular, this
circumvented the sub-bitmap conversion & caching layer in sub.c.

Change this so that subtitle decoding isn't special anymore, and draws
all subtitles with the normal OSD drawing API.

This is also a step towards removing the need for vf_ass auto-insertion.
In fact, if auto-insertion would be disabled now, VOs with "old" OSD
rendering could still render ASS subtitles in monochrome, because
there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism.
sub: cleanup: don't pass parameter via global variables

Passing parameters from caller to subtitle renderer was done by
temporarily setting certain members in the osd_state struct (which for
all practical purposes are as good as global variables). This was the
only purpose of these members.

Rather than using such a messy way to pass parameter, put these into a
struct sub_render_params. The struct was already introduced in earlier
commits, and this commit just removes the parameter passing hack.
sub: cosmetics: move things around

Move sub-bitmap definitions from dec_sub.h to sub.h. While it's a bit
odd that OSD data structures are in a file named sub.h, it's definitely
way too strange to have them in a file about subtitle decoding. (Maybe
sub.h/.c and the sub/ directory should be split out and renamed "osd"
at a later point.)

Remove including ass_mp.h (and the libass headers) where possible.

Remove typedefs for mp_eosd_res and sub_bitmaps structs.

Store a mp_eosd_res struct in osd_state instead of just w/h. Note that
sbtitles might be rendered using different sizes/margins when filters
are involved.
sub: never decode subs to old OSD format

Instead, sd_lavc.c and spudec.c (the two image sub decoders) always
output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED,
and convert the subs to RGBA in img_convert.c instead. If a VO is used
that supports the old OSD format only, the indexed bitmaps are converted
to the old OSD format by abusing spudec.c in a similar way sd_lavc.c
used to do.

The main reason why spudec.c is used is because the images must not only
be converted to the old format, but also properly scaled, cropped, and
aligned (the asm code in libvo/osd.c requires this alignment).
sub: remove OSD conversions that are not needed anymore

These converted from the old formats to new formats, because some
subtitle decoders (namely spudec.c) produced the old format only. This
has been changed, and all sub decoders produce new formats.

Also remove support for the packed old OSD format from OpenGL VOs (the
packed formats were how the actual OSD format was handled in some
GPU-driven VOs for a while). It makes no sense anymore. A grayscale/alpha
format would still be interesting: it could be faster, and a feature to
get rid of ugly DVD yellow subs. However, that would be a separate thing
and would use a sane pixel format, as opposed to the old OSD format.

Note: currently, image subs can't be rendered if vf_ass is inserted.
Old VOs like vo_xv force vf_ass to be auto-inserted, so -no-ass has to
be used to prevent insertion of vf_ass and to enable display of image
subtitles.