changeset 9392:7bbe4bce6293

cleanup (unsigned stride -> int stride)
author michael
date Tue, 11 Feb 2003 12:57:53 +0000
parents 7c211b317e49
children 5f9c97070b56
files postproc/rgb2rgb.c postproc/rgb2rgb.h postproc/rgb2rgb_template.c postproc/yuv2rgb_mlib.c postproc/yuv2rgb_template.c
diffstat 5 files changed, 47 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/rgb2rgb.c	Tue Feb 11 12:07:52 2003 +0000
+++ b/postproc/rgb2rgb.c	Tue Feb 11 12:57:53 2003 +0000
@@ -716,7 +716,7 @@
  */
 void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+	int lumStride, int chromStride, int dstStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -737,7 +737,7 @@
  */
 void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+	int lumStride, int chromStride, int dstStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -759,7 +759,7 @@
  */
 void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -782,7 +782,7 @@
  */
 void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -802,7 +802,7 @@
 void yvu9toyv12(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
 	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride)
+	int lumStride, int chromStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -840,7 +840,7 @@
  */
 void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -856,8 +856,8 @@
 }
 
 void interleaveBytes(uint8_t *src1, uint8_t *src2, uint8_t *dst,
-		     unsigned width, unsigned height, unsigned src1Stride,
-		     unsigned src2Stride, unsigned dstStride)
+		     unsigned width, unsigned height, int src1Stride,
+		     int src2Stride, int dstStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	// ordered per speed fasterst first
@@ -875,8 +875,8 @@
 void vu9_to_vu12(const uint8_t *src1, const uint8_t *src2,
 		uint8_t *dst1, uint8_t *dst2,
 		unsigned width, unsigned height,
-		unsigned srcStride1, unsigned srcStride2,
-		unsigned dstStride1, unsigned dstStride2)
+		int srcStride1, int srcStride2,
+		int dstStride1, int dstStride2)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	if(gCpuCaps.hasMMX2)
@@ -893,8 +893,8 @@
 void yvu9_to_yuy2(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
 		uint8_t *dst,
 		unsigned width, unsigned height,
-		unsigned srcStride1, unsigned srcStride2,
-		unsigned srcStride3, unsigned dstStride)
+		int srcStride1, int srcStride2,
+		int srcStride3, int dstStride)
 {
 #ifdef CAN_COMPILE_X86_ASM
 	if(gCpuCaps.hasMMX2)
--- a/postproc/rgb2rgb.h	Tue Feb 11 12:07:52 2003 +0000
+++ b/postproc/rgb2rgb.h	Tue Feb 11 12:57:53 2003 +0000
@@ -52,33 +52,33 @@
 
 extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
+	int lumStride, int chromStride, int dstStride);
 extern void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
+	int lumStride, int chromStride, int dstStride);
 extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
+	int lumStride, int chromStride, int srcStride);
 extern void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
+	int lumStride, int chromStride, int srcStride);
 extern void planar2x(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride);
 
 extern void interleaveBytes(uint8_t *src1, uint8_t *src2, uint8_t *dst,
-			    unsigned width, unsigned height, unsigned src1Stride,
-			    unsigned src2Stride, unsigned dstStride);
+			    unsigned width, unsigned height, int src1Stride,
+			    int src2Stride, int dstStride);
 
 extern void vu9_to_vu12(const uint8_t *src1, const uint8_t *src2,
 			uint8_t *dst1, uint8_t *dst2,
 			unsigned width, unsigned height,
-			unsigned srcStride1, unsigned srcStride2,
-			unsigned dstStride1, unsigned dstStride2);
+			int srcStride1, int srcStride2,
+			int dstStride1, int dstStride2);
 
 extern void yvu9_to_yuy2(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
 			uint8_t *dst,
 			unsigned width, unsigned height,
-			unsigned srcStride1, unsigned srcStride2,
-			unsigned srcStride3, unsigned dstStride);
+			int srcStride1, int srcStride2,
+			int srcStride3, int dstStride);
 	
 
 #define MODE_RGB  0x1
@@ -87,7 +87,7 @@
 typedef void (* yuv2rgb_fun) (uint8_t * image, uint8_t * py,
 			      uint8_t * pu, uint8_t * pv,
 			      unsigned h_size, unsigned v_size,
-			      unsigned rgb_stride, unsigned y_stride, unsigned uv_stride);
+			      int rgb_stride, int y_stride, int uv_stride);
 
 extern yuv2rgb_fun yuv2rgb;
 
--- a/postproc/rgb2rgb_template.c	Tue Feb 11 12:07:52 2003 +0000
+++ b/postproc/rgb2rgb_template.c	Tue Feb 11 12:57:53 2003 +0000
@@ -1371,7 +1371,7 @@
 
 static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride, int vertLumPerChroma)
+	int lumStride, int chromStride, int dstStride, int vertLumPerChroma)
 {
 	unsigned y;
 	const unsigned chromWidth= width>>1;
@@ -1463,7 +1463,7 @@
  */
 static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+	int lumStride, int chromStride, int dstStride)
 {
 	//FIXME interpolate chroma
 	RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
@@ -1475,7 +1475,7 @@
  */
 static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+	int lumStride, int chromStride, int dstStride)
 {
 	RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
 }
@@ -1487,7 +1487,7 @@
  */
 static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 	unsigned y;
 	const unsigned chromWidth= width>>1;
@@ -1607,7 +1607,7 @@
 
 static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
 	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-	unsigned int width, unsigned int height, unsigned int lumStride, unsigned int chromStride)
