Skip to content

Commit

Permalink
SIMD ColorLUT. First try
Browse files Browse the repository at this point in the history
Two items, not two bytes

SIMD ColorLUT. remove SHIFT_ROUNDING

SIMD ColorLUT. improve performance by preliminary index calculation

SIMD ColorLUT. table_channels==4 case, minor optimizations

SIMD ColorLUT. remove unused utility

SIMD ColorLUT. remove left_mask and right_mask

SIMD ColorLUT. AVX2 implementation (near the same speed)

SIMD ColorLUT. Fast AVX2 implementation with very wired slowdown

SIMD ColorLUT. finally fix alpha copy

SIMD ColorLUT. 16bit arithmetic. Access violation fixed
  • Loading branch information
homm committed Aug 12, 2024
1 parent 7511039 commit 6eacce9
Show file tree
Hide file tree
Showing 2 changed files with 370 additions and 104 deletions.
2 changes: 1 addition & 1 deletion src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ _prepare_lut_table(PyObject *table, Py_ssize_t table_size) {
}

/* malloc check ok, max is 2 * 4 * 65**3 = 2197000 */
prepared = (INT16 *)malloc(sizeof(INT16) * table_size);
prepared = (INT16 *)malloc(sizeof(INT16) * (table_size + 2));
if (!prepared) {
if (free_table_data) {
free(table_data);
Expand Down
Loading

0 comments on commit 6eacce9

Please sign in to comment.