memcpy (dstpY, srcpY, _info.height * _info.width);
uint8_t vidCNR2::getFrameNumberNoAlloc (uint32_t frame,				uint32_t * len,				ADMImage * data, uint32_t * flags){  ADMImage *cur, *mprev, *src;  if (frame >= _info.nb_frames)    return 0;  cur = vidCache->getImage (frame);  src = cur;  if (!frame)    {      data->duplicate (cur);      vidCache->unlockAll ();      return 1;    }  const unsigned char *srcpY = YPLANE (src);	//src->GetReadPtr(PLANAR_Y);  const unsigned char *srcpU = UPLANE (src);	//src->GetReadPtr(PLANAR_U);  const unsigned char *srcpV = VPLANE (src);	//src->GetReadPtr(PLANAR_V);  const unsigned char *srcp;  int src_pitchY = _info.width;	//src->GetPitch(PLANAR_Y);  int src_pitchUV = _info.width >> 1;	//src->GetPitch(PLANAR_V);  int heightY = _info.height;	//src->GetHeight(PLANAR_Y);  int heightUV = _info.height >> 1;	//src->GetHeight(PLANAR_V);  int widthY = _info.width ;	//src->GetRowSize(PLANAR_Y);  int widthYd2 = widthY >> 1;  int widthUV = _info.width >> 1;	//src->GetRowSize(PLANAR_V);  downSampleYV12 (cy, src);  mprev = vidCache->getImage (frame - 1);  _uncompressed->duplicate(mprev); // not optimal  if (keepTrack != frame)    {      keepTrack = frame;      downSampleYV12 (py, mprev);    }  unsigned char *dstpY = YPLANE (data);	//dst->GetWritePtr(PLANAR_Y);  unsigned char *dstpU = UPLANE (data);	//dst->GetWritePtr(PLANAR_U);  unsigned char *dstpV = VPLANE (data);	//dst->GetWritePtr(PLANAR_V);  unsigned char *dstp, *prevy, *prevp, *curry, *t, *swap;  int dst_pitchY = _info.width;	//dst->GetPitch(PLANAR_Y);  int dst_pitchUV = _info.width >> 1;	//dst->GetPitch(PLANAR_V);  int y, x, ydiff, uvdiff, cr;  unsigned int difft = 0;  const int off = 256;  // Dupe luma  memcpy (dstpY, srcpY, _info.height * _info.width);  // U plane (we add the luma plane diff to difft here not on v)  prevy = py;  curry = cy;  t = ut;  srcp = srcpU;  dstp = dstpU;  prevp = UPLANE (_uncompressed);	//prev->GetWritePtr(PLANAR_U);  int prev_pitchUV = _info.width >> 1;	//prev->GetPitch(PLANAR_V);  if (_param->sceneChroma)    {      for (y = 0; y < heightUV; ++y)	{	  for (x = 0; x < widthUV; ++x)	    {	      ydiff = curry[x] - prevy[x];	      uvdiff = srcp[x] - prevp[x];	      difft += abs (uvdiff) + abs (ydiff << 2);	      cr = (lt[ydiff + off] * t[uvdiff + off]);	      dstp[x] = prevp[x] =		(cr * prevp[x] + (65536 - cr) * srcp[x] + 32768) >> 16;	    }	  if (difft > diffmax)	    {	      goto exit;	    }	  srcp += src_pitchUV;	  dstp += dst_pitchUV;	  prevp += prev_pitchUV;	  curry += widthYd2;	  prevy += widthYd2;	}    }  else    {      for (y = 0; y < heightUV; ++y)	{	  for (x = 0; x < widthUV; ++x)	    {	      ydiff = curry[x] - prevy[x];	      uvdiff = srcp[x] - prevp[x];	      difft += abs (ydiff << 2);	      cr = (lt[ydiff + off] * t[uvdiff + off]);	      dstp[x] = prevp[x] =		(cr * prevp[x] + (65536 - cr) * srcp[x] + 32768) >> 16;	    }	  if (difft > diffmax)	    {	      goto exit;	    }	  srcp += src_pitchUV;	  dstp += dst_pitchUV;	  prevp += prev_pitchUV;	  curry += widthYd2;	  prevy += widthYd2;	}    }  // V plane  prevy = py;  curry = cy;  t = vt;  srcp = srcpV;  dstp = dstpV;  prevp = VPLANE (_uncompressed);	//prev->GetWritePtr(PLANAR_V);  if (_param->sceneChroma)    {      for (y = 0; y < heightUV; ++y)	{	  for (x = 0; x < widthUV; ++x)	    {	      ydiff = curry[x] - prevy[x];	      uvdiff = srcp[x] - prevp[x];	      difft += abs (uvdiff);	      cr = (lt[ydiff + off] * t[uvdiff + off]);	      dstp[x] = prevp[x] =		(cr * prevp[x] + (65536 - cr) * srcp[x] + 32768) >> 16;	    }	  if (difft > diffmax)	    {	      goto exit;	    }	  srcp += src_pitchUV;	  dstp += dst_pitchUV;	  prevp += prev_pitchUV;	  curry += widthYd2;	  prevy += widthYd2;	}    }  else    {      for (y = 0; y < heightUV; ++y)	{	  for (x = 0; x < widthUV; ++x)	    {	      ydiff = curry[x] - prevy[x];	      uvdiff = srcp[x] - prevp[x];	      cr = (lt[ydiff + off] * t[uvdiff + off]);	      dstp[x] = prevp[x] =		(cr * prevp[x] + (65536 - cr) * srcp[x] + 32768) >> 16;	    }	  srcp += src_pitchUV;	  dstp += dst_pitchUV;	  prevp += prev_pitchUV;	  curry += widthYd2;	  prevy += widthYd2;	}    }exit:  if (difft > diffmax)    {      data->duplicate (cur);      vidCache->unlockAll ();      return 1;    }  ++keepTrack;  swap = py;  py = cy;  cy = swap;  vidCache->unlockAll ();  return 1;}