mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-01 07:37:09 +08:00
Merge branch 'sws_32bit_integration'
* sws_32bit_integration: regtests/sws: update checksums for recent changes sws: dont mess with XInc when the code needing it isnt used sws: Fix chroma init for 32bit buffers. swscale: error dithering for 16/9/10-bit to 8-bit. swscale: fix overflow in 16-bit vertical scaling. swscale: fix crash in 8-bpc bilinear output without alpha. swscale: fix 16-bit scaling when output is 8-bits. sws: fix non native endian 9-15 bit input with 16bit out sws: disable scale16 when int32 is used sws: fix rgb -> 16bit sws: fix uv overwrite in 32bt sws: fix gray16_1 sws:ix yuv2rgb48_1_c_template() sws: fix 16/32 bug from merge swscale: for >8bit scaling, read in native bit-depth. swscale: fix another yuv range conversion overflow in 16bit scaling. (cherry picked from commit 81cc7d0bd1eab0aa782ff8dd49e087025a42cdee) swscale: fix yuv range correction when using 16-bit scaling. (cherry picked from commit e0b8fff6c7a293e35079ba1931bd19372686b3f6) swscale: implement >8bit scaling support. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -77,8 +77,7 @@ typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
|
||||
typedef void (*yuv2planar1_fn) (struct SwsContext *c,
|
||||
const int16_t *lumSrc, const int16_t *chrUSrc,
|
||||
const int16_t *chrVSrc, const int16_t *alpSrc,
|
||||
uint8_t *dest[4], int dstW, int chrDstW,
|
||||
const uint8_t *lumDither, const uint8_t *chrDither);
|
||||
uint8_t *dest[4], int dstW, int chrDstW);
|
||||
/**
|
||||
* Write one line of horizontally scaled Y/U/V/A to planar output
|
||||
* with multi-point vertical scaling between input pixels.
|
||||
@ -101,7 +100,7 @@ typedef void (*yuv2planarX_fn) (struct SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc, int chrFilterSize,
|
||||
const int16_t **alpSrc, uint8_t *dest[4],
|
||||
int dstW, int chrDstW, const uint8_t *lumDither, const uint8_t *chrDither);
|
||||
int dstW, int chrDstW);
|
||||
/**
|
||||
* Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
|
||||
* output without any additional vertical scaling (or point-scaling). Note
|
||||
@ -210,6 +209,7 @@ typedef struct SwsContext {
|
||||
enum PixelFormat srcFormat; ///< Source pixel format.
|
||||
int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.
|
||||
int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.
|
||||
int scalingBpp;
|
||||
int chrSrcHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image.
|
||||
int chrSrcVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image.
|
||||
int chrDstHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image.
|
||||
@ -324,7 +324,7 @@ typedef struct SwsContext {
|
||||
#define UV_OFF "11*8+4*4*256*3+48"
|
||||
#define UV_OFFx2 "11*8+4*4*256*3+56"
|
||||
#define DITHER16 "11*8+4*4*256*3+64"
|
||||
#define DITHER32 "11*8+4*4*256*3+64+16"
|
||||
#define DITHER32 "11*8+4*4*256*3+80"
|
||||
|
||||
DECLARE_ALIGNED(8, uint64_t, redDither);
|
||||
DECLARE_ALIGNED(8, uint64_t, greenDither);
|
||||
@ -352,6 +352,8 @@ typedef struct SwsContext {
|
||||
uint16_t dither16[8];
|
||||
uint32_t dither32[8];
|
||||
|
||||
const uint8_t *chrDither8, *lumDither8;
|
||||
|
||||
#if HAVE_ALTIVEC
|
||||
vector signed short CY;
|
||||
vector signed short CRV;
|
||||
@ -451,7 +453,7 @@ typedef struct SwsContext {
|
||||
* (and input coefficients thus padded with zeroes)
|
||||
* to simplify creating SIMD code.
|
||||
*/
|
||||
void (*hScale)(int16_t *dst, int dstW, const uint8_t *src,
|
||||
void (*hScale)(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src,
|
||||
const int16_t *filter, const int16_t *filterPos,
|
||||
int filterSize);
|
||||
|
||||
@ -462,6 +464,15 @@ typedef struct SwsContext {
|
||||
void (*lumConvertRange)(int16_t *dst, int width); ///< Color range conversion function for luma plane if needed.
|
||||
void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width); ///< Color range conversion function for chroma planes if needed.
|
||||
|
||||
/**
|
||||
* dst[..] = (src[..] << 8) | src[..];
|
||||
*/
|
||||
void (*scale8To16Rv)(uint16_t *dst, const uint8_t *src, int len);
|
||||
/**
|
||||
* dst[..] = src[..] >> 4;
|
||||
*/
|
||||
void (*scale19To15Fw)(int16_t *dst, const int32_t *src, int len);
|
||||
|
||||
int needs_hcscale; ///< Set if there are chroma planes to be converted.
|
||||
|
||||
} SwsContext;
|
||||
|
Reference in New Issue
Block a user