Commit 101e11f4 authored by diego's avatar diego

comment spelling/grammar fixes


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@25137 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 57a7b841
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
* along with FFmpeg; if not, write to the Free Software * along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* the C code (not assembly, mmx, ...) of this file can be used * The C code (not assembly, mmx, ...) of this file can be used
* under the LGPL license too * under the LGPL license.
*/ */
#include <stddef.h> #include <stddef.h>
#include <inttypes.h> /* for __WORDSIZE */ #include <inttypes.h> /* for __WORDSIZE */
#ifndef __WORDSIZE #ifndef __WORDSIZE
// #warning You have misconfigured system and probably will lose performance! // #warning You have a misconfigured system and will probably lose performance!
#define __WORDSIZE MP_WORDSIZE #define __WORDSIZE MP_WORDSIZE
#endif #endif
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#endif #endif
#ifdef HAVE_3DNOW #ifdef HAVE_3DNOW
/* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */ /* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */
#define EMMS "femms" #define EMMS "femms"
#else #else
#define EMMS "emms" #define EMMS "emms"
...@@ -232,7 +232,7 @@ static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t *dst,long src_si ...@@ -232,7 +232,7 @@ static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t *dst,long src_si
Original by Strepto/Astral Original by Strepto/Astral
ported to gcc & bugfixed : A'rpi ported to gcc & bugfixed : A'rpi
MMX2, 3DNOW optimization by Nick Kurshev MMX2, 3DNOW optimization by Nick Kurshev
32bit c version, and and&add trick by Michael Niedermayer 32 bit C version, and and&add trick by Michael Niedermayer
*/ */
static inline void RENAME(rgb15to16)(const uint8_t *src,uint8_t *dst,long src_size) static inline void RENAME(rgb15to16)(const uint8_t *src,uint8_t *dst,long src_size)
{ {
...@@ -350,7 +350,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_ ...@@ -350,7 +350,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
end = s + src_size; end = s + src_size;
#ifdef HAVE_MMX #ifdef HAVE_MMX
mm_end = end - 15; mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonable fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster) #if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
asm volatile( asm volatile(
"movq %3, %%mm5 \n\t" "movq %3, %%mm5 \n\t"
"movq %4, %%mm6 \n\t" "movq %4, %%mm6 \n\t"
...@@ -509,7 +509,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_ ...@@ -509,7 +509,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
end = s + src_size; end = s + src_size;
#ifdef HAVE_MMX #ifdef HAVE_MMX
mm_end = end - 15; mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonable fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster) #if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
asm volatile( asm volatile(
"movq %3, %%mm5 \n\t" "movq %3, %%mm5 \n\t"
"movq %4, %%mm6 \n\t" "movq %4, %%mm6 \n\t"
...@@ -910,12 +910,10 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s ...@@ -910,12 +910,10 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s
} }
/* /*
I use here less accurate approximation by simply I use less accurate approximation here by simply left-shifting the input
left-shifting the input value and filling the low order bits with zeroes. This method improves PNG
value and filling the low order bits with compression but this scheme cannot reproduce white exactly, since it does
zeroes. This method improves png's not generate an all-ones maximum value; the net effect is to darken the
compression but this scheme cannot reproduce white exactly, since it does not
generate an all-ones maximum value; the net effect is to darken the
image slightly. image slightly.
The better method should be "left bit replication": The better method should be "left bit replication":
...@@ -1271,7 +1269,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_ ...@@ -1271,7 +1269,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
#endif #endif
while (s < end) while (s < end)
{ {
#if 0 //slightly slower on athlon #if 0 //slightly slower on Athlon
int bgr= *s++; int bgr= *s++;
*((uint32_t*)d)++ = ((bgr&0x1F)<<3) + ((bgr&0x3E0)<<6) + ((bgr&0x7C00)<<9); *((uint32_t*)d)++ = ((bgr&0x1F)<<3) + ((bgr&0x3E0)<<6) + ((bgr&0x7C00)<<9);
#else #else
...@@ -1507,7 +1505,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u ...@@ -1507,7 +1505,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
for (y=0; y<height; y++) for (y=0; y<height; y++)
{ {
#ifdef HAVE_MMX #ifdef HAVE_MMX
//FIXME handle 2 lines a once (fewer prefetch, reuse some chrom, but very likely limited by mem anyway) //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
asm volatile( asm volatile(
"xor %%"REG_a", %%"REG_a" \n\t" "xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4) ASMALIGN(4)
...@@ -1639,9 +1637,8 @@ asm( EMMS" \n\t" ...@@ -1639,9 +1637,8 @@ asm( EMMS" \n\t"
} }
/** /**
* * Height should be a multiple of 2 and width should be a multiple of 16 (if
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a * this is a problem for anyone then tell me, and I will fix it).
* problem for anyone then tell me, and ill fix it)
*/ */
static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height, long width, long height,
...@@ -1660,7 +1657,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u ...@@ -1660,7 +1657,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
for (y=0; y<height; y++) for (y=0; y<height; y++)
{ {
#ifdef HAVE_MMX #ifdef HAVE_MMX
//FIXME handle 2 lines a once (fewer prefetch, reuse some chrom, but very likely limited by mem anyway) //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
asm volatile( asm volatile(
"xor %%"REG_a", %%"REG_a" \n\t" "xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4) ASMALIGN(4)
...@@ -1695,7 +1692,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u ...@@ -1695,7 +1692,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
: "%"REG_a : "%"REG_a
); );
#else #else
//FIXME adapt the alpha asm code from yv12->yuy2 //FIXME adapt the Alpha ASM code from yv12->yuy2
#if __WORDSIZE >= 64 #if __WORDSIZE >= 64
int i; int i;
...@@ -1746,9 +1743,8 @@ asm( EMMS" \n\t" ...@@ -1746,9 +1743,8 @@ asm( EMMS" \n\t"
} }
/** /**
* * Height should be a multiple of 2 and width should be a multiple of 16 (if
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a * this is a problem for anyone then tell me, and I will fix it).
* problem for anyone then tell me, and ill fix it)
*/ */
static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height, long width, long height,
...@@ -1759,8 +1755,7 @@ static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, ...@@ -1759,8 +1755,7 @@ static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc,
} }
/** /**
* * Width should be a multiple of 16.
* width should be a multiple of 16
*/ */
static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height, long width, long height,
...@@ -1770,9 +1765,8 @@ static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usr ...@@ -1770,9 +1765,8 @@ static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usr
} }
/** /**
* * Height should be a multiple of 2 and width should be a multiple of 16 (if
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a * this is a problem for anyone then tell me, and I will fix it).
* problem for anyone then tell me, and ill fix it)
*/ */
static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height, long width, long height,
...@@ -2007,10 +2001,10 @@ asm volatile( EMMS" \n\t" ...@@ -2007,10 +2001,10 @@ asm volatile( EMMS" \n\t"
} }
/** /**
* * Height should be a multiple of 2 and width should be a multiple of 16 (if
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a * this is a problem for anyone then tell me, and I will fix it).
* problem for anyone then tell me, and ill fix it) * Chrominance data is only taken from every secound line, others are ignored.
* chrominance data is only taken from every secound line others are ignored FIXME write HQ version * FIXME: Write HQ version.
*/ */
static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height, long width, long height,
...@@ -2133,10 +2127,11 @@ asm volatile( EMMS" \n\t" ...@@ -2133,10 +2127,11 @@ asm volatile( EMMS" \n\t"
} }
/** /**
* * Height should be a multiple of 2 and width should be a multiple of 2 (if
* height should be a multiple of 2 and width should be a multiple of 2 (if this is a * this is a problem for anyone then tell me, and I will fix it).
* problem for anyone then tell me, and ill fix it) * Chrominance data is only taken from every secound line,
* chrominance data is only taken from every secound line others are ignored in the C version FIXME write HQ version * others are ignored in the C version.
* FIXME: Write HQ version.
*/ */
static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height, long width, long height,
......
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