diff --git a/src/drivers/Qt/AviRecord.cpp b/src/drivers/Qt/AviRecord.cpp index 2e74df90..b70a8e09 100644 --- a/src/drivers/Qt/AviRecord.cpp +++ b/src/drivers/Qt/AviRecord.cpp @@ -122,19 +122,61 @@ static void convertRgb_32_to_24( const unsigned char *src, unsigned char *dest, //************************************************************************************** /* For RGB2YUV: */ -static const int RGB2YUV_SHIFT = 15; /* highest value where [RGB][YUV] fit in signed short */ +//static const int RGB2YUV_SHIFT = 15; // highest value where [RGB][YUV] fit in signed short -static const int RY = 8414; // ((int)(( 65.738/256.0)*(1<> RGB2YUV_SHIFT); // y + + dest[destpos[n]] = Y; } - dest[upos++] = (U_ADD + ((RU * c[0] + GU * c[1] + BU * c[2]) >> (RGB2YUV_SHIFT+2)) ); - dest[vpos++] = (V_ADD + ((RV * c[0] + GV * c[1] + BV * c[2]) >> (RGB2YUV_SHIFT+2)) ); + U = (U_ADD + ((RU * c[0] + GU * c[1] + BU * c[2]) >> (RGB2YUV_SHIFT+2)) ); + V = (V_ADD + ((RV * c[0] + GV * c[1] + BV * c[2]) >> (RGB2YUV_SHIFT+2)) ); + + //printf("%i,%i = rgb( %i, %i, %i ) = yuv( %i, %i, %i )\n", x,y, + // rgb[0][3], rgb[1][3], rgb[2][3], Y, U, V ); + dest[upos++] = U; + dest[vpos++] = V; } ypos += 2; @@ -212,10 +245,6 @@ void Convert_4byte_To_I420Frame(const void* data, unsigned char* dest, unsigned /*fprintf(stderr, ",yr=%u,ur=%u,vr=%u\n", ypos,upos,vpos);*/ - - //#ifdef __MMX__ - // MMX_clear(); - //#endif } //************************************************************************************** #ifdef _USE_X264