X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvideo_output%2Fvideo_yuv.c;h=2c3bc260427da5d22119db66316e960844707708;hb=3cbfc06dc36bc0d178793558d52d71348e999106;hp=41c735a4ffe959137025bedf49cc847454592bee;hpb=2ad5fa640d389a2261699c0b657484b436aef23e;p=vlc diff --git a/src/video_output/video_yuv.c b/src/video_output/video_yuv.c index 41c735a4ff..2c3bc26042 100644 --- a/src/video_output/video_yuv.c +++ b/src/video_output/video_yuv.c @@ -1,66 +1,54 @@ /***************************************************************************** * video_yuv.c: YUV transformation functions - * (c)1999 VideoLAN - ***************************************************************************** * Provides functions to perform the YUV conversion. The functions provided here * are a complete and portable C implementation, and may be replaced in certain * case by optimized functions. + ***************************************************************************** + * Copyright (C) 1999, 2000 VideoLAN + * + * Authors: + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include -#include -#include +#include "defs.h" + +#include /* exp(), pow() */ +#include /* ENOMEM */ +#include /* free() */ +#include /* strerror() */ -#include "common.h" #include "config.h" +#include "common.h" +#include "threads.h" #include "mtime.h" -#include "vlc_thread.h" +#include "plugins.h" #include "video.h" #include "video_output.h" #include "video_yuv.h" + #include "intf_msg.h" /***************************************************************************** * Constants *****************************************************************************/ -/* Color masks for different color depths - 8bpp masks can be choosen, since - * colormaps instead of hardware-defined colors are used. */ -//?? remove -#define RED_8BPP_MASK 0xe0 -#define GREEN_8BPP_MASK 0x1c -#define BLUE_8BPP_MASK 0x03 - -#define RED_15BPP_MASK 0xf800 -#define GREEN_15BPP_MASK 0x03e0 -#define BLUE_15BPP_MASK 0x001f - -#define RED_16BPP_MASK 0xf800 -#define GREEN_16BPP_MASK 0x07e0 -#define BLUE_16BPP_MASK 0x001f - -#define RED_24BPP_MASK 0xff0000 -#define GREEN_24BPP_MASK 0x00ff00 -#define BLUE_24BPP_MASK 0x0000ff - -/* RGB/YUV inversion matrix (ISO/IEC 13818-2 section 6.3.6, table 6.9) */ -//?? no more used ? -const int MATRIX_COEFFICIENTS_TABLE[8][4] = -{ - {117504, 138453, 13954, 34903}, /* no sequence_display_extension */ - {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */ - {104597, 132201, 25675, 53279}, /* unspecified */ - {104597, 132201, 25675, 53279}, /* reserved */ - {104448, 132798, 24759, 53109}, /* FCC */ - {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */ - {104597, 132201, 25675, 53279}, /* SMPTE 170M */ - {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ -}; - /* Margins and offsets in conversion tables - Margins are used in case a RGB * RGB conversion would give a value outside the 0-255 range. Offsets have been * calculated to avoid using the same cache line for 2 tables. conversion tables @@ -78,13 +66,15 @@ const int MATRIX_COEFFICIENTS_TABLE[8][4] = #define PALETTE_TABLE_SIZE 2176 /* YUV -> 8bpp palette lookup table */ -//?? +/* macros used for YUV pixel conversions */ #define SHIFT 20 #define U_GREEN_COEF ((int)(-0.391 * (1<> 3 ) - 16; \ - if( x < 0 ) x = 0; \ - if( x > 255 ) x = 255; + #define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 ) int y,u,v; int r,g,b; @@ -641,16 +628,12 @@ static void SetYUV( vout_thread_t *p_vout ) && r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX ) { /* this one should never happen unless someone fscked up my code */ - if(j == 256) { intf_DbgMsg( "sorry, no colors left\n" ); exit( 1 ); } + if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette\n" ); break; } - /* saturate the colors */ - SATURATE( r ); - SATURATE( g ); - SATURATE( b ); - - red[j] = r << 8; - green[j] = g << 8; - blue[j] = b << 8; + /* clip the colors */ + red[j] = CLIP( r ); + green[j] = CLIP( g ); + blue[j] = CLIP( b ); transp[j] = 0; /* allocate color */ @@ -693,7 +676,7 @@ static void SetYUV( vout_thread_t *p_vout ) i++; continue; } - + /* heavy. yeah. */ for( u2 = 0; u2 <= 256; u2 += 32 ) for( v2 = 0; v2 <= 256; v2 += 32 ) @@ -1031,7 +1014,7 @@ static void ConvertY4Gray24( p_vout_thread_t p_vout, void *p_pic, yuv_data_t *p_ int i_width, int i_height, int i_pic_width, int i_pic_height, int i_pic_line_width, int i_matrix_coefficients ) { - //?? + /* XXX?? */ } /***************************************************************************** @@ -1112,22 +1095,39 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ - int dither10[4] = { 0x0, 0x8, 0x2, 0xa }; - int dither11[4] = { 0xc, 0x4, 0xe, 0x6 }; - int dither12[4] = { 0x3, 0xb, 0x1, 0x9 }; - int dither13[4] = { 0xf, 0x7, 0xd, 0x5 }; - int dither20[4] = { 0x00, 0x10, 0x04, 0x14 }; - int dither21[4] = { 0x18, 0x08, 0x1c, 0x0c }; - int dither22[4] = { 0x06, 0x16, 0x02, 0x12 }; - int dither23[4] = { 0x1e, 0x0e, 0x1a, 0x0a }; - - /* other matrices that can be interesting, either for debugging or for effects */ - //int dither[4][4] = { { 0, 8, 2, 10 }, { 12, 4, 14, 16 }, { 3, 11, 1, 9}, {15, 7, 13, 5} }; - //int dither[4][4] = { { 7, 8, 0, 15 }, { 0, 15, 8, 7 }, { 7, 0, 15, 8 }, { 15, 7, 8, 0 } }; - //int dither[4][4] = { { 0, 15, 0, 15 }, { 15, 0, 15, 0 }, { 0, 15, 0, 15 }, { 15, 0, 15, 0 } }; - //int dither[4][4] = { { 15, 15, 0, 0 }, { 15, 15, 0, 0 }, { 0, 0, 15, 15 }, { 0, 0, 15, 15 } }; - //int dither[4][4] = { { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 } }; - //int dither[4][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } }; +#ifdef NODITHER + int dither10[4] = { 0x7, 0x8, 0x7, 0x8 }; + int dither11[4] = { 0x8, 0x7, 0x8, 0x7 }; + int dither12[4] = { 0x7, 0x8, 0x7, 0x8 }; + int dither13[4] = { 0x8, 0x7, 0x8, 0x7 }; + + int dither20[4] = { 0xf, 0x10, 0xf, 0x10 }; + int dither21[4] = { 0x10, 0xf, 0x10, 0xf }; + int dither22[4] = { 0xf, 0x10, 0xf, 0x10 }; + int dither23[4] = { 0x10, 0xf, 0x10, 0xf }; +#else + int dither10[4] = { 0x0, 0x8, 0x2, 0xa }; + int dither11[4] = { 0xc, 0x4, 0xe, 0x6 }; + int dither12[4] = { 0x3, 0xb, 0x1, 0x9 }; + int dither13[4] = { 0xf, 0x7, 0xd, 0x5 }; + + int dither20[4] = { 0x0, 0x10, 0x4, 0x14 }; + int dither21[4] = { 0x18, 0x8, 0x1c, 0xc }; + int dither22[4] = { 0x6, 0x16, 0x2, 0x12 }; + int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa }; +#endif + + /* some other matrices that can be interesting, either for debugging + * or for effects : + * + * { { 0, 8, 2, 10 }, { 12, 4, 14, 16 }, { 3, 11, 1, 9}, {15, 7, 13, 5} } + * { { 7, 8, 0, 15 }, { 0, 15, 8, 7 }, { 7, 0, 15, 8 }, { 15, 7, 8, 0 } } + * { { 0, 15, 0, 15 }, { 15, 0, 15, 0 }, { 0, 15, 0, 15 }, { 15, 0, 15, 0 } } + * { { 15, 15, 0, 0 }, { 15, 15, 0, 0 }, { 0, 0, 15, 15 }, { 0, 0, 15, 15 } } + * { { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 } } + * { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } } + */ + /* * Initialize some values - i_pic_line_width will store the line skip */ @@ -1285,9 +1285,10 @@ static void ConvertYUV420RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * int i_width, int i_height, int i_pic_width, int i_pic_height, int i_pic_line_width, int i_matrix_coefficients ) { -/* MMX version */ - // int i_chroma_width, i_chroma_skip; /* width and eol for chroma */ -/* +#if 0 + /* MMX version */ + int i_chroma_width, i_chroma_skip; /* width and eol for chroma */ + i_chroma_width = i_width / 2; i_chroma_skip = i_skip / 2; ConvertYUV420RGB16MMX( p_y, p_u, p_v, i_width, i_height, @@ -1295,7 +1296,7 @@ static void ConvertYUV420RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * (i_chroma_width + i_chroma_skip) * sizeof( yuv_data_t), i_scale, (u8 *)p_pic, 0, 0, (i_width + i_pic_eol) * sizeof( u16 ), p_vout->i_screen_depth == 15 ); -*/ +#endif boolean_t b_horizontal_scaling; /* horizontal scaling type */ int i_vertical_scaling; /* vertical scaling type */ int i_x, i_y; /* horizontal and vertical indexes */ @@ -1487,7 +1488,7 @@ static void ConvertYUV420RGB24( p_vout_thread_t p_vout, void *p_pic, yuv_data_t int i_width, int i_height, int i_pic_width, int i_pic_height, int i_pic_line_width, int i_matrix_coefficients ) { - //??? + /* XXX?? */ } /***************************************************************************** @@ -1497,7 +1498,7 @@ static void ConvertYUV422RGB24( p_vout_thread_t p_vout, void *p_pic, yuv_data_t int i_width, int i_height, int i_pic_width, int i_pic_height, int i_pic_line_width, int i_matrix_coefficients ) { - //??? + /* XXX?? */ } /***************************************************************************** @@ -1507,7 +1508,7 @@ static void ConvertYUV444RGB24( p_vout_thread_t p_vout, void *p_pic, yuv_data_t int i_width, int i_height, int i_pic_width, int i_pic_height, int i_pic_line_width, int i_matrix_coefficients ) { - //??? + /* XXX?? */ } /***************************************************************************** @@ -1701,7 +1702,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * } } -//-------------------- walken code follows ------------------------------------ +/*-------------------- walken code follows ----------------------------------*/ /* * YUV to RGB routines. @@ -1727,10 +1728,10 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * */ #if 0 -//?? +/* XXX?? */ static void yuvToRgb24 (unsigned char * Y, - unsigned char * U, unsigned char * V, - char * dest, int table[1935], int width) + unsigned char * U, unsigned char * V, + char * dest, int table[1935], int width) { int i; int u; @@ -1743,145 +1744,145 @@ static void yuvToRgb24 (unsigned char * Y, i = width >> 3; while (i--) { - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; } i = (width & 7) >> 1; while (i--) { - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; } if (width & 1) { - u = *(U++); - v = *(V++); - uvRed = (V_RED_COEF*v) >> SHIFT; - uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; - uvBlue = (U_BLUE_COEF*u) >> SHIFT; - - tableY = table + *(Y++); - tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | - tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + - uvGreen] | - tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); - *(dest++) = tmp24; - *(dest++) = tmp24 >> 8; - *(dest++) = tmp24 >> 16; + u = *(U++); + v = *(V++); + uvRed = (V_RED_COEF*v) >> SHIFT; + uvGreen = (U_GREEN_COEF*u + V_GREEN_COEF*v) >> SHIFT; + uvBlue = (U_BLUE_COEF*u) >> SHIFT; + + tableY = table + *(Y++); + tmp24 = (tableY [1501 - ((V_RED_COEF*128)>>SHIFT) + uvRed] | + tableY [135 - (((U_GREEN_COEF+V_GREEN_COEF)*128)>>SHIFT) + + uvGreen] | + tableY [818 - ((U_BLUE_COEF*128)>>SHIFT) + uvBlue]); + *(dest++) = tmp24; + *(dest++) = tmp24 >> 8; + *(dest++) = tmp24 >> 16; } } #endif