Use new [T]::as_chunks method in CIEDE delta_e_row_avx2 - #313
Use new [T]::as_chunks method in CIEDE delta_e_row_avx2#313FreezyLemon wants to merge 8 commits into
Conversation
| .chroma_dimensions(width, height) | ||
| .expect("has chroma dimensions"); | ||
| f.y_plane | ||
| .copy_from_u8_slice_with_stride(decoded.data(0), width * bytes) |
There was a problem hiding this comment.
Can you confirm that this works properly with frames that have padding?
| fn convert_u16(line: &[u8], index: usize) -> i32 { | ||
| let index = index * 2; | ||
| i32::cast_from(u16::cast_from(line[index + 1]) << 8 | u16::cast_from(line[index])) | ||
| i32::from(u16::from_ne_bytes([line[index + 1], line[index]])) |
There was a problem hiding this comment.
I think this is backwards for what it should be on little endian. Can you test and confirm that HBD chroma copying is correct?
| f.planes[0].copy_from_raw_u8(frame.get_y_plane(), width * bytes, bytes); | ||
| let (chroma_width, _) = chroma_sampling | ||
| .chroma_dimensions(width, height) | ||
| .expect("can subsample"); |
There was a problem hiding this comment.
Since chroma_dimensions returns None for monochrome input, we should handle that case to ensure we don't panic.
| self.planes[1].can_compare(&other.planes[1])?; | ||
| self.planes[2].can_compare(&other.planes[2])?; | ||
| self.plane(0).can_compare(&other.plane(0))?; | ||
| self.plane(1).can_compare(&other.plane(1))?; |
There was a problem hiding this comment.
We should handle monochrome inputs by conditionally ignoring planes after the first.
|
Sorry, this might not have been the best idea with all these PRs. The "real" upgrade to v_frame 0.7 is #311, the other ones depend on it to make sense. I'll mark them drafts for now. Thanks for the review though, I realize I didn't test this nearly enough and will do that first, and then react to your review comments. |
|
Some of these monochrome-related items may have been broken in main as well, but since they were spotted in review, we may as well fix them now. Thanks! |
Requires #311.