summaryrefslogtreecommitdiff
path: root/src/xine-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-utils')
-rw-r--r--src/xine-utils/color.c17
-rw-r--r--src/xine-utils/xineutils.h4
2 files changed, 15 insertions, 6 deletions
diff --git a/src/xine-utils/color.c b/src/xine-utils/color.c
index 342cb4b95..eb7e0d616 100644
--- a/src/xine-utils/color.c
+++ b/src/xine-utils/color.c
@@ -70,7 +70,7 @@
* instructions), these macros will automatically map to those special
* instructions.
*
- * $Id: color.c,v 1.3 2002/07/15 00:51:17 tmmm Exp $
+ * $Id: color.c,v 1.4 2002/07/15 21:42:34 esnel Exp $
*/
#include "xine_internal.h"
@@ -140,7 +140,7 @@ int v_r_table[256];
int v_g_table[256];
int v_b_table[256];
-void (*yuv444_to_yuy2) (yuv_planes_t *yuv_planes, unsigned char *yuy2_map);
+void (*yuv444_to_yuy2) (yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch);
/*
* init_yuv_planes
@@ -191,7 +191,7 @@ void free_yuv_planes(yuv_planes_t *yuv_planes) {
*
* YUY2 map: Y0 U0 Y1 V1 Y2 U2 Y3 V3
*/
-void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
+void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) {
int row_ptr, pixel_ptr;
int yuy2_index;
@@ -203,6 +203,8 @@ void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
for (pixel_ptr = 0; pixel_ptr < yuv_planes->row_width;
pixel_ptr++, yuy2_index += 2)
yuy2_map[yuy2_index] = yuv_planes->y[row_ptr + pixel_ptr];
+
+ yuy2_index += (pitch - 2*yuv_planes->row_width);
}
/* copy the C samples */
@@ -218,6 +220,8 @@ void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
pixel_ptr++;
yuy2_index += 2;
}
+
+ yuy2_index += (pitch - 2*yuv_planes->row_width);
}
}
@@ -296,7 +300,7 @@ void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
* pad out the line.
*
*/
-void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
+void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) {
#ifdef ARCH_X86
int i, j, k;
unsigned char *source_plane;
@@ -349,6 +353,7 @@ void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
/* account for extra 2 samples */
source_plane += 2;
+ dest_plane += (pitch - 2*yuv_planes->row_width);
}
/* figure out the U samples */
@@ -410,6 +415,8 @@ void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
}
} else
source_plane += 2;
+
+ dest_plane += (pitch - 2*yuv_planes->row_width);
}
/* figure out the V samples */
@@ -470,6 +477,8 @@ void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map) {
}
} else
source_plane += 2;
+
+ dest_plane += (pitch - 2*yuv_planes->row_width);
}
/* be a good MMX citizen and empty MMX state */
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 985961a88..cb3a8139b 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xineutils.h,v 1.17 2002/07/15 00:51:17 tmmm Exp $
+ * $Id: xineutils.h,v 1.18 2002/07/15 21:42:34 esnel Exp $
*
*/
#ifndef XINEUTILS_H
@@ -738,7 +738,7 @@ void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height);
void free_yuv_planes(yuv_planes_t *yuv_planes);
extern void (*yuv444_to_yuy2)
- (yuv_planes_t *yuv_planes, unsigned char *yuy2_map);
+ (yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch);
#define SCALEFACTOR 65536
#define CENTERSAMPLE 128