diff --git a/examples/decoder_test/cchlop_out_nv12.png b/examples/decoder_test/cchlop_out_nv12.png index ee9a8a6..c366df0 100644 Binary files a/examples/decoder_test/cchlop_out_nv12.png and b/examples/decoder_test/cchlop_out_nv12.png differ diff --git a/nokhwa-core/src/types.rs b/nokhwa-core/src/types.rs index d387de9..1c4a6e9 100644 --- a/nokhwa-core/src/types.rs +++ b/nokhwa-core/src/types.rs @@ -1787,12 +1787,12 @@ pub fn buf_nv12_to_rgb( let y_section = (resolution.width() * resolution.height()) as usize; let width_usize = resolution.width() as usize; - let height_usize = resolution.height() as usize; + // let height_usize = resolution.height() as usize; for (hidx, horizontal_row) in data[0..y_section].chunks_exact(width_usize).enumerate() { for (cidx, column) in horizontal_row.chunks_exact(2).enumerate() { - let v = data[(y_section - 1) + ((hidx / 2) * width_usize) + (cidx * 2)]; - let u = data[(y_section - 1) + ((hidx / 2) * width_usize) + (cidx * 2) + 1]; + let u = data[(y_section) + ((hidx / 2) * width_usize) + (cidx * 2)]; + let v = data[(y_section) + ((hidx / 2) * width_usize) + (cidx * 2) + 1]; let y0 = column[0]; let y1 = column[1];