mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
Originally committed as revision 23158 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
1da87823db
commit
6e42e6c4b4
@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* rgb2rgb.c, Software RGB to RGB convertor
|
||||
* pluralize by Software PAL8 to RGB convertor
|
||||
* Software YUV to YUV convertor
|
||||
@ -98,9 +97,9 @@ static const uint64_t mask32b attribute_used __attribute__((aligned(8))) = 0x00
|
||||
static const uint64_t mask32g attribute_used __attribute__((aligned(8))) = 0x0000FF000000FF00ULL;
|
||||
static const uint64_t mask32r attribute_used __attribute__((aligned(8))) = 0x00FF000000FF0000ULL;
|
||||
static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL;
|
||||
static const uint64_t mask3216br __attribute__((aligned(8)))=0x00F800F800F800F8ULL;
|
||||
static const uint64_t mask3216g __attribute__((aligned(8)))=0x0000FC000000FC00ULL;
|
||||
static const uint64_t mask3215g __attribute__((aligned(8)))=0x0000F8000000F800ULL;
|
||||
static const uint64_t mask3216br __attribute__((aligned(8))) = 0x00F800F800F800F8ULL;
|
||||
static const uint64_t mask3216g __attribute__((aligned(8))) = 0x0000FC000000FC00ULL;
|
||||
static const uint64_t mask3215g __attribute__((aligned(8))) = 0x0000F8000000F800ULL;
|
||||
static const uint64_t mul3216 __attribute__((aligned(8))) = 0x2000000420000004ULL;
|
||||
static const uint64_t mul3215 __attribute__((aligned(8))) = 0x2000000820000008ULL;
|
||||
static const uint64_t mask24b attribute_used __attribute__((aligned(8))) = 0x00FF0000FF0000FFULL;
|
||||
@ -120,10 +119,10 @@ static const uint64_t mask15r __attribute__((aligned(8))) = 0x7C007C007C007C00U
|
||||
static const uint64_t mask16g __attribute__((aligned(8))) = 0x07E007E007E007E0ULL;
|
||||
static const uint64_t mask16r __attribute__((aligned(8))) = 0xF800F800F800F800ULL;
|
||||
static const uint64_t red_16mask __attribute__((aligned(8))) = 0x0000f8000000f800ULL;
|
||||
static const uint64_t green_16mask __attribute__((aligned(8)))= 0x000007e0000007e0ULL;
|
||||
static const uint64_t green_16mask __attribute__((aligned(8))) = 0x000007e0000007e0ULL;
|
||||
static const uint64_t blue_16mask __attribute__((aligned(8))) = 0x0000001f0000001fULL;
|
||||
static const uint64_t red_15mask __attribute__((aligned(8))) = 0x00007c0000007c00ULL;
|
||||
static const uint64_t green_15mask __attribute__((aligned(8)))= 0x000003e0000003e0ULL;
|
||||
static const uint64_t green_15mask __attribute__((aligned(8))) = 0x000003e0000003e0ULL;
|
||||
static const uint64_t blue_15mask __attribute__((aligned(8))) = 0x0000001f0000001fULL;
|
||||
|
||||
#ifdef FAST_BGR2YV12
|
||||
@ -136,7 +135,7 @@ static const uint64_t bgr2UCoeff attribute_used __attribute__((aligned(8))) = 0
|
||||
static const uint64_t bgr2VCoeff attribute_used __attribute__((aligned(8))) = 0x00003831D0E6F6EAULL;
|
||||
#endif
|
||||
static const uint64_t bgr2YOffset attribute_used __attribute__((aligned(8))) = 0x1010101010101010ULL;
|
||||
static const uint64_t bgr2UVOffset attribute_used __attribute__((aligned(8)))= 0x8080808080808080ULL;
|
||||
static const uint64_t bgr2UVOffset attribute_used __attribute__((aligned(8))) = 0x8080808080808080ULL;
|
||||
static const uint64_t w1111 attribute_used __attribute__((aligned(8))) = 0x0001000100010001ULL;
|
||||
|
||||
#if 0
|
||||
@ -215,11 +214,11 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={
|
||||
|
||||
void sws_rgb2rgb_init(int flags){
|
||||
#if (defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX)) && defined(CONFIG_GPL)
|
||||
if(flags & SWS_CPU_CAPS_MMX2)
|
||||
if (flags & SWS_CPU_CAPS_MMX2)
|
||||
rgb2rgb_init_MMX2();
|
||||
else if(flags & SWS_CPU_CAPS_3DNOW)
|
||||
else if (flags & SWS_CPU_CAPS_3DNOW)
|
||||
rgb2rgb_init_3DNOW();
|
||||
else if(flags & SWS_CPU_CAPS_MMX)
|
||||
else if (flags & SWS_CPU_CAPS_MMX)
|
||||
rgb2rgb_init_MMX();
|
||||
else
|
||||
#endif /* defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX) */
|
||||
@ -234,11 +233,11 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
long i;
|
||||
|
||||
/*
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ];
|
||||
*/
|
||||
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
dst[3]= palette[ src[i]*4+2 ];
|
||||
@ -258,7 +257,7 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
|
||||
{
|
||||
long i;
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
dst[3]= palette[ src[i]*4+0 ];
|
||||
@ -284,10 +283,10 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
long i;
|
||||
/*
|
||||
writes 1 byte o much and might cause alignment issues on some architectures?
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ];
|
||||
*/
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
//FIXME slow?
|
||||
dst[0]= palette[ src[i]*4+2 ];
|
||||
@ -302,10 +301,10 @@ void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
long i;
|
||||
/*
|
||||
writes 1 byte o much and might cause alignment issues on some architectures?
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ];
|
||||
*/
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
//FIXME slow?
|
||||
dst[0]= palette[ src[i]*4+0 ];
|
||||
@ -321,13 +320,13 @@ void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
|
||||
{
|
||||
long i;
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((uint16_t *)dst)[i] = ((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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]);
|
||||
}
|
||||
|
||||
@ -337,13 +336,13 @@ void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||
void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
|
||||
{
|
||||
long i;
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((uint16_t *)dst)[i] = ((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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]);
|
||||
}
|
||||
|
||||
@ -351,7 +350,7 @@ void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
{
|
||||
long i;
|
||||
long num_pixels = src_size >> 2;
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* RGB32 (= A,B,G,R) -> BGR24 (= B,G,R) */
|
||||
@ -369,7 +368,7 @@ void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
{
|
||||
long i;
|
||||
for(i=0; 3*i<src_size; i++)
|
||||
for (i=0; 3*i<src_size; i++)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */
|
||||
@ -392,7 +391,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
uint8_t *d = (uint8_t *)dst;
|
||||
const uint16_t *s = (uint16_t *)src;
|
||||
end = s + src_size/2;
|
||||
while(s < end)
|
||||
while (s < end)
|
||||
{
|
||||
register uint16_t bgr;
|
||||
bgr = *s++;
|
||||
@ -416,7 +415,7 @@ void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
uint8_t *d = (uint8_t *)dst;
|
||||
const uint16_t *s = (const uint16_t *)src;
|
||||
end = s + src_size/2;
|
||||
while(s < end)
|
||||
while (s < end)
|
||||
{
|
||||
register uint16_t bgr;
|
||||
bgr = *s++;
|
||||
@ -431,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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
unsigned b,g,r;
|
||||
register uint16_t rgb;
|
||||
@ -448,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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
unsigned b,g,r;
|
||||
register uint16_t rgb;
|
||||
@ -466,7 +465,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
uint8_t *d = (uint8_t *)dst;
|
||||
const uint16_t *s = (const uint16_t *)src;
|
||||
end = s + src_size/2;
|
||||
while(s < end)
|
||||
while (s < end)
|
||||
{
|
||||
register uint16_t bgr;
|
||||
bgr = *s++;
|
||||
@ -490,7 +489,7 @@ void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
uint8_t *d = (uint8_t *)dst;
|
||||
const uint16_t *s = (uint16_t *)src;
|
||||
end = s + src_size/2;
|
||||
while(s < end)
|
||||
while (s < end)
|
||||
{
|
||||
register uint16_t bgr;
|
||||
bgr = *s++;
|
||||
@ -505,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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
unsigned b,g,r;
|
||||
register uint16_t rgb;
|
||||
@ -522,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++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
unsigned b,g,r;
|
||||
register uint16_t rgb;
|
||||
@ -538,7 +537,7 @@ void rgb8tobgr8(const uint8_t *src, uint8_t *dst, long src_size)
|
||||
{
|
||||
long i;
|
||||
long num_pixels = src_size;
|
||||
for(i=0; i<num_pixels; i++)
|
||||
for (i=0; i<num_pixels; i++)
|
||||
{
|
||||
unsigned b,g,r;
|
||||
register uint8_t rgb;
|
||||
|
@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* rgb2rgb.h, Software RGB to RGB convertor
|
||||
* pluralize by Software PAL8 to RGB convertor
|
||||
* Software YUV to YUV convertor
|
||||
@ -30,18 +29,18 @@
|
||||
// Note: do not fix the dependence on stdio.h
|
||||
|
||||
/* A full collection of rgb to rgb(bgr) convertors */
|
||||
extern void (*rgb24to32)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb24to16)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb24to15)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb32to24)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb32to16)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb32to15)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb15to16)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb15to24)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb15to32)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb16to15)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb16to24)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb16to32)(const uint8_t *src,uint8_t *dst,long src_size);
|
||||
extern void (*rgb24to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
@ -59,7 +58,7 @@ extern void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void rgb8tobgr8(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void rgb8tobgr8 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
|
||||
|
||||
extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -219,11 +219,11 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int
|
||||
int __attribute__ ((aligned (16))) tempo[4];
|
||||
|
||||
if (filterSize % 4) {
|
||||
for(i=0; i<dstW; i++) {
|
||||
for (i=0; i<dstW; i++) {
|
||||
register int j;
|
||||
register int srcPos = filterPos[i];
|
||||
register int val = 0;
|
||||
for(j=0; j<filterSize; j++) {
|
||||
for (j=0; j<filterSize; j++) {
|
||||
val += ((int)src[srcPos + j])*filter[filterSize*i + j];
|
||||
}
|
||||
dst[i] = av_clip(val>>7, 0, (1<<15)-1);
|
||||
@ -233,7 +233,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int
|
||||
switch (filterSize) {
|
||||
case 4:
|
||||
{
|
||||
for(i=0; i<dstW; i++) {
|
||||
for (i=0; i<dstW; i++) {
|
||||
register int srcPos = filterPos[i];
|
||||
|
||||
vector unsigned char src_v0 = vec_ld(srcPos, src);
|
||||
@ -272,7 +272,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int
|
||||
|
||||
case 8:
|
||||
{
|
||||
for(i=0; i<dstW; i++) {
|
||||
for (i=0; i<dstW; i++) {
|
||||
register int srcPos = filterPos[i];
|
||||
|
||||
vector unsigned char src_v0 = vec_ld(srcPos, src);
|
||||
@ -299,7 +299,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int
|
||||
|
||||
case 16:
|
||||
{
|
||||
for(i=0; i<dstW; i++) {
|
||||
for (i=0; i<dstW; i++) {
|
||||
register int srcPos = filterPos[i];
|
||||
|
||||
vector unsigned char src_v0 = vec_ld(srcPos, src);
|
||||
@ -328,7 +328,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int
|
||||
|
||||
default:
|
||||
{
|
||||
for(i=0; i<dstW; i++) {
|
||||
for (i=0; i<dstW; i++) {
|
||||
register int j;
|
||||
register int srcPos = filterPos[i];
|
||||
|
||||
@ -406,7 +406,7 @@ static inline int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
const int vertLumPerChroma = 2;
|
||||
register unsigned int y;
|
||||
|
||||
if(width&15){
|
||||
if (width&15) {
|
||||
yv12toyuy2( ysrc, usrc, vsrc, dst,c->srcW,srcSliceH, lumStride, chromStride, dstStride);
|
||||
return srcSliceH;
|
||||
}
|
||||
@ -419,8 +419,7 @@ static inline int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
4) lum&chrom stride are multiple of 8
|
||||
*/
|
||||
|
||||
for(y=0; y<height; y++)
|
||||
{
|
||||
for (y=0; y<height; y++) {
|
||||
int i;
|
||||
for (i = 0; i < width - 31; i+= 32) {
|
||||
const unsigned int j = i >> 1;
|
||||
@ -457,8 +456,7 @@ static inline int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
vec_st(v_yuy2_0, (i << 1), dst);
|
||||
vec_st(v_yuy2_1, (i << 1) + 16, dst);
|
||||
}
|
||||
if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) )
|
||||
{
|
||||
if ( (y&(vertLumPerChroma-1))==(vertLumPerChroma-1) ) {
|
||||
usrc += chromStride;
|
||||
vsrc += chromStride;
|
||||
}
|
||||
@ -485,7 +483,7 @@ static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
const vector unsigned char yperm = vec_lvsl(0, ysrc);
|
||||
register unsigned int y;
|
||||
|
||||
if(width&15){
|
||||
if (width&15) {
|
||||
yv12touyvy( ysrc, usrc, vsrc, dst,c->srcW,srcSliceH, lumStride, chromStride, dstStride);
|
||||
return srcSliceH;
|
||||
}
|
||||
@ -498,8 +496,7 @@ static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
4) lum&chrom stride are multiple of 8
|
||||
*/
|
||||
|
||||
for(y=0; y<height; y++)
|
||||
{
|
||||
for (y=0; y<height; y++) {
|
||||
int i;
|
||||
for (i = 0; i < width - 31; i+= 32) {
|
||||
const unsigned int j = i >> 1;
|
||||
@ -536,8 +533,7 @@ static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int
|
||||
vec_st(v_uyvy_0, (i << 1), dst);
|
||||
vec_st(v_uyvy_1, (i << 1) + 16, dst);
|
||||
}
|
||||
if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) )
|
||||
{
|
||||
if ( (y&(vertLumPerChroma-1))==(vertLumPerChroma-1) ) {
|
||||
usrc += chromStride;
|
||||
vsrc += chromStride;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user