It's a very good and fast code, but there is one problem.
If the height value is odd, then the resulting image has the wrong last line of pixels.
Or maybe I do something wrong?
To test it you just need to reduce the test1.ppm file by one line to size: 80x69
A sample code:
` uint8_t out_buf = (uint8_t )malloc(width height 3);
uint8_t *YUV = NULL, *Y = NULL, *U = NULL, *V = NULL;
YUV = (uint8_t *)malloc(width * height * 3 / 2);
Y = YUV;
U = YUV + width * height;
V = YUV + width * height + ((width + 1) / 2)*((height + 1) / 2);
//convert to yuv and back to rgb
rgb24_yuv420_std(width, height, test1_80_69_bmp, width * 3, Y, U, V, width, (width + 1) / 2, YCBCR_601);
yuv420_rgb24_std(width, height, Y, U, V, width, (width + 1) / 2, out_buf, width * 3, YCBCR_601);`
Hello
It's a very good and fast code, but there is one problem. If the height value is odd, then the resulting image has the wrong last line of pixels. Or maybe I do something wrong? To test it you just need to reduce the test1.ppm file by one line to size: 80x69 A sample code: ` uint8_t out_buf = (uint8_t )malloc(width height 3);