Commit 6a4970ab authored by Diego Biurrun's avatar Diego Biurrun
Browse files

cosmetics: Remove trailing whitespace.

Originally committed as revision 23147 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent 5ad75147
......@@ -65,12 +65,12 @@ int main(int argc, char **argv)
uint8_t *dstBuffer= (uint8_t*)av_malloc(SIZE);
int failedNum=0;
int passedNum=0;
av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n");
args_parse(argc, argv);
av_log(NULL, AV_LOG_INFO, "CPU capabilities forced to %x\n", cpu_caps);
sws_rgb2rgb_init(cpu_caps);
for(funcNum=0; ; funcNum++){
struct func_info_s {
int src_bpp;
......@@ -128,7 +128,7 @@ int main(int argc, char **argv)
uint8_t *src= srcBuffer+srcOffset;
uint8_t *dst= dstBuffer+dstOffset;
char *name=NULL;
if(failed) break; //don't fill the screen with shit ...
srcBpp = func_info[funcNum].src_bpp;
......@@ -141,7 +141,7 @@ int main(int argc, char **argv)
for(i=0; i<SIZE; i++){
if(srcBuffer[i]!=srcByte){
av_log(NULL, AV_LOG_INFO, "src damaged at %d w:%d src:%d dst:%d %s\n",
av_log(NULL, AV_LOG_INFO, "src damaged at %d w:%d src:%d dst:%d %s\n",
i, width, srcOffset, dstOffset, name);
failed=1;
break;
......@@ -149,7 +149,7 @@ int main(int argc, char **argv)
}
for(i=0; i<dstOffset; i++){
if(dstBuffer[i]!=dstByte){
av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
i, width, srcOffset, dstOffset, name);
failed=1;
break;
......@@ -157,7 +157,7 @@ int main(int argc, char **argv)
}
for(i=dstOffset + width*dstBpp; i<SIZE; i++){
if(dstBuffer[i]!=dstByte){
av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
av_log(NULL, AV_LOG_INFO, "dst damaged at %d w:%d src:%d dst:%d %s\n",
i, width, srcOffset, dstOffset, name);
failed=1;
break;
......@@ -169,7 +169,7 @@ int main(int argc, char **argv)
if(failed) failedNum++;
else if(srcBpp) passedNum++;
}
av_log(NULL, AV_LOG_INFO, "\n%d converters passed, %d converters randomly overwrote memory\n", passedNum, failedNum);
return failedNum;
}
......@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* the C code (not assembly, mmx, ...) of this file can be used
* under the LGPL license too
*/
......@@ -271,7 +271,7 @@ void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
dst[2]= palette[ src[i]*4+2 ];
//dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4;
}
}
......@@ -430,7 +430,7 @@ void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
long num_pixels = src_size >> 1;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
......@@ -447,7 +447,7 @@ void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
long num_pixels = src_size >> 1;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
......@@ -504,7 +504,7 @@ void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
long num_pixels = src_size >> 1;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
......@@ -521,7 +521,7 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
long num_pixels = src_size >> 1;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
......
......@@ -141,7 +141,7 @@ extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint
long width, long height,
long srcStride1, long srcStride2,
long srcStride3, long dstStride);
void sws_rgb2rgb_init(int flags);
#endif
......@@ -23,7 +23,7 @@
* You should have received a copy of the GNU General Public License
* along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* the C code (not assembly, mmx, ...) of this file can be used
* under the LGPL license too
*/
......@@ -372,7 +372,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
"pmaddwd %%mm7, %%mm3 \n\t"
"pand %%mm5, %%mm1 \n\t"
"pand %%mm5, %%mm4 \n\t"
"por %%mm1, %%mm0 \n\t"
"por %%mm1, %%mm0 \n\t"
"por %%mm4, %%mm3 \n\t"
"psrld $5, %%mm0 \n\t"
"pslld $11, %%mm3 \n\t"
......@@ -531,7 +531,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
"pmaddwd %%mm7, %%mm3 \n\t"
"pand %%mm5, %%mm1 \n\t"
"pand %%mm5, %%mm4 \n\t"
"por %%mm1, %%mm0 \n\t"
"por %%mm1, %%mm0 \n\t"
"por %%mm4, %%mm3 \n\t"
"psrld $6, %%mm0 \n\t"
"pslld $10, %%mm3 \n\t"
......@@ -978,7 +978,7 @@ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_
"movq %%mm0, %%mm6\n\t"
"movq %%mm3, %%mm7\n\t"
"movq 8%1, %%mm0\n\t"
"movq 8%1, %%mm1\n\t"
"movq 8%1, %%mm2\n\t"
......@@ -1015,7 +1015,7 @@ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_
"movq %%mm3, %%mm5\n\t"
"movq %%mm6, %%mm0\n\t"
"movq %%mm7, %%mm1\n\t"
"movq %%mm4, %%mm6\n\t"
"movq %%mm5, %%mm7\n\t"
"movq %%mm0, %%mm2\n\t"
......@@ -1117,7 +1117,7 @@ static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_
"psllq $16, %%mm5\n\t"
"por %%mm4, %%mm3\n\t"
"por %%mm5, %%mm3\n\t"
"movq %%mm0, %%mm6\n\t"
"movq %%mm3, %%mm7\n\t"
......@@ -1148,7 +1148,7 @@ static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_
"por %%mm4, %%mm3\n\t"
"por %%mm5, %%mm3\n\t"
:"=m"(*d)
:"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
:"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
:"memory");
/* Borrowed 32 to 24 */
__asm __volatile(
......@@ -1156,7 +1156,7 @@ static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_
"movq %%mm3, %%mm5\n\t"
"movq %%mm6, %%mm0\n\t"
"movq %%mm7, %%mm1\n\t"
"movq %%mm4, %%mm6\n\t"
"movq %%mm5, %%mm7\n\t"
"movq %%mm0, %%mm2\n\t"
......@@ -1451,7 +1451,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
"pand %%mm6, %%mm1 \n\t"
"pand %%mm7, %%mm2 \n\t"
"por %%mm0, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
"movq 6(%1, %%"REG_a"), %%mm0 \n\t" // BGR BGR BG
MOVNTQ" %%mm1, (%2, %%"REG_a")\n\t" // RGB RGB RG
"movq 8(%1, %%"REG_a"), %%mm1 \n\t" // R BGR BGR B
......@@ -1460,7 +1460,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
"pand %%mm5, %%mm1 \n\t"
"pand %%mm6, %%mm2 \n\t"
"por %%mm0, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
"movq 14(%1, %%"REG_a"), %%mm0 \n\t" // R BGR BGR B
MOVNTQ" %%mm1, 8(%2, %%"REG_a")\n\t" // B RGB RGB R
"movq 16(%1, %%"REG_a"), %%mm1 \n\t" // GR BGR BGR
......@@ -1469,7 +1469,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
"pand %%mm7, %%mm1 \n\t"
"pand %%mm5, %%mm2 \n\t"
"por %%mm0, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
"por %%mm2, %%mm1 \n\t"
MOVNTQ" %%mm1, 16(%2, %%"REG_a")\n\t"
"add $24, %%"REG_a" \n\t"
" js 1b \n\t"
......@@ -1908,16 +1908,16 @@ static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc,
static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWidth, long srcHeight, long srcStride, long dstStride)
{
long x,y;
dst[0]= src[0];
// first line
for(x=0; x<srcWidth-1; x++){
dst[2*x+1]= (3*src[x] + src[x+1])>>2;
dst[2*x+2]= ( src[x] + 3*src[x+1])>>2;
}
dst[2*srcWidth-1]= src[srcWidth-1];
dst+= dstStride;
for(y=1; y<srcHeight; y++){
......@@ -1983,11 +1983,11 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
dst+=dstStride*2;
src+=srcStride;
}
// last line
#if 1
dst[0]= src[0];
for(x=0; x<srcWidth-1; x++){
dst[2*x+1]= (3*src[x] + src[x+1])>>2;
dst[2*x+2]= ( src[x] + 3*src[x+1])>>2;
......@@ -2657,7 +2657,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
"punpckhbw %%mm1, %%mm3\n\t" /* Y4U1 Y5V1 Y6U1 Y7V1*/
MOVNTQ" %%mm0, (%4, %0, 8)\n\t"
MOVNTQ" %%mm3, 8(%4, %0, 8)\n\t"
"punpckhbw %%mm2, %%mm6\n\t" /* U2V2 U2V2 U3V3 U3V3*/
"movq 8(%1, %0, 4), %%mm0\n\t"
"movq %%mm0, %%mm3\n\t"
......@@ -2674,7 +2674,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
"punpckhbw %%mm4, %%mm3\n\t" /* Y U5 Y V5 Y U5 Y V5*/
MOVNTQ" %%mm0, 32(%4, %0, 8)\n\t"
MOVNTQ" %%mm3, 40(%4, %0, 8)\n\t"
"punpckhbw %%mm5, %%mm6\n\t"
"movq 24(%1, %0, 4), %%mm0\n\t"
"movq %%mm0, %%mm3\n\t"
......
......@@ -35,7 +35,7 @@ static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, i
uint64_t ssd=0;
//printf("%d %d\n", w, h);
for(y=0; y<h; y++){
for(x=0; x<w; x++){
int d= src1[x + y*stride1] - src2[x + y*stride2];
......@@ -49,7 +49,7 @@ static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, i
// test by ref -> src -> dst -> out & compare out against ref
// ref & out are YV12
static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat, int dstFormat,
static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat, int dstFormat,
int srcW, int srcH, int dstW, int dstH, int flags){
uint8_t *src[3];
uint8_t *dst[3];
......@@ -59,7 +59,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
uint64_t ssdY, ssdU, ssdV;
struct SwsContext *srcContext, *dstContext, *outContext;
int res;
res = 0;
for(i=0; i<3; i++){
// avoid stride % bpp != 0
......@@ -67,12 +67,12 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
srcStride[i]= srcW*3;
else
srcStride[i]= srcW*4;
if(dstFormat==PIX_FMT_RGB24 || dstFormat==PIX_FMT_BGR24)
dstStride[i]= dstW*3;
else
dstStride[i]= dstW*4;
src[i]= (uint8_t*) malloc(srcStride[i]*srcH);
dst[i]= (uint8_t*) malloc(dstStride[i]*dstH);
out[i]= (uint8_t*) malloc(refStride[i]*h);
......@@ -122,27 +122,27 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
#if defined(ARCH_X86)
asm volatile ("emms\n\t");
#endif
ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
ssdU= getSSD(ref[1], out[1], refStride[1], refStride[1], (w+1)>>1, (h+1)>>1);
ssdV= getSSD(ref[2], out[2], refStride[2], refStride[2], (w+1)>>1, (h+1)>>1);
if(srcFormat == PIX_FMT_GRAY8 || dstFormat==PIX_FMT_GRAY8) ssdU=ssdV=0; //FIXME check that output is really gray
ssdY/= w*h;
ssdU/= w*h/4;
ssdV/= w*h/4;
if(ssdY>100 || ssdU>100 || ssdV>100){
printf(" %s %dx%d -> %s %4dx%4d flags=%2d SSD=%5lld,%5lld,%5lld\n",
sws_format_name(srcFormat), srcW, srcH,
printf(" %s %dx%d -> %s %4dx%4d flags=%2d SSD=%5lld,%5lld,%5lld\n",
sws_format_name(srcFormat), srcW, srcH,
sws_format_name(dstFormat), dstW, dstH,
flags,
ssdY, ssdU, ssdV);
}
end:
sws_freeContext(srcContext);
sws_freeContext(dstContext);
sws_freeContext(outContext);
......@@ -170,14 +170,14 @@ static void selfTest(uint8_t *src[3], int stride[3], int w, int h){
printf("%s -> %s\n",
sws_format_name(srcFormat),
sws_format_name(dstFormat));
srcW= w;
srcH= h;
for(dstW=w - w/3; dstW<= 4*w/3; dstW+= w/3){
for(dstH=h - h/3; dstH<= 4*h/3; dstH+= h/3){
for(flags=1; flags<33; flags*=2) {
int res;
res = doTest(src, stride, w, h, srcFormat, dstFormat,
srcW, srcH, dstW, dstH, flags);
if (res < 0) {
......@@ -206,7 +206,7 @@ int main(int argc, char **argv){
struct SwsContext *sws;
sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUV420P, 2, NULL, NULL, NULL);
for(y=0; y<H; y++){
for(x=0; x<W*4; x++){
rgb_data[ x + y*4*W]= random();
......
......@@ -25,7 +25,7 @@
supported Input formats: YV12, I420/IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09, PAL8
supported output formats: YV12, I420/IYUV, YUY2, UYVY, {BGR,RGB}{1,4,8,15,16,24,32}, Y8/Y800, YVU9/IF09
{BGR,RGB}{1,4,8,15,16} support dithering
unscaled special converters (YV12=I420=IYUV, Y800=Y8)
YV12 -> {BGR,RGB}{1,4,8,15,16,24,32}
x -> x
......@@ -37,7 +37,7 @@
BGR15 -> BGR16
*/
/*
/*
tested special converters (most are tested actually but i didnt write it down ...)
YV12 -> BGR16
YV12 -> YV12
......@@ -199,7 +199,7 @@ static const uint64_t w1111 attribute_used __attribute__((aligned(8))) = 0
static unsigned char clip_table[768];
static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b);
extern const uint8_t dither_2x2_4[2][8];
extern const uint8_t dither_2x2_8[2][8];
extern const uint8_t dither_8x8_32[8][8];
......@@ -423,7 +423,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
if(V>255) V=255;\
else if(V<0) V=0;\
}
#define YSCALE_YUV_2_RGBX_C(type) \
YSCALE_YUV_2_PACKEDX_C(type)\
r = (type *)c->table_rV[V];\
......@@ -904,7 +904,7 @@ static double getSplineCoeff(double a, double b, double c, double d, double dist
{
// printf("%f %f %f %f %f\n", a,b,c,d,dist);
if(dist<=1.0) return ((d*dist + c)*dist + b)*dist +a;
else return getSplineCoeff( 0.0,
else return getSplineCoeff( 0.0,
b+ 2.0*c + 3.0*d,
c + 3.0*d,
-b- 3.0*c - 6.0*d,
......@@ -949,7 +949,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int xDstInSrc;
filterSize= 1;
filter= av_malloc(dstW*sizeof(double)*filterSize);
xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++)
{
......@@ -966,7 +966,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int xDstInSrc;
if (flags&SWS_BICUBIC) filterSize= 4;
else if(flags&SWS_X ) filterSize= 4;
else filterSize= 2; // SWS_BILINEAR / SWS_AREA
else filterSize= 2; // SWS_BILINEAR / SWS_AREA
filter= av_malloc(dstW*sizeof(double)*filterSize);
xDstInSrc= xInc/2 - 0x8000;
......@@ -1006,7 +1006,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
sizeFactor= 0.0; //GCC warning killer
ASSERT(0)
}
if(xInc1 <= 1.0) filterSizeInSrc= sizeFactor; // upscale
else filterSizeInSrc= sizeFactor*srcW / (double)dstW;
......@@ -1030,7 +1030,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
double B= param[0] != SWS_PARAM_DEFAULT ? param[0] : 0.0;
double C= param[1] != SWS_PARAM_DEFAULT ? param[1] : 0.6;
if(d<1.0)
if(d<1.0)
coeff = (12-9*B-6*C)*d*d*d + (-18+12*B+6*C)*d*d + 6-2*B;
else if(d<2.0)
coeff = (-B-6*C)*d*d*d + (6*B+30*C)*d*d + (-12*B-48*C)*d +8*B+24*C;
......@@ -1046,7 +1046,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
else if(flags & SWS_X)
{
double A= param[0] != SWS_PARAM_DEFAULT ? param[0] : 1.0;
if(d<1.0)
coeff = cos(d*PI);
else
......@@ -1073,7 +1073,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
}
else if(flags & SWS_LANCZOS)
{
double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0;
double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0;
coeff = d ? sin(d*PI)*sin(d*PI/p)/(d*d*PI*PI/p) : 1.0;
if(d>p) coeff=0;
}
......@@ -1218,7 +1218,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
}
}
av_free(filter2); filter2=NULL;
//FIXME try to align filterpos if possible
......@@ -1277,7 +1277,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
error = v - intV;
}
}
(*filterPos)[dstW]= (*filterPos)[dstW-1]; // the MMX scaler will read over the end
for(i=0; i<*outFilterSize; i++)
{
......@@ -1312,8 +1312,8 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
"jmp 9f \n\t"
// Begin
"0: \n\t"
"movq (%%"REG_d", %%"REG_a"), %%mm3\n\t"
"movd (%%"REG_c", %%"REG_S"), %%mm0\n\t"
"movq (%%"REG_d", %%"REG_a"), %%mm3\n\t"
"movd (%%"REG_c", %%"REG_S"), %%mm0\n\t"
"movd 1(%%"REG_c", %%"REG_S"), %%mm1\n\t"
"punpcklbw %%mm7, %%mm1 \n\t"
"punpcklbw %%mm7, %%mm0 \n\t"
......@@ -1352,8 +1352,8 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
"jmp 9f \n\t"
// Begin
"0: \n\t"
"movq (%%"REG_d", %%"REG_a"), %%mm3\n\t"
"movd (%%"REG_c", %%"REG_S"), %%mm0\n\t"
"movq (%%"REG_d", %%"REG_a"), %%mm3\n\t"
"movd (%%"REG_c", %%"REG_S"), %%mm0\n\t"
"punpcklbw %%mm7, %%mm0 \n\t"
"pshufw $0xFF, %%mm0, %%mm1 \n\t"
"1: \n\t"
......@@ -1388,7 +1388,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
xpos= 0; //lumXInc/2 - 0x8000; // difference between pixel centers
fragmentPos=0;
for(i=0; i<dstW/numSplits; i++)
{
int xx=xpos>>16;
......@@ -1472,7 +1472,7 @@ static void globalInit(void){
}
static SwsFunc getSwsFunc(int flags){
#if defined(RUNTIME_CPUDETECT) && defined (CONFIG_GPL)
#if defined(ARCH_X86)
// ordered per speed fasterst first
......@@ -1581,7 +1581,7 @@ static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int sr
case 0x83: conv= rgb15to32; break;
case 0x84: conv= rgb16to32; break;
case 0x86: conv= rgb24to32; break;
default: av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
default: av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
}
}else if( (isBGR(srcFormat) && isRGB(dstFormat))
......@@ -1603,11 +1603,11 @@ static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int sr
case 0x84: conv= rgb16tobgr32; break;
case 0x86: conv= rgb24tobgr32; break;
case 0x88: conv= rgb32tobgr32; break;
default: av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
default: av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
}
}else{
av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
av_log(c, AV_LOG_ERROR, "swScaler: internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat));
}
......@@ -1625,7 +1625,7 @@ static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int sr
srcPtr+= srcStride[0];
dstPtr+= dstStride[0];
}
}
}
return srcSliceH;
}
......@@ -1633,11 +1633,11 @@ static int bgr24toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], in
int srcSliceH, uint8_t* dst[], int dstStride[]){
rgb24toyv12(
src[0],
dst[0]+ srcSliceY *dstStride[0],
dst[1]+(srcSliceY>>1)*dstStride[1],
src[0],
dst[0]+ srcSliceY *dstStride[0],
dst[1]+(srcSliceY>>1)*dstStride[1],
dst[2]+(srcSliceY>>1)*dstStride[2],
c->srcW, srcSliceH,
c->srcW, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
......@@ -1647,7 +1647,7 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int
int i;
/* copy Y */
if(srcStride[0]==dstStride[0] && srcStride[0] > 0)
if(srcStride[0]==dstStride[0] && srcStride[0] > 0)
memcpy(dst[0]+ srcSliceY*dstStride[0], src[0], srcStride[0]*srcSliceH);
else{
uint8_t *srcPtr= src[0];
......@@ -1687,7 +1687,7 @@ static int simpleCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
int length=0;
/* universal length finder */
while(length+c->srcW <= FFABS(dstStride[0])
while(length+c->srcW <= FFABS(dstStride[0])
&& length+c->srcW <= FFABS(srcStride[0])) length+= c->srcW;
ASSERT(length!=0);
......@@ -1699,7 +1699,7 @@ static int simpleCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
}
}
}
else
else
{ /* Planar YUV or gray */
int plane;
for(plane=0; plane<3; plane++)
......@@ -1904,7 +1904,7 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange
#ifdef COMPILE_ALTIVEC
if (c->flags & SWS_CPU_CAPS_ALTIVEC)
yuv2rgb_altivec_init_tables (c, inv_table, brightness, contrast, saturation);
#endif
#endif
return 0;
}
......@@ -1921,8 +1921,8 @@ int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int
*brightness= c->brightness;
*contrast = c->contrast;
*saturation= c->saturation;
return 0;
return 0;
}
static int handle_jpeg(int *format)
......@@ -1972,14 +1972,14 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
if(rgb15to16 == NULL) sws_rgb2rgb_init(flags);
unscaled = (srcW == dstW && srcH == dstH);
needsDither= (isBGR(dstFormat) || isRGB(dstFormat))
needsDither= (isBGR(dstFormat) || isRGB(dstFormat))
&& (fmt_depth(dstFormat))<24
&& ((fmt_depth(dstFormat))<(fmt_depth(srcFormat)) || (!(isRGB(srcFormat) || isBGR(srcFormat))));
srcRange = handle_jpeg(&srcFormat);
dstRange = handle_jpeg(&dstFormat);
if(!isSupportedIn(srcFormat))
if(!isSupportedIn(srcFormat))
{
av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as input format\n", sws_format_name(srcFormat));
return NULL;
......@@ -1993,7 +1993,7 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
/* sanity check */