summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_xshm.c7
-rw-r--r--src/video_out/yuv2rgb.c86
-rw-r--r--src/video_out/yuv2rgb_mmx.c45
3 files changed, 70 insertions, 68 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 780a5e972..afcdf393d 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -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: video_out_xshm.c,v 1.34 2001/09/10 15:42:39 jkeil Exp $
+ * $Id: video_out_xshm.c,v 1.35 2001/09/11 17:12:39 jkeil Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -731,10 +731,8 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
int yoffset;
if (this->expecting_event) {
-
this->expecting_event--;
frame->vo_frame.displayed (&frame->vo_frame);
-
} else {
if ( (frame->rgb_width != this->last_frame_rgb_width)
@@ -794,7 +792,7 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
}
XUnlockDisplay (this->display);
-
+
}
}
@@ -1041,7 +1039,6 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
0, NULL);
this->prof_yuv2rgb = profiler_allocate_slot ("xshm yuv2rgb convert");
- printf("xshm, yuv2rgb profiler %d\n", this->prof_yuv2rgb);
this->vo_driver.get_capabilities = xshm_get_capabilities;
this->vo_driver.alloc_frame = xshm_alloc_frame;
diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c
index 9b772c939..b35aaebc4 100644
--- a/src/video_out/yuv2rgb.c
+++ b/src/video_out/yuv2rgb.c
@@ -22,7 +22,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: yuv2rgb.c,v 1.14 2001/09/06 11:57:57 jkeil Exp $
+ * $Id: yuv2rgb.c,v 1.15 2001/09/11 17:12:39 jkeil Exp $
*/
#include "config.h"
@@ -269,7 +269,7 @@ static void yuv2rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst,
uint8_t * py_1, * py_2, * pu, * pv;
uint32_t * r, * g, * b;
uint32_t * dst_1, * dst_2;
- int width, height;
+ int width, height, dst_height;
int dy;
if (this->do_scale) {
@@ -281,9 +281,9 @@ static void yuv2rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst,
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ dst_height = this->dest_height;
- for (;;) {
+ for (height = 0;; height++) {
dst_1 = (uint32_t*)_dst;
py_1 = this->y_buffer;
pu = this->u_buffer;
@@ -313,7 +313,7 @@ static void yuv2rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst,
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*4);
@@ -321,7 +321,7 @@ static void yuv2rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst,
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -330,7 +330,7 @@ static void yuv2rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst,
scale_line (_py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
_pu += this->uv_stride;
_pv += this->uv_stride;
@@ -394,7 +394,7 @@ static void yuv2rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst,
uint8_t * py_1, * py_2, * pu, * pv;
uint8_t * r, * g, * b;
uint8_t * dst_1, * dst_2;
- int width, height;
+ int width, height, dst_height;
int dy;
if (this->do_scale) {
@@ -407,9 +407,9 @@ static void yuv2rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst,
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ dst_height = this->dest_height;
- for (;;) {
+ for (height = 0;; height++) {
dst_1 = _dst;
py_1 = this->y_buffer;
pu = this->u_buffer;
@@ -439,7 +439,7 @@ static void yuv2rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst,
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (_dst, _dst-this->rgb_stride, this->dest_width*3);
@@ -447,7 +447,7 @@ static void yuv2rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst,
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -456,7 +456,7 @@ static void yuv2rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst,
scale_line (_py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
_pu += this->uv_stride;
_pv += this->uv_stride;
@@ -520,7 +520,7 @@ static void yuv2rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst,
uint8_t * py_1, * py_2, * pu, * pv;
uint8_t * r, * g, * b;
uint8_t * dst_1, * dst_2;
- int width, height;
+ int width, height, dst_height;
int dy;
if (this->do_scale) {
@@ -533,9 +533,9 @@ static void yuv2rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst,
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ dst_height = this->dest_height;
- for (;;) {
+ for (height = 0;; height++) {
dst_1 = _dst;
py_1 = this->y_buffer;
pu = this->u_buffer;
@@ -565,7 +565,7 @@ static void yuv2rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst,
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (_dst, _dst-this->rgb_stride, this->dest_width*3);
@@ -573,7 +573,7 @@ static void yuv2rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst,
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -582,7 +582,7 @@ static void yuv2rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst,
scale_line (_py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
_pu += this->uv_stride;
_pv += this->uv_stride;
@@ -647,7 +647,7 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst,
uint8_t * py_1, * py_2, * pu, * pv;
uint16_t * r, * g, * b;
uint16_t * dst_1, * dst_2;
- int width, height;
+ int width, height, dst_height;
int dy;
if (this->do_scale) {
@@ -659,9 +659,9 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst,
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ dst_height = this->dest_height;
- for (;;) {
+ for (height = 0;; height++) {
dst_1 = (uint16_t*)_dst;
py_1 = this->y_buffer;
pu = this->u_buffer;
@@ -691,7 +691,7 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst,
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2);
@@ -699,7 +699,7 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst,
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -708,7 +708,7 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst,
scale_line (_py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
_pu += this->uv_stride;
_pv += this->uv_stride;
@@ -771,7 +771,7 @@ static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst,
uint8_t * py_1, * py_2, * pu, * pv;
uint8_t * r, * g, * b;
uint8_t * dst_1, * dst_2;
- int width, height;
+ int width, height, dst_height;
int dy;
if (this->do_scale) {
@@ -783,9 +783,9 @@ static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst,
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ dst_height = this->dest_height;
- for (;;) {
+ for (height = 0;; height++) {
dst_1 = _dst;
py_1 = this->y_buffer;
pu = this->u_buffer;
@@ -817,7 +817,7 @@ static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst,
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2);
@@ -825,7 +825,7 @@ static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst,
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -834,7 +834,7 @@ static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst,
scale_line (_py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
_pu += this->uv_stride;
_pv += this->uv_stride;
@@ -1086,7 +1086,7 @@ static void yuy22rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ height = this->dest_height;
for (;;) {
dst_1 = (uint32_t*)_dst;
@@ -1119,7 +1119,7 @@ static void yuy22rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*4);
@@ -1127,7 +1127,7 @@ static void yuy22rgb_c_32 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (height <= 0)
break;
dy -= 32768;
@@ -1161,7 +1161,7 @@ static void yuy22rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ height = this->dest_height;
for (;;) {
dst_1 = _dst;
@@ -1193,7 +1193,7 @@ static void yuy22rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*3);
@@ -1201,7 +1201,7 @@ static void yuy22rgb_c_24_rgb (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (height <= 0)
break;
dy -= 32768;
@@ -1235,7 +1235,7 @@ static void yuy22rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ height = this->dest_height;
for (;;) {
dst_1 = _dst;
@@ -1267,7 +1267,7 @@ static void yuy22rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*3);
@@ -1275,7 +1275,7 @@ static void yuy22rgb_c_24_bgr (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (height <= 0)
break;
dy -= 32768;
@@ -1309,7 +1309,7 @@ static void yuy22rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
this->dest_width, this->step_dx);
dy = 0;
- height = this->source_height;
+ height = this->dest_height;
for (;;) {
dst_1 = (uint16_t*)_dst;
@@ -1341,7 +1341,7 @@ static void yuy22rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
dy += this->step_dy;
_dst += this->rgb_stride;
- while (dy < 32768) {
+ while (--height > 0 && dy < 32768) {
memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2);
@@ -1349,7 +1349,7 @@ static void yuy22rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst, uint8_t * _p)
_dst += this->rgb_stride;
}
- if (--height <= 0)
+ if (height <= 0)
break;
dy -= 32768;
diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c
index 76a8588b2..ba5720d5b 100644
--- a/src/video_out/yuv2rgb_mmx.c
+++ b/src/video_out/yuv2rgb_mmx.c
@@ -399,6 +399,7 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this,
int uv_stride = this->uv_stride;
int width = this->source_width;
int height = this->source_height;
+ int dst_height = this->dest_height;
uint8_t *img;
width >>= 3;
@@ -441,7 +442,7 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this,
this->dest_width >> 1, this->step_dx);
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- for (;;) {
+ for (height = 0;; height++) {
y_buf = this->y_buffer;
u_buf = this->u_buffer;
@@ -462,7 +463,7 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this,
dy += this->step_dy;
image += rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, image-rgb_stride, this->dest_width*2);
@@ -470,7 +471,7 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this,
image += rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -480,7 +481,7 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
pu += uv_stride;
pv += uv_stride;
@@ -505,6 +506,7 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this,
int uv_stride = this->uv_stride;
int width = this->source_width;
int height = this->source_height;
+ int dst_height = this->dest_height;
uint8_t *img;
width >>= 3;
@@ -547,7 +549,7 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this,
this->dest_width >> 1, this->step_dx);
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- for (;;) {
+ for (height = 0;; height++) {
y_buf = this->y_buffer;
u_buf = this->u_buffer;
@@ -568,7 +570,7 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this,
dy += this->step_dy;
image += rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, image-rgb_stride, this->dest_width*2);
@@ -576,7 +578,7 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this,
image += rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -585,7 +587,7 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
pu += uv_stride;
pv += uv_stride;
@@ -609,6 +611,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this,
int uv_stride = this->uv_stride;
int width = this->source_width;
int height = this->source_height;
+ int dst_height = this->dest_height;
uint8_t *img;
/* rgb_stride -= 4 * this->dest_width; */
@@ -650,7 +653,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- for (;;) {
+ for (height = 0;; height++) {
y_buf = this->y_buffer;
u_buf = this->u_buffer;
@@ -672,7 +675,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this,
dy += this->step_dy;
image += rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, image-rgb_stride, this->dest_width*3);
@@ -680,7 +683,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this,
image += rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -689,7 +692,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
pu += uv_stride;
pv += uv_stride;
@@ -714,6 +717,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this,
int uv_stride = this->uv_stride;
int width = this->source_width;
int height = this->source_height;
+ int dst_height = this->dest_height;
uint8_t *img;
/* rgb_stride -= 4 * this->dest_width; */
@@ -755,7 +759,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- for (;;) {
+ for (height = 0;; height++) {
y_buf = this->y_buffer;
u_buf = this->u_buffer;
@@ -777,7 +781,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this,
dy += this->step_dy;
image += rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, image-rgb_stride, this->dest_width*4);
@@ -785,7 +789,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this,
image += rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -794,7 +798,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
pu += uv_stride;
pv += uv_stride;
@@ -819,6 +823,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this,
int uv_stride = this->uv_stride;
int width = this->source_width;
int height = this->source_height;
+ int dst_height = this->dest_height;
uint8_t *img;
/* rgb_stride -= 4 * this->dest_width; */
@@ -860,7 +865,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- for (;;) {
+ for (height = 0;; height++) {
y_buf = this->y_buffer;
u_buf = this->u_buffer;
@@ -882,7 +887,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this,
dy += this->step_dy;
image += rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, image-rgb_stride, this->dest_width*4);
@@ -890,7 +895,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this,
image += rgb_stride;
}
- if (--height <= 0)
+ if (dst_height <= 0)
break;
dy -= 32768;
@@ -899,7 +904,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this,
scale_line (py, this->y_buffer,
this->dest_width, this->step_dx);
- if (!(height & 1)) {
+ if (height & 1) {
pu += uv_stride;
pv += uv_stride;