ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
ascii_simd.h File Reference

SIMD-optimized ASCII conversion interface. More...

Go to the source code of this file.

Data Structures

struct  dec3_t
 Decimal conversion cache structure (1-3 digits) More...
 
struct  global_dec3_cache_t
 Global decimal cache for digit conversion. More...
 
struct  Str
 Dynamic string buffer structure. More...
 
struct  RLEState
 Run-length encoding state for ANSI color optimization. More...
 
struct  ImageRGB
 ImageRGB structure for NEON renderers. More...
 
struct  simd_benchmark_t
 SIMD benchmark results structure. More...
 

Macros

Luminance Calculation Constants
#define LUMA_RED   77
 Luminance red coefficient (0.299 * 256 = 77)
 
#define LUMA_GREEN   150
 Luminance green coefficient (0.587 * 256 = 150)
 
#define LUMA_BLUE   29
 Luminance blue coefficient (0.114 * 256 = 29)
 
#define LUMA_THRESHOLD   128
 Luminance threshold for rounding.
 

Functions

void init_dec3 (void)
 Initialize decimal lookup table.
 
void ascii_simd_init (void)
 Initialize SIMD subsystem.
 
void init_default_luminance_palette (void)
 Initialize default luminance palette.
 
void str_init (Str *s)
 Initialize string buffer.
 
void str_free (Str *s)
 Free string buffer.
 
void str_reserve (Str *s, size_t need)
 Reserve space in string buffer.
 
void str_append_bytes (Str *s, const void *src, size_t n)
 Append bytes to string buffer.
 
void str_append_c (Str *s, char c)
 Append character to string buffer.
 
void str_printf (Str *s, const char *fmt,...)
 Append formatted string to buffer.
 
ImageRGB alloc_image (int w, int h)
 Allocate a new ImageRGB (RGB8 format)
 
void convert_pixels_scalar (const rgb_pixel_t *pixels, char *ascii_chars, int count, const char luminance_palette[256])
 Convert pixels to ASCII (scalar fallback)
 
char * convert_pixels_scalar_with_newlines (image_t *image, const char luminance_palette[256])
 Convert image to ASCII with newlines (scalar fallback)
 
simd_benchmark_t benchmark_simd_conversion (int width, int height, int iterations)
 Benchmark SIMD conversion methods (monochrome)
 
simd_benchmark_t benchmark_simd_color_conversion (int width, int height, int iterations, bool background_mode)
 Benchmark SIMD color conversion methods.
 
simd_benchmark_t benchmark_simd_conversion_with_source (int width, int height, int iterations, bool background_mode, const image_t *source_image, bool use_256color)
 Benchmark SIMD conversion with source image.
 
simd_benchmark_t benchmark_simd_color_conversion_with_source (int width, int height, int iterations, bool background_mode, const image_t *source_image, bool use_256color)
 Benchmark SIMD color conversion with source image.
 
void print_simd_capabilities (void)
 Print detected SIMD capabilities.
 
char * image_print_simd (image_t *image, const char *ascii_chars)
 Print image as ASCII using SIMD (monochrome)
 
char * image_print_color_simd (image_t *image, bool use_background_mode, bool use_256color, const char *ascii_chars)
 Print image as ASCII with color using SIMD.
 
void set_color_quality_mode (bool high_quality)
 Set color quality mode.
 
bool get_256_color_fast_path (void)
 Get 256-color fast path setting.
 
void prewarm_sgr256_fg_cache (void)
 Prewarm 256-color foreground cache for benchmarks.
 
void prewarm_sgr256_cache (void)
 Prewarm 256-color foreground/background cache for benchmarks.
 
char * get_sgr256_fg_string (uint8_t fg, uint8_t *len_out)
 Get 256-color foreground ANSI sequence string.
 
char * get_sgr256_fg_bg_string (uint8_t fg, uint8_t bg, uint8_t *len_out)
 Get 256-color foreground/background ANSI sequence string.
 
size_t write_row_rep_from_arrays_enhanced (const uint8_t *fg_r, const uint8_t *fg_g, const uint8_t *fg_b, const uint8_t *bg_r, const uint8_t *bg_g, const uint8_t *bg_b, const uint8_t *fg_idx, const uint8_t *bg_idx, const char *ascii_chars, int width, char *dst, size_t cap, bool is_truecolor)
 Enhanced REP compression writer.
 

Variables

global_dec3_cache_t g_dec3_cache
 Global decimal cache instance.
 
char g_default_luminance_palette [256]
 Default luminance palette (256 characters)
 

Detailed Description

SIMD-optimized ASCII conversion interface.

Definition in file ascii_simd.h.