imgutils: make systematic palette opaque.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vf_format: rework format list parsing

Avoid using AV_PIX_FMT_NB, since that hardcodes the number of pixel
formats into lavfi and will break when a shared lavu is updated, adding
new pixel formats.
vf_scale: use the pixfmt descriptor API

Avoid using AV_PIX_FMT_NB, since that hardcodes the number of pixel
formats into lavfi and will break when a shared lavu is updated, adding
new pixel formats.
vf_fieldorder: avoid using AV_PIX_FMT_NB

That hardcodes the number of pixel formats into lavfi and will break
when a shared lavu is updated, adding new pixel formats.
buffersrc: avoid using AV_PIX_FMT_NB

That hardcodes the number of pixel formats into lavfi and will break
when a shared lavu is updated, adding new pixel formats.
lavfi/formats: avoid using AV_{PIX,SAMPLE}_FMT_NB

Thatt hardcodes the number of formats into lavfi and will break when a
shared lavu is updated, adding new formats.
lavc/gif: mark one colour as transparent

If the input palette contains at least one colour that is more than 50%
transparent.

Fixes ticket #715.
lavc/gif: support resolutions up to 65535x65535

Maybe someone can add a check in the second gif encoder (rgb24), because I'm not
sure where it should be added.
lavc/gif: remove some obsolete/irrelevant chunks

Some code was copy pasted from muxer, which still have same comments but unlike
encoder they are still relevant to muxer.
lavc/gifdec: move some definitions to header file.

Share them with upcoming demuxer module.
gif: cleanse GIF muxer and encoder

This commit removes the badly duplicated code between the encoder and
the muxer. That may sound surprising, but the encoder is now responsible
from the encoding of the picture when muxing to a .gif file. It also
does not require anymore a manual user intervention such as a -pix_fmt
rgb24 to work properly. To summarize, output gif are now easier to
generate, code is saner and simpler, and files are smaller (thanks to
the lzw encoding which was unused so far with the default .gif output).
We can certainly make things even better, but this is the first step.

Fixes Ticket #2262
lavc/gif: crop image when possible.

Increase compression when pictures are similar.

-f lavfi testsrc=300: 61M -> 21M
lavf/gif: simplify palette writing.
lavc/gif: merge two allocation checks.
gif: remove outdated comments.
lavf/gif: simplify streams type checking.
lavf/gif: remove unused fields.
lavf/gif: trim unnecessarily long netscape ext code.

Extension description comments are now placed along the avio calls, the
always defined macro removed, and the always true loop_count check as
well (loop option is bound to 0-65535).
lavf/gif: merge gif_write_{packet,video}.

Avoid a pointless split.
lavf/gif: support only GIF codec.