aws / dcv-color-primitives

DCV Color Primitives Library
MIT No Attribution
31 stars 22 forks source link

Wip/memory fixes #37

Closed fabiosky closed 4 years ago

fabiosky commented 4 years ago

Issue #, if available:

Description of changes:

  1. Handle overflow in bgr to i444 conversion SSE2 and AVX2 did not assume the case in which the last line could read more bytes than the lane size

  2. Handle zero-width images All paths (x86, sse2, avx2) are not correctly handling the case in which the image width is zero. This conversion should trivially return true, as there is no data to process. In debug mode, this was instead triggering a panic. In release mode, this was triggering a segfault.

  3. Sync C unit tests with rust ones One unit tests was even failing, fixed it.

  4. Benchmark: Touch output vm pages before converting the images This ensures consistent results across conversion algorithms and operating systems. The result is that the hidden cost of allocation and making the memory really resident is not added to the cost of the conversion algorithm. The page size is the standard one: 4KB

  5. Avx2: Handle panic with return values There were accidentally some panics introduced when implementing the rust-based dispatch

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.