--- colorspace.c 2004/04/12 14:05:08 1.10 +++ colorspace.c 2006/10/29 08:04:02 1.12 @@ -19,7 +19,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: colorspace.c,v 1.10 2004/04/12 14:05:08 edgomez Exp $ + * $Id: colorspace.c,v 1.12 2006/10/29 08:04:02 chl Exp $ * ****************************************************************************/ @@ -38,7 +38,6 @@ packedFuncPtr abgr_to_yv12; packedFuncPtr rgba_to_yv12; packedFuncPtr argb_to_yv12; -packedFuncPtr yuv_to_yv12; packedFuncPtr yuyv_to_yv12; packedFuncPtr uyvy_to_yv12; @@ -60,7 +59,6 @@ packedFuncPtr yv12_to_abgr; packedFuncPtr yv12_to_rgba; packedFuncPtr yv12_to_argb; -packedFuncPtr yv12_to_yuv; packedFuncPtr yv12_to_yuyv; packedFuncPtr yv12_to_uyvy; @@ -77,11 +75,11 @@ planarFuncPtr yv12_to_yv12; -int32_t RGB_Y_tab[256]; -int32_t B_U_tab[256]; -int32_t G_U_tab[256]; -int32_t G_V_tab[256]; -int32_t R_V_tab[256]; +static int32_t RGB_Y_tab[256]; +static int32_t B_U_tab[256]; +static int32_t G_U_tab[256]; +static int32_t G_V_tab[256]; +static int32_t R_V_tab[256]; @@ -489,17 +487,29 @@ y_dst += y_dst_stride; } - for (y = height2; y; y--) { - memcpy(u_dst, u_src, width2); - u_src += uv_src_stride; - u_dst += uv_dst_stride; - } - - for (y = height2; y; y--) { - memcpy(v_dst, v_src, width2); - v_src += uv_src_stride; - v_dst += uv_dst_stride; - } + if (u_src) + for (y = height2; y; y--) { + memcpy(u_dst, u_src, width2); + u_src += uv_src_stride; + u_dst += uv_dst_stride; + } + else + for (y = height2; y; y--) { + memset(u_dst, 0x80, width2); + u_dst += uv_dst_stride; + } + + if (v_src) + for (y = height2; y; y--) { + memcpy(v_dst, v_src, width2); + v_src += uv_src_stride; + v_dst += uv_dst_stride; + } + else + for (y = height2; y; y--) { + memset(v_dst, 0x80, width2); + v_dst += uv_dst_stride; + } }