Update of /cvsroot/pure-data/externals/gem2pdp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041
Modified Files: pix_2pdp.cpp Log Message: improved uyvy to yv12 conversion code
Index: pix_2pdp.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/gem2pdp/pix_2pdp.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pix_2pdp.cpp 18 Jun 2005 06:29:30 -0000 1.2 --- pix_2pdp.cpp 11 Oct 2005 02:37:22 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- * * Copyright (c) 2005 Georg Holzmann grh@mur.at + * parts Copyright (c) 2005 James Tittle II tigital@mac.com * */ *************** *** 44,48 **** { t_int psize, px, py; ! short int *pY, *pU, *pV; unsigned char g1,g2,g3,g4; t_int helper; --- 45,49 ---- { t_int psize, px, py; ! short int *pY, *pY2, *pU, *pV; unsigned char g1,g2,g3,g4; t_int helper; *************** *** 57,60 **** --- 58,62 ----
pY = m_data; + pY2 = m_data + gem_xsize; pV = m_data+psize; pU = m_data+psize+(psize>>2); *************** *** 65,68 **** --- 67,72 ---- case GL_RGB: case GL_RGBA: + case GL_BGR: + case GL_BGRA: for ( py=0; py<gem_ysize; py++) { *************** *** 89,114 **** // YUV case GL_YUV422_GEM: ! for ( py=0; py<gem_ysize; py++) ! { ! for ( px=0; px<gem_xsize; px++) ! { ! helper = py*gem_xsize*gem_csize + px*gem_csize; ! g1=gem_image[helper+chU]; // U ! g2=gem_image[helper+chY0]; // Y0 ! g3=gem_image[helper+chV]; // V ! g4=gem_image[helper+chY1]; // Y1 ! ! if(px%2==0) ! *pY = g2 << 7; ! else ! *pY = g4 << 7; ! pY++; ! ! *pU = (g1-128) << 8; ! *pV = (g3-128) << 8; ! if ( (px%2==0) && (py%2==0) ) ! pV++; pU++; ! } ! } pdp_packet_pass_if_valid(m_pdpoutlet, &m_packet0); break; --- 93,121 ---- // YUV case GL_YUV422_GEM: ! int row=gem_ysize>>1; ! int cols=gem_xsize>>1; ! short u,v; ! unsigned char *pixel = gem_image; ! unsigned char *pixel2 = gem_image + gem_xsize * gem_csize; ! while (row--){ ! int col=cols; ! while(col--){ ! u=(pixel[0]-128)<<8; v=(pixel[2]-128)<<8; ! *pU = u; ! *pY++ = (pixel[1])<<7; ! *pV = v; ! *pY++ = (pixel[3])<<7; ! *pU = u; ! *pY2++ = (pixel2[1])<<7; ! *pV = v; ! *pY2++ = (pixel2[3])<<7; ! pixel+=4; ! pixel2+=4; ! pU++; pV++; ! } ! pixel += gem_xsize * gem_csize; ! pixel2 += gem_xsize * gem_csize; ! pY += gem_xsize; pY2 += gem_xsize; ! } pdp_packet_pass_if_valid(m_pdpoutlet, &m_packet0); break; *************** *** 140,144 **** void pix_2pdp::obj_setupCallback(t_class *classPtr) { ! post( "pix_2pdp : a bridge between a Gem pix and PDP/PiDiP, Georg Holzmann 2005 grh@mur.at" ); class_addmethod(classPtr, (t_method)&pix_2pdp::bangMessCallback, gensym("bang"), A_NULL); --- 147,151 ---- void pix_2pdp::obj_setupCallback(t_class *classPtr) { ! post( "pix_2pdp : a bridge between a Gem pix and PDP/PiDiP, Georg Holzmann 2005 grh@mur.at & tigital 2005 tigital@mac.com" ); class_addmethod(classPtr, (t_method)&pix_2pdp::bangMessCallback, gensym("bang"), A_NULL);