resample: fix avresample_get_delay() return value

The correct "next" input sample is not the first sample of the
resampling buffer, but the center sample of the filter_length-sized
block at the beginning.

CC:libav-stable@libav.org
resample: split the nearest neighbour path into a separate function pointer
resample: reindent
resample: drop useless abs()

negative sample_index is handled in the block above.
resample: add initial padding explicitly

This simplifies the code, since we do not have to deal with a possibly
negative source index anymore.
resample: split linear into its own function
mp3enc: Properly write bitrate value in XING header

Instead of using a fixed bitrate_idx, calculate a matching bitrate for
the XING header.

Using a fixed bitrate_idx causes tools such as file(1) and mediainfo(1)
to report wrong bitrate and bitrate mode when using CBR.

Bug-Id: https://bugs.debian.org/736088

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
doc: Libavfilter English cleanup

This aims to standardize the English used in the libavfilter
documentation, describing the same thing in the same way more often,
and significantly reduce the amount of outright errors, including
run-on sentences and sentence fragments.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
swscale: fix an implementation-defined unsigned-to-signed conversion
swscale: fix some undefined signed left shifts

Based on a patch by Michael Niedermayer <michaelni@gmx.at>
swscale: Set alpha to opaque for internal palettes.

Fixes conversion of pal8 to rgb formats with alpha.

Updated references for 2 FATE tests which previously encoded fully
transparent images.

Based on a patch by Baptiste Coudurier <baptiste.coudurier@gmail.com>
tiffdec: rename variables for consistency and fix variable shadowing

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
tiffdec: use correct data type for palette entries and set alpha to 0xFF
bytestream: add functions for accessing size of buffer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
bytestream: add bytestream2_copy_buffer() functions

This is basically an overread/overwrite-safe memcpy between a
GetByteContext and a PutByteContext.

CC:libav-stable@libav.org
tiffdec: use bytestream2 to simplify overread/overwrite protection

Based on a patch by Paul B Mahol <onemda@gmail.com>

CC:libav-stable@libav.org
tiffdec: use a single strip if RowsPerStrip is 0

The spec does not specify that 0 is an error condition, and there
are samples which use 0 when the whole image is in one strip.
tiff: use a better name and enum values for PhotometricInterpretation

Also add additional known values and log as missing features.
tiffdec: remove an unneeded variable
tiffdec: support predictor type 2 with RGB48 pixel format