summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-04 08:10:48 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-04 08:10:48 +0300
commitd5c868325cefcd5fad53361d1dfdc9757674eb70 (patch)
treea838e509fdc2468220466e6337097b3ef590b00c /libswscale
parent0cb5123c8f65b3d7715deb22ce8430eccc21996e (diff)
parent5b3834c5d1033f05d798278c33782c5563247062 (diff)
downloadmpv-d5c868325cefcd5fad53361d1dfdc9757674eb70.tar.bz2
mpv-d5c868325cefcd5fad53361d1dfdc9757674eb70.tar.xz
Merge svn changes up to r26979
Most of the conflicts are trivial. Conflicts: Makefile cfg-mplayer.h input/input.c libmenu/vf_menu.c libmpcodecs/dec_video.c libmpcodecs/vf_expand.c libmpcodecs/vf_vo.c libmpdemux/demux_mkv.c libmpdemux/demuxer.c libmpdemux/demuxer.h libvo/vo_directfb2.c libvo/vo_gl.c libvo/vo_winvidix.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c mplayer.c osdep/timer-linux.c stream/cache2.c
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/rgb2rgb.c20
-rw-r--r--libswscale/rgb2rgb_template.c31
-rw-r--r--libswscale/swscale.c10
-rw-r--r--libswscale/swscale_template.c4
4 files changed, 33 insertions, 32 deletions
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 19487d731d..ce0e0ee31a 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -305,13 +305,13 @@ void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
{
long i;
for (i=0; i<num_pixels; i++)
- ((uint16_t *)dst)[i] = ((uint16_t *)palette)[src[i]];
+ ((uint16_t *)dst)[i] = ((const uint16_t *)palette)[src[i]];
}
void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
for (i=0; i<num_pixels; i++)
- ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[src[i]]);
+ ((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
}
/**
@@ -321,13 +321,13 @@ void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
{
long i;
for (i=0; i<num_pixels; i++)
- ((uint16_t *)dst)[i] = ((uint16_t *)palette)[src[i]];
+ ((uint16_t *)dst)[i] = ((const uint16_t *)palette)[src[i]];
}
void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
for (i=0; i<num_pixels; i++)
- ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[src[i]]);
+ ((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
}
void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
@@ -372,8 +372,8 @@ void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
- uint8_t *d = (uint8_t *)dst;
- const uint16_t *s = (uint16_t *)src;
+ uint8_t *d = dst;
+ const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
while (s < end)
{
@@ -396,7 +396,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
- uint8_t *d = (uint8_t *)dst;
+ uint8_t *d = dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
while (s < end)
@@ -446,7 +446,7 @@ void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size)
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
- uint8_t *d = (uint8_t *)dst;
+ uint8_t *d = dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
while (s < end)
@@ -470,8 +470,8 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
- uint8_t *d = (uint8_t *)dst;
- const uint16_t *s = (uint16_t *)src;
+ uint8_t *d = dst;
+ const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
while (s < end)
{
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 4aa607d9af..3fb04c9c91 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -271,14 +271,14 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_
mm_end = end - 3;
while (s < mm_end)
{
- register unsigned x= *((uint32_t *)s);
+ register unsigned x= *((const uint32_t *)s);
*((uint32_t *)d) = (x&0x7FFF7FFF) + (x&0x7FE07FE0);
d+=4;
s+=4;
}
if (s < end)
{
- register unsigned short x= *((uint16_t *)s);
+ register unsigned short x= *((const uint16_t *)s);
*((uint16_t *)d) = (x&0x7FFF) + (x&0x7FE0);
}
}
@@ -325,14 +325,14 @@ static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long src_
mm_end = end - 3;
while (s < mm_end)
{
- register uint32_t x= *((uint32_t *)s);
+ register uint32_t x= *((const uint32_t*)s);
*((uint32_t *)d) = ((x>>1)&0x7FE07FE0) | (x&0x001F001F);
s+=4;
d+=4;
}
if (s < end)
{
- register uint16_t x= *((uint16_t *)s);
+ register uint16_t x= *((const uint16_t*)s);
*((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F);
s+=2;
d+=2;
@@ -432,7 +432,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
#endif
while (s < end)
{
- register int rgb = *(uint32_t*)s; s += 4;
+ register int rgb = *(const uint32_t*)s; s += 4;
*d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8);
}
}
@@ -493,7 +493,7 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s
#endif
while (s < end)
{
- register int rgb = *(uint32_t*)s; s += 4;
+ register int rgb = *(const uint32_t*)s; s += 4;
*d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19);
}
}
@@ -591,7 +591,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
#endif
while (s < end)
{
- register int rgb = *(uint32_t*)s; s += 4;
+ register int rgb = *(const uint32_t*)s; s += 4;
*d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9);
}
}
@@ -652,7 +652,7 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s
#endif
while (s < end)
{
- register int rgb = *(uint32_t*)s; s += 4;
+ register int rgb = *(const uint32_t*)s; s += 4;
*d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19);
}
}
@@ -936,8 +936,8 @@ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_
#ifdef HAVE_MMX
const uint16_t *mm_end;
#endif
- uint8_t *d = (uint8_t *)dst;
- const uint16_t *s = (uint16_t *)src;
+ uint8_t *d = dst;
+ const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
@@ -1219,7 +1219,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
#ifdef HAVE_MMX
const uint16_t *mm_end;
#endif
- uint8_t *d = (uint8_t *)dst;
+ uint8_t *d = dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
#ifdef HAVE_MMX
@@ -1297,8 +1297,8 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
#ifdef HAVE_MMX
const uint16_t *mm_end;
#endif
- uint8_t *d = (uint8_t *)dst;
- const uint16_t *s = (uint16_t *)src;
+ uint8_t *d = dst;
+ const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
@@ -1366,7 +1366,8 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
{
long idx = 15 - src_size;
- uint8_t *s = (uint8_t *) src-idx, *d = dst-idx;
+ const uint8_t *s = src-idx;
+ uint8_t *d = dst-idx;
#ifdef HAVE_MMX
asm volatile(
"test %0, %0 \n\t"
@@ -1420,7 +1421,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
: "memory");
#endif
for (; idx<15; idx+=4) {
- register int v = *(uint32_t *)&s[idx], g = v & 0xff00ff00;
+ register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
v &= 0xff00ff;
*(uint32_t *)&d[idx] = (v>>16) + g + (v<<16);
}
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index bca92ab6fb..139bc55e5f 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1848,8 +1848,8 @@ static int gray16swap(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
int y= srcSliceY;
int height= srcSliceH;
int i, j;
- uint16_t *srcPtr= src[0];
- uint16_t *dstPtr= dst[0] + dstStride[0]*y/2;
+ uint16_t *srcPtr= (uint16_t*)src[0];
+ uint16_t *dstPtr= (uint16_t*)(dst[0] + dstStride[0]*y/2);
for (i=0; i<height; i++)
{
for (j=0; j<length; j++) dstPtr[j] = bswap_16(srcPtr[j]);
@@ -2390,9 +2390,9 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
if (flags&SWS_PRINT_INFO)
{
#ifdef DITHER1XBPP
- char *dither= " dithered";
+ const char *dither= " dithered";
#else
- char *dither= "";
+ const char *dither= "";
#endif
if (flags&SWS_FAST_BILINEAR)
av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, ");
@@ -2542,7 +2542,7 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int v= av_clip_uint8(((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128);
pal[i]= y + (u<<8) + (v<<16);
}
- src2[1]= pal;
+ src2[1]= (uint8_t*)pal;
}
// copy strides, so they can safely be modified
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 360b592cf4..f76c5948c5 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2539,7 +2539,7 @@ static inline void RENAME(hyscale)(uint16_t *dst, long dstWidth, uint8_t *src, i
}
else if (srcFormat==PIX_FMT_RGB8 || srcFormat==PIX_FMT_BGR8 || srcFormat==PIX_FMT_PAL8 || srcFormat==PIX_FMT_BGR4_BYTE || srcFormat==PIX_FMT_RGB4_BYTE)
{
- RENAME(palToY)(formatConvBuffer, src, srcW, pal);
+ RENAME(palToY)(formatConvBuffer, src, srcW, (uint32_t*)pal);
src= formatConvBuffer;
}
@@ -2755,7 +2755,7 @@ inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1,
}
else if (srcFormat==PIX_FMT_RGB8 || srcFormat==PIX_FMT_BGR8 || srcFormat==PIX_FMT_PAL8 || srcFormat==PIX_FMT_BGR4_BYTE || srcFormat==PIX_FMT_RGB4_BYTE)
{
- RENAME(palToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
+ RENAME(palToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, (uint32_t*)pal);
src1= formatConvBuffer;
src2= formatConvBuffer+VOFW;
}