diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-02-26 22:53:58 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-02-26 22:53:58 +0000 |
commit | aaf852d6d6abcc8a9073dae5b9b3b60605f9563b (patch) | |
tree | 27b4e06a32abde1c36d5fff763e5e5202b2f7a22 /src/video_out/yuv2rgb_mmx.c | |
parent | db68b9d440027401650f790e09cc5886b6927c38 (diff) | |
download | xine-lib-aaf852d6d6abcc8a9073dae5b9b3b60605f9563b.tar.gz xine-lib-aaf852d6d6abcc8a9073dae5b9b3b60605f9563b.tar.bz2 |
yuv2rgb optimizations and downscaling support by Scott Smith <ssmith@akamai.com>
CVS patchset: 1523
CVS date: 2002/02/26 22:53:58
Diffstat (limited to 'src/video_out/yuv2rgb_mmx.c')
-rw-r--r-- | src/video_out/yuv2rgb_mmx.c | 146 |
1 files changed, 80 insertions, 66 deletions
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 ); } |