+	unsigned int width, unsigned int height, int lumStride, int chromStride)
 {
 	/* Y Plane */
 	memcpy(ydst, ysrc, width*height);
@@ -1725,7 +1725,7 @@
  */
 static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 	unsigned y;
 	const unsigned chromWidth= width>>1;
@@ -1851,7 +1851,7 @@
  */
 static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
+	int lumStride, int chromStride, int srcStride)
 {
 	unsigned y;
 	const unsigned chromWidth= width>>1;
@@ -2147,8 +2147,8 @@
 }
 
 void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
-			    unsigned width, unsigned height, unsigned src1Stride,
-			    unsigned src2Stride, unsigned dstStride){
+			    unsigned width, unsigned height, int src1Stride,
+			    int src2Stride, int dstStride){
 	unsigned h;
 
 	for(h=0; h < height; h++)
@@ -2230,10 +2230,11 @@
 static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
 			uint8_t *dst1, uint8_t *dst2,
 			unsigned width, unsigned height,
-			unsigned srcStride1, unsigned srcStride2,
-			unsigned dstStride1, unsigned dstStride2)
+			int srcStride1, int srcStride2,
+			int dstStride1, int dstStride2)
 {
-    unsigned y,x,w,h;
+    unsigned int y,x,h;
+    int w;
     w=width/2; h=height/2;
 #ifdef HAVE_MMX
     asm volatile(
@@ -2246,8 +2247,7 @@
 	uint8_t* d=dst1+dstStride1*y;
 	x=0;
 #ifdef HAVE_MMX
-	if(w > 32)
-	for(;x<w;x+=32)
+	for(;x<w-31;x+=32)
 	{
 	    asm volatile(
 		PREFETCH" 32%1\n\t"
@@ -2287,8 +2287,7 @@
 	uint8_t* d=dst2+dstStride2*y;
 	x=0;
 #ifdef HAVE_MMX
-	if(w > 32)
-	for(;x<w;x+=32)
+	for(;x<w-31;x+=32)
 	{
 	    asm volatile(
 		PREFETCH" 32%1\n\t"
@@ -2335,8 +2334,8 @@
 static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
 			uint8_t *dst,
 			unsigned width, unsigned height,
-			unsigned srcStride1, unsigned srcStride2,
-			unsigned srcStride3, unsigned dstStride)
+			int srcStride1, int srcStride2,
+			int srcStride3, int dstStride)
 {
     unsigned y,x,x2,w,h;
     w=width/2; h=height;
--- a/postproc/yuv2rgb_mlib.c	Tue Feb 11 12:07:52 2003 +0000
+++ b/postproc/yuv2rgb_mlib.c	Tue Feb 11 12:57:53 2003 +0000
@@ -30,7 +30,7 @@
 static void mlib_YUV2ARGB420_32(uint8_t* image, uint8_t* py, 
 			 uint8_t* pu, uint8_t* pv, 
 			 unsigned h_size, unsigned v_size, 
-			 unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			 int rgb_stride, int y_stride, int uv_stride)
 {
   mlib_VideoColorYUV2ARGB420(image, py, pu, pv, h_size,
 			     v_size, rgb_stride, y_stride, uv_stride);
@@ -39,7 +39,7 @@
 static void mlib_YUV2ABGR420_32(uint8_t* image, uint8_t* py, 
 			 uint8_t* pu, uint8_t* pv, 
 			 unsigned h_size, unsigned v_size, 
-			 unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			 int rgb_stride, int y_stride, int uv_stride)
 {
   mlib_VideoColorYUV2ABGR420(image, py, pu, pv, h_size,
 			     v_size, rgb_stride, y_stride, uv_stride);
@@ -48,7 +48,7 @@
 static void mlib_YUV2RGB420_24(uint8_t* image, uint8_t* py, 
 			 uint8_t* pu, uint8_t* pv, 
 			 unsigned h_size, unsigned v_size, 
-			 unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			 int rgb_stride, int y_stride, int uv_stride)
 {
   mlib_VideoColorYUV2RGB420(image, py, pu, pv, h_size,
 			    v_size, rgb_stride, y_stride, uv_stride);
--- a/postproc/yuv2rgb_template.c	Tue Feb 11 12:07:52 2003 +0000
+++ b/postproc/yuv2rgb_template.c	Tue Feb 11 12:57:53 2003 +0000
@@ -124,7 +124,7 @@
 static inline void RENAME(yuv420_rgb16) (uint8_t * image, uint8_t * py,
 			      uint8_t * pu, uint8_t * pv,
 			      unsigned h_size, unsigned v_size,
-			      unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			      int rgb_stride, int y_stride, int uv_stride)
 {
     int even = 1;
     int x, y;
@@ -229,7 +229,7 @@
 static inline void RENAME(yuv420_rgb15) (uint8_t * image, uint8_t * py,
 			      uint8_t * pu, uint8_t * pv,
 			      unsigned h_size, unsigned v_size,
-			      unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			      int rgb_stride, int y_stride, int uv_stride)
 {
     int even = 1;
     int x, y;
@@ -330,7 +330,7 @@
 static inline void RENAME(yuv420_rgb24) (uint8_t * image, uint8_t * py,
 			      uint8_t * pu, uint8_t * pv,
 			      unsigned h_size, unsigned v_size,
-			      unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			      int rgb_stride, int y_stride, int uv_stride)
 {
     int even = 1;
     int x, y;
@@ -489,7 +489,7 @@
 static inline void RENAME(yuv420_argb32) (uint8_t * image, uint8_t * py,
 			       uint8_t * pu, uint8_t * pv,
 			       unsigned h_size, unsigned v_size,
-			       unsigned rgb_stride, unsigned y_stride, unsigned uv_stride)
+			       int rgb_stride, int y_stride, int uv_stride)
 {
     int even = 1;
     int x, y;