Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem if the height value is odd #13

Open
krolikor opened this issue Feb 24, 2020 · 0 comments
Open

Problem if the height value is odd #13

krolikor opened this issue Feb 24, 2020 · 0 comments
Labels

Comments

@krolikor
Copy link

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);

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);`
@descampsa descampsa added the bug label Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants