From aaf852d6d6abcc8a9073dae5b9b3b60605f9563b Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 26 Feb 2002 22:53:58 +0000 Subject: yuv2rgb optimizations and downscaling support by Scott Smith CVS patchset: 1523 CVS date: 2002/02/26 22:53:58 --- src/video_out/yuv2rgb_mmx.c | 146 ++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 66 deletions(-) (limited to 'src/video_out/yuv2rgb_mmx.c') diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c index 853b3a82a..0686cc2d1 100644 --- a/src/video_out/yuv2rgb_mmx.c +++ b/src/video_out/yuv2rgb_mmx.c @@ -428,7 +428,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 (height = 0;; height++) { + for (height = 0;; ) { y_buf = this->y_buffer; u_buf = this->u_buffer; @@ -460,23 +460,26 @@ static inline void yuv420_rgb16 (yuv2rgb_t *this, if (dst_height <= 0) break; - dy -= 32768; + do { + dy -= 32768; - py += y_stride; + py += y_stride; - scale_line (py, this->y_buffer, - this->dest_width, this->step_dx); + scale_line (py, this->y_buffer, + this->dest_width, this->step_dx); - if (height & 1) { - pu += uv_stride; - pv += uv_stride; + if (height & 1) { + pu += uv_stride; + pv += uv_stride; - scale_line (pu, this->u_buffer, - this->dest_width >> 1, this->step_dx); - scale_line (pv, this->v_buffer, - this->dest_width >> 1, this->step_dx); + scale_line (pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); - } + } + height++; + } while( dy>=32768); } } } @@ -536,7 +539,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 (height = 0;; height++) { + for (height = 0;; ) { y_buf = this->y_buffer; u_buf = this->u_buffer; @@ -568,22 +571,25 @@ static inline void yuv420_rgb15 (yuv2rgb_t *this, if (dst_height <= 0) break; - dy -= 32768; - py += y_stride; + do { + dy -= 32768; + py += y_stride; - scale_line (py, this->y_buffer, - this->dest_width, this->step_dx); + scale_line (py, this->y_buffer, + this->dest_width, this->step_dx); - if (height & 1) { - pu += uv_stride; - pv += uv_stride; + if (height & 1) { + pu += uv_stride; + pv += uv_stride; - scale_line (pu, this->u_buffer, - this->dest_width >> 1, this->step_dx); - scale_line (pv, this->v_buffer, - this->dest_width >> 1, this->step_dx); + scale_line (pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); - } + } + height++; + } while( dy>=32768 ); } } } @@ -642,7 +648,7 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this, scale_line (py, this->y_buffer, this->dest_width, this->step_dx); - for (height = 0;; height++) { + for (height = 0;; ) { y_buf = this->y_buffer; u_buf = this->u_buffer; @@ -675,21 +681,24 @@ static inline void yuv420_rgb24 (yuv2rgb_t *this, if (dst_height <= 0) break; - dy -= 32768; - py += y_stride; + do { + dy -= 32768; + py += y_stride; - scale_line (py, this->y_buffer, - this->dest_width, this->step_dx); + scale_line (py, this->y_buffer, + this->dest_width, this->step_dx); - if (height & 1) { - pu += uv_stride; - pv += uv_stride; + if (height & 1) { + pu += uv_stride; + pv += uv_stride; - scale_line (pu, this->u_buffer, - this->dest_width >> 1, this->step_dx); - scale_line (pv, this->v_buffer, - this->dest_width >> 1, this->step_dx); - } + scale_line (pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); + } + height++; + } while( dy>=32768 ); } @@ -750,7 +759,7 @@ static inline void yuv420_argb32 (yuv2rgb_t *this, scale_line (py, this->y_buffer, this->dest_width, this->step_dx); - for (height = 0;; height++) { + for (height = 0;; ) { y_buf = this->y_buffer; u_buf = this->u_buffer; @@ -783,22 +792,24 @@ static inline void yuv420_argb32 (yuv2rgb_t *this, if (dst_height <= 0) break; - dy -= 32768; - py += y_stride; + do { + dy -= 32768; + py += y_stride; - scale_line (py, this->y_buffer, - this->dest_width, this->step_dx); + scale_line (py, this->y_buffer, + this->dest_width, this->step_dx); - if (height & 1) { - pu += uv_stride; - pv += uv_stride; + if (height & 1) { + pu += uv_stride; + pv += uv_stride; - scale_line (pu, this->u_buffer, - this->dest_width >> 1, this->step_dx); - scale_line (pv, this->v_buffer, - this->dest_width >> 1, this->step_dx); - } - + scale_line (pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); + } + height++; + } while( dy>=32768 ); } } @@ -858,7 +869,7 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this, scale_line (py, this->y_buffer, this->dest_width, this->step_dx); - for (height = 0;; height++) { + for (height = 0;; ) { y_buf = this->y_buffer; u_buf = this->u_buffer; @@ -891,21 +902,24 @@ static inline void yuv420_abgr32 (yuv2rgb_t *this, if (dst_height <= 0) break; - dy -= 32768; - py += y_stride; + do { + dy -= 32768; + py += y_stride; - scale_line (py, this->y_buffer, - this->dest_width, this->step_dx); + scale_line (py, this->y_buffer, + this->dest_width, this->step_dx); - if (height & 1) { - pu += uv_stride; - pv += uv_stride; + if (height & 1) { + pu += uv_stride; + pv += uv_stride; - scale_line (pu, this->u_buffer, - this->dest_width >> 1, this->step_dx); - scale_line (pv, this->v_buffer, - this->dest_width >> 1, this->step_dx); - } + scale_line (pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); + } + height++; + } while( dy>=32768 ); } -- cgit v1.2.3