Beispiel #1
0
/* This is very near from the yuv2rgb_32 code */
static void qc_mjpeg_yuv2rgb_24rgb(struct qc_mjpeg_data *md, u8 *py_1, u8 *py_2, u8 *pu, u8 *pv, 
	void *_dst_1, void *_dst_2, int width)
{
	int U, V, Y;
	u8 *r, *g, *b;
	u8 *dst_1, *dst_2;
	if (qcdebug&QC_DEBUGLOGIC) PDEBUG("qc_mjpeg_yuv2rgb_24rgb(md=%p, py_1=%p, py_2=%p, pu=%p, pv=%p, _dst_1=%p, _dst_2=%p, width=%i",md,py_1,py_2,pu,pv,_dst_1,_dst_2,width);

	width >>= 3;
	dst_1 = _dst_1;
	dst_2 = _dst_2;

	do {
		RGB(0);
		DST1RGB(0);
		DST2RGB(0);

		RGB(1);
		DST2RGB(1);
		DST1RGB(1);

		RGB(2);
		DST1RGB(2);
		DST2RGB(2);

		RGB(3);
		DST2RGB(3);
		DST1RGB(3);

		pu += 4;
		pv += 4;
		py_1 += 8;
		py_2 += 8;
		dst_1 += 24;
		dst_2 += 24;
	} while (--width);
	if (qcdebug&QC_DEBUGLOGIC) PDEBUG("qc_mjpeg_yuv2rgb_24rgb() done");
}
Beispiel #2
0
void yuv2rgb (guchar *_pyuv,
	      guchar * _dst, gint width, gint height) {

  guchar *_py, *_pu, *_pv;
  gint    U, V, Y;
  guchar *py_1, *py_2, *pu, *pv;
  guchar *r, *g, *b;
  guchar *dst_1, *dst_2;
  gint    rgb_stride, y_stride, uv_stride;
  gint    source_width, source_height;

  _py = _pyuv;
  _pv = _pyuv + width*height;
  _pu = _pyuv + width*height*5/4;

  source_width = width;
  source_height = height;

  height = source_height >> 1;
  rgb_stride = width*3;
  y_stride   = width;
  uv_stride  = width/2;
  do {
    dst_1 = _dst;
    dst_2 = (void*)( (guchar *)_dst + rgb_stride );
    py_1  = _py;
    py_2  = _py + y_stride;
    pu    = _pu;
    pv    = _pv;
    
    width = source_width >> 3;
    do {
      RGB(0);
      DST1RGB(0);
      DST2RGB(0);
      
      RGB(1);
      DST2RGB(1);
      DST1RGB(1);
      
      RGB(2);
      DST1RGB(2);
      DST2RGB(2);
      
      RGB(3);
      DST2RGB(3);
      DST1RGB(3);
      
      pu += 4;
      pv += 4;
      py_1 += 8;
      py_2 += 8;
      dst_1 += 24;
      dst_2 += 24;
    } while (--width);
    
    _dst += 2 * rgb_stride; 
    _py += 2 * y_stride;
    _pu += uv_stride;
    _pv += uv_stride;
    
  } while (--height);
  
}