The first part is to open the file and load it to yuv1 buffer. The next stage is reading the YUV420p data correctly i use this formula from wiki
size.total = size.width * size.height;
y = yuv[position.y * size.width + position.x];
u = yuv[(position.y / 2) * (size.width / 2) + (position.x / 2) + size.total];
v = yuv[(position.y / 2) * (size.width / 2) + (position.x / 2) + size.total + (size.total / 4)];
next stage is to take the values from y u v and convert to rgb using the formula below
B = 1.164(Y - 16) + 2.018(U - 128)
G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
R = 1.164(Y - 16) + 1.596(V - 128)
After getting RGB we load them back to buffer correctly and close the file.
But i am getting this error error C2064: term does not evaluate to a function taking 302 arguments in the three formula lines.
Can someone help me out
Error code
r1 = 1.164(y1 - 16) + 1.596(v1 - 128) + 0;
g1 = 1.164(y1 - 16) - 0.813(v1 - 128) - 0.391(u1 - 128);
b1 = 1.164(y1 - 16)+ 0 + 2.018(u1 - 128);