Example #1
0
int InitH263Decoder()
{
	
/*	if(dlog==NULL)
	{
	trace=0;
	quiet=1;
	verbose=0;
	__android_log_print(ANDROID_LOG_ERROR, "InitH263Decoder()","Unable to open log file: %s", strerror(errno) );
	return -1;
	}*/

   framerate=0;  // not used...
   outtype=0;    // YUV 
	temp_ref = 0;
   prev_temp_ref= -1; 

   ld = &base; 
     
	initbits();    // Setup source buffer pointers
	InitConvertTable();

	myLog.WriteLog((char*)"InitH263Decoder()",(char*)"Init OK");
	return 0;
 	 
	// For debugging....	 
	// trace=1;		// trace output
	// quiet=0;       // don't keep quiet print mesgs
	 
}
Example #2
0
void InitH263Decoder()
{
 
    // Open log file
	dlog=fopen("decoder.log","w");
	
	if(dlog==NULL)
	{
	trace=0;
	quiet=1;
	verbose=0;
	}

     framerate=0;  // not used...
     outtype=0;    // YUV 
	 temp_ref = 0;
     prev_temp_ref= -1; 


     ld = &base; 
     
     initbits();    // Setup source buffer pointers
	 InitConvertTable();
     
 	 
	// For debugging....	 
	// trace=1;		// trace output
	// quiet=0;       // don't keep quiet print mesgs
	 
}
Example #3
0
//  Convert from YUV to RGB24
void ConvertYUV2RGB(unsigned char *src,unsigned char *dst,
                    int width,int height)
{
    unsigned char *puv = src + width*height;

    int y1,y2,u,v;
    unsigned char *py1,*py2;
    int i,j, c1, c2, c3, c4;
    unsigned char *d1, *d2;

    {
        static int flag = 0;
        if (flag == 0) {
            flag = 1;
            InitConvertTable();
        }
    }

    py1=src;
    py2=py1+width;
    d1=dst;
    d2=d1+3*width;
    for (j = 0; j < height; j += 2) {
        for (i = 0; i < width; i += 2) {
            u = *puv++;
            v = *puv++;

            c1 = crv_tab[v];
            c2 = cgu_tab[u];
            c3 = cgv_tab[v];
            c4 = cbu_tab[u];
//up-left
            y1 = tab_76309[*py1++];
            *d1++ = clp[384+((y1 + c1)>>16)];
            *d1++ = clp[384+((y1 - c2 - c3)>>16)];
            *d1++ = clp[384+((y1 + c4)>>16)];
//down-left
            y2 = tab_76309[*py2++];
            *d2++ = clp[384+((y2 + c1)>>16)];
            *d2++ = clp[384+((y2 - c2 - c3)>>16)];
            *d2++ = clp[384+((y2 + c4)>>16)];
//up-right
            y1 = tab_76309[*py1++];
            *d1++ = clp[384+((y1 + c1)>>16)];
            *d1++ = clp[384+((y1 - c2 - c3)>>16)];
            *d1++ = clp[384+((y1 + c4)>>16)];
//down-right
            y2 = tab_76309[*py2++];
            *d2++ = clp[384+((y2 + c1)>>16)];
            *d2++ = clp[384+((y2 - c2 - c3)>>16)];
            *d2++ = clp[384+((y2 + c4)>>16)];
        }
        d1 += 3*width;
        d2 += 3*width;
        py1+=   width;
        py2+=   width;
    }
}
Example #4
0
CConvertRgbYuv::CConvertRgbYuv(void)
{
	InitLookupTable();
	InitConvertTable();
}