aboutsummaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-06-27 12:25:55 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-06-29 13:40:00 +0000
commit3555e81fee4a069bf4886007082f676b8777f6f9 (patch)
tree21b5d0b77009c17ebe1d67429190bceddbb42780 /debug.c
parentMerge branch 'fractional-scaling' (diff)
sixel: special case parsing of images with an aspect ratio of 1:1
Images with an aspect ratio of 1:1 are by far the most common (though not the default). It makes a lot of sense, performance wise, to special case them. Specifically, the sixel_add() function benefits greatly from this, as it is the inner most, most heavily executed function when parsing a sixel image. sixel_add_many() also benefits, since allows us to drop a multiplication. Since sixel_add_many() always called first (no other call sites call sixel_add() directly), this has a noticeable effect on performance. Another thing that helps (though not as much), and not specifically with AR 1:1 images, is special casing DECGRI a bit. Up until now, it simply updated the current sixel parameter value. The problem is that the default parameter value is 0. But, a value of 0 should be treated as 1. By adding a special ‘repeat_count’ variable to the sixel struct, we can initialize it to ‘1’ when we see DECGRI, and then simply overwrite it as the parameter value gets updated. This allows us to drop an if..else when emitting the sixel.
Diffstat (limited to 'debug.c')
0 files changed, 0 insertions, 0 deletions