From 8c65c68b734b3a0711e8d0a7282d6c7d9def5ddf Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 6 Mar 2021 22:05:40 +0100 Subject: sixel: get rid of an ‘imul’ in sixel_add() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By storing the current row’s byte offset into the backing image in the terminal struct. This replaces the ‘imul’ with a load, which can potentially be slow. But, this data should already be in the cache. --- terminal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index e4e662fb..2a8bb6f9 100644 --- a/terminal.h +++ b/terminal.h @@ -521,6 +521,7 @@ struct terminal { } state; struct coord pos; /* Current sixel coordinate */ + size_t row_byte_ofs; /* Byte position into image, for current row */ int color_idx; /* Current palette index */ int max_col; /* Largest column index we've seen (aka the image width) */ uint32_t *private_palette; /* Private palette, used when private mode 1070 is enabled */ -- cgit v1.3