blockb = b[0];
*out = cls.capturevideo.yuvnormalizetable[0][cls.capturevideo.rgbtoyuvscaletable[0][0][blockr] + cls.capturevideo.rgbtoyuvscaletable[0][1][blockg] + cls.capturevideo.rgbtoyuvscaletable[0][2][blockb]];
}
- if ((y & 1) == 0)
+ if ((y & 1) == 0 && y/2 < h/2) // if h is odd, this skips the last row
{
// 2x2 Cr and Cb planes
int inpitch = width*4;
b += 4;
}
- if((y & 1) == 0)
+ if ((y & 1) == 0 && y/2 < h/2) // if h is odd, this skips the last row
{
for(b = cls.capturevideo.outbuffer + (h-2-y)*w*4, x = 0; x < w/2; ++x)
{