Commit b8e89339 authored by Anton Khirnov's avatar Anton Khirnov Committed by Ronald S. Bultje

sws: replace all long with int.

Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 7d8c17b5
......@@ -466,8 +466,8 @@ DEFUN_END(yuv2rgb24_line)
#define ARG_srcStride 40
DEFUN(uyvytoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride)):
int width, int height,
int lumStride, int chromStride, int srcStride)):
link 0;
[--sp] = (r7:4,p5:4);
......@@ -539,8 +539,8 @@ DEFUN(uyvytoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8
DEFUN_END(uyvytoyv12)
DEFUN(yuyvtoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride)):
int width, int height,
int lumStride, int chromStride, int srcStride)):
link 0;
[--sp] = (r7:4,p5:4);
......
......@@ -38,12 +38,12 @@
#endif
int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
int width, int height,
int lumStride, int chromStride, int srcStride) L1CODE;
int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
int width, int height,
int lumStride, int chromStride, int srcStride) L1CODE;
static int uyvytoyv12_unscaled(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
......
......@@ -52,7 +52,7 @@ int main(int argc, char **argv)
int src_bpp;
int dst_bpp;
const char *name;
void (*func)(const uint8_t *src, uint8_t *dst, long src_size);
void (*func)(const uint8_t *src, uint8_t *dst, int src_size);
} func_info[] = {
FUNC(2, 2, rgb15to16),
FUNC(2, 3, rgb15to24),
......
......@@ -29,13 +29,13 @@ altivec_packIntArrayToCharArray(int *val, uint8_t* dest, int dstW)
register int i;
vector unsigned int altivec_vectorShiftInt19 =
vec_add(vec_splat_u32(10), vec_splat_u32(9));
if ((unsigned long)dest % 16) {
if ((unsigned int)dest % 16) {
/* badly aligned store, we force store alignment */
/* and will handle load misalignment on val w/ vec_perm */
vector unsigned char perm1;
vector signed int v1;
for (i = 0 ; (i < dstW) &&
(((unsigned long)dest + i) % 16) ; i++) {
(((unsigned int)dest + i) % 16) ; i++) {
int t = val[i] >> 19;
dest[i] = (t < 0) ? 0 : ((t > 255) ? 255 : t);
}
......
......@@ -30,7 +30,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
uint8_t *aDest, long dstW, long chrDstW)
uint8_t *aDest, int dstW, int chrDstW)
{
yuv2yuvX_altivec_real(lumFilter, lumSrc, lumFilterSize,
chrFilter, chrUSrc, chrVSrc, chrFilterSize,
......@@ -45,7 +45,7 @@ static inline void RENAME(yuv2packedX)(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,
long dstW, long dstY)
int dstW, int dstY)
{
/* The following list of supported dstFormat values should
match what's found in the body of ff_yuv2packedX_altivec() */
......
......@@ -793,7 +793,7 @@ ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
vector signed short RND = vec_splat_s16(1<<3);
vector unsigned short SCL = vec_splat_u16(4);
DECLARE_ALIGNED(16, unsigned long, scratch)[16];
DECLARE_ALIGNED(16, unsigned int, scratch)[16];
vector signed short *YCoeffs, *CCoeffs;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -980,7 +980,7 @@ static void fillPlane(uint8_t* plane, int stride, int width, int height, int y,
}
}
static inline void rgb48ToY(uint8_t *dst, const uint8_t *src, long width,
static inline void rgb48ToY(uint8_t *dst, const uint8_t *src, int width,
uint32_t *unused)
{
int i;
......@@ -995,7 +995,7 @@ static inline void rgb48ToY(uint8_t *dst, const uint8_t *src, long width,
static inline void rgb48ToUV(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *unused)
int width, uint32_t *unused)
{
int i;
assert(src1==src2);
......@@ -1011,7 +1011,7 @@ static inline void rgb48ToUV(uint8_t *dstU, uint8_t *dstV,
static inline void rgb48ToUV_half(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *unused)
int width, uint32_t *unused)
{
int i;
assert(src1==src2);
......@@ -1025,7 +1025,7 @@ static inline void rgb48ToUV_half(uint8_t *dstU, uint8_t *dstV,
}
}
static inline void bgr48ToY(uint8_t *dst, const uint8_t *src, long width,
static inline void bgr48ToY(uint8_t *dst, const uint8_t *src, int width,
uint32_t *unused)
{
int i;
......@@ -1040,7 +1040,7 @@ static inline void bgr48ToY(uint8_t *dst, const uint8_t *src, long width,
static inline void bgr48ToUV(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *unused)
int width, uint32_t *unused)
{
int i;
for (i = 0; i < width; i++) {
......@@ -1055,7 +1055,7 @@ static inline void bgr48ToUV(uint8_t *dstU, uint8_t *dstV,
static inline void bgr48ToUV_half(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *unused)
int width, uint32_t *unused)
{
int i;
for (i = 0; i < width; i++) {
......@@ -1069,7 +1069,7 @@ static inline void bgr48ToUV_half(uint8_t *dstU, uint8_t *dstV,
}
#define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\
static inline void name(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)\
static inline void name(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++) {\
......@@ -1090,7 +1090,7 @@ BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY
BGR2Y(uint16_t, rgb16ToY, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RY , GY<<5, BY<<11, RGB2YUV_SHIFT+8)
BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY , GY<<5, BY<<10, RGB2YUV_SHIFT+7)
static inline void abgrToA(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
static inline void abgrToA(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
{
int i;
for (i=0; i<width; i++) {
......@@ -1099,7 +1099,7 @@ static inline void abgrToA(uint8_t *dst, const uint8_t *src, long width, uint32_
}
#define BGR2UV(type, name, shr, shg, shb, shp, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S) \
static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\
static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, int width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++) {\
......@@ -1111,7 +1111,7 @@ static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const
dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\
}\
}\
static inline void name ## _half(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\
static inline void name ## _half(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, int width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++) {\
......@@ -1138,7 +1138,7 @@ BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<
BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8)
BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7)
static inline void palToY(uint8_t *dst, const uint8_t *src, long width, uint32_t *pal)
static inline void palToY(uint8_t *dst, const uint8_t *src, int width, uint32_t *pal)
{
int i;
for (i=0; i<width; i++) {
......@@ -1150,7 +1150,7 @@ static inline void palToY(uint8_t *dst, const uint8_t *src, long width, uint32_t
static inline void palToUV(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *pal)
int width, uint32_t *pal)
{
int i;
assert(src1 == src2);
......@@ -1162,7 +1162,7 @@ static inline void palToUV(uint8_t *dstU, uint8_t *dstV,
}
}
static inline void monowhite2Y(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
static inline void monowhite2Y(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
{
int i, j;
for (i=0; i<width/8; i++) {
......@@ -1172,7 +1172,7 @@ static inline void monowhite2Y(uint8_t *dst, const uint8_t *src, long width, uin
}
}
static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
{
int i, j;
for (i=0; i<width/8; i++) {
......@@ -1365,24 +1365,24 @@ static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t* src[], int srcStrid
return srcSliceH;
}
static void gray8aToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
static void gray8aToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
{
long i;
int i;
for (i=0; i<num_pixels; i++)
((uint32_t *) dst)[i] = ((const uint32_t *)palette)[src[i<<1]] | (src[(i<<1)+1] << 24);
}
static void gray8aToPacked32_1(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
static void gray8aToPacked32_1(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
{
long i;
int i;
for (i=0; i<num_pixels; i++)
((uint32_t *) dst)[i] = ((const uint32_t *)palette)[src[i<<1]] | src[(i<<1)+1];
}
static void gray8aToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
static void gray8aToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
{
long i;
int i;
for (i=0; i<num_pixels; i++) {
//FIXME slow?
......@@ -1398,7 +1398,7 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
{
const enum PixelFormat srcFormat= c->srcFormat;
const enum PixelFormat dstFormat= c->dstFormat;
void (*conv)(const uint8_t *src, uint8_t *dst, long num_pixels,
void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels,
const uint8_t *palette)=NULL;
int i;
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
......@@ -1455,7 +1455,7 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
const int dstBpp= (c->dstFormatBpp + 7) >> 3;
const int srcId= c->srcFormatBpp >> 2; /* 1:0, 4:1, 8:2, 15:3, 16:4, 24:6, 32:8 */
const int dstId= c->dstFormatBpp >> 2;
void (*conv)(const uint8_t *src, uint8_t *dst, long src_size)=NULL;
void (*conv)(const uint8_t *src, uint8_t *dst, int src_size)=NULL;
#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst)
......@@ -2057,18 +2057,18 @@ int sws_scale(SwsContext *c, const uint8_t* const src[], const int srcStride[],
}
/* Convert the palette to the same packed 32-bit format as the palette */
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
{
long i;
int i;
for (i=0; i<num_pixels; i++)
((uint32_t *) dst)[i] = ((const uint32_t *) palette)[src[i]];
}
/* Palette format: ABCD -> dst format: ABC */
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette)
{
long i;
int i;
for (i=0; i<num_pixels; i++) {
//FIXME slow?
......
......@@ -335,7 +335,7 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
* @param num_pixels number of pixels to convert
* @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
*/
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
/**
* Converts an 8bit paletted frame into a frame with a color depth of 24 bits.
......@@ -347,7 +347,7 @@ void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pi
* @param num_pixels number of pixels to convert
* @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
*/
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
#endif /* SWSCALE_SWSCALE_H */
......@@ -261,7 +261,7 @@ typedef struct SwsContext {
const int16_t *chrVSrc, const int16_t *alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
long dstW, long chrDstW);
int dstW, int chrDstW);
void (*yuv2yuvX )(struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
......@@ -269,7 +269,7 @@ typedef struct SwsContext {
const int16_t **alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
long dstW, long chrDstW);
int dstW, int chrDstW);
void (*yuv2packed1)(struct SwsContext *c,
const uint16_t *buf0,
const uint16_t *ubuf0, const uint16_t *ubuf1,
......@@ -289,26 +289,26 @@ typedef struct SwsContext {
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest,
long dstW, long dstY);
int dstW, int dstY);
void (*lumToYV12)(uint8_t *dst, const uint8_t *src,
long width, uint32_t *pal); ///< Unscaled conversion of luma plane to YV12 for horizontal scaler.
int width, uint32_t *pal); ///< Unscaled conversion of luma plane to YV12 for horizontal scaler.
void (*alpToYV12)(uint8_t *dst, const uint8_t *src,
long width, uint32_t *pal); ///< Unscaled conversion of alpha plane to YV12 for horizontal scaler.
int width, uint32_t *pal); ///< Unscaled conversion of alpha plane to YV12 for horizontal scaler.
void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *pal); ///< Unscaled conversion of chroma planes to YV12 for horizontal scaler.
int width, uint32_t *pal); ///< Unscaled conversion of chroma planes to YV12 for horizontal scaler.
void (*hyscale_fast)(struct SwsContext *c,
int16_t *dst, long dstWidth,
int16_t *dst, int dstWidth,
const uint8_t *src, int srcW, int xInc);
void (*hcscale_fast)(struct SwsContext *c,
int16_t *dst1, int16_t *dst2, long dstWidth,
int16_t *dst1, int16_t *dst2, int dstWidth,
const uint8_t *src1, const uint8_t *src2,
int srcW, int xInc);
void (*hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW,
int xInc, const int16_t *filter, const int16_t *filterPos,
long filterSize);
int filterSize);
void (*lumConvertRange)(uint16_t *dst, int width); ///< Color range conversion function for luma plane if needed.
void (*chrConvertRange)(uint16_t *dst1, uint16_t *dst2, int width); ///< Color range conversion function for chroma planes if needed.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment