Skip to content

Commit 96dcb65

Browse files
committed
libchafa: Namespace the accelerated cell color/error functions
1 parent 18b4569 commit 96dcb65

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

chafa/chafa-canvas.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ eval_symbol_colors_wide (ChafaCanvas *canvas, ChafaWorkCell *wcell_a, ChafaWorkC
189189
}
190190

191191
static gint
192-
calc_error_plain (const ChafaPixel *block, const ChafaColorPair *color_pair, const guint8 *cov)
192+
calc_cell_error_plain (const ChafaPixel *block, const ChafaColorPair *color_pair, const guint8 *cov)
193193
{
194194
gint error = 0;
195195
gint i;
@@ -243,15 +243,15 @@ eval_symbol_error (const ChafaWorkCell *wcell,
243243

244244
#ifdef HAVE_AVX2_INTRINSICS
245245
if (chafa_have_avx2 ())
246-
error = calc_error_avx2 (wcell->pixels, &pair, sym->mask_u32);
246+
error = chafa_calc_cell_error_avx2 (wcell->pixels, &pair, sym->mask_u32);
247247
else
248248
#endif
249249
#ifdef HAVE_SSE41_INTRINSICS
250250
if (chafa_have_sse41 ())
251-
error = calc_error_sse41 (wcell->pixels, &pair, covp);
251+
error = chafa_calc_cell_error_sse41 (wcell->pixels, &pair, covp);
252252
else
253253
#endif
254-
error = calc_error_plain (wcell->pixels, &pair, covp);
254+
error = calc_cell_error_plain (wcell->pixels, &pair, covp);
255255

256256
eval->error = error;
257257
}

chafa/internal/chafa-avx2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#endif
3838

3939
gint
40-
calc_error_avx2 (const ChafaPixel *pixels, const ChafaColorPair *color_pair,
41-
const guint32 *sym_mask_u32)
40+
chafa_calc_cell_error_avx2 (const ChafaPixel *pixels, const ChafaColorPair *color_pair,
41+
const guint32 *sym_mask_u32)
4242
{
4343
__m256i err_8x_u32 = { 0 };
4444
__m128i err_4x_u32;
@@ -81,8 +81,8 @@ calc_error_avx2 (const ChafaPixel *pixels, const ChafaColorPair *color_pair,
8181
}
8282

8383
void
84-
calc_colors_avx2 (const ChafaPixel *pixels, ChafaColorAccum *accums_out,
85-
const guint32 *sym_mask_u32)
84+
chafa_extract_cell_mean_colors_avx2 (const ChafaPixel *pixels, ChafaColorAccum *accums_out,
85+
const guint32 *sym_mask_u32)
8686
{
8787
const __m128i *pixels_4x_p = (const __m128i *) pixels;
8888
const __m128i *sym_mask_4x_p = (const __m128i *) sym_mask_u32;

chafa/internal/chafa-mmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "internal/chafa-private.h"
2525

2626
void
27-
calc_colors_mmx (const ChafaPixel *pixels, ChafaColorAccum *accums_out, const guint8 *cov)
27+
chafa_extract_cell_mean_colors_mmx (const ChafaPixel *pixels, ChafaColorAccum *accums_out, const guint8 *cov)
2828
{
2929
__m64 accum [2] = { 0 };
3030
const guint32 *u32p0 = (const guint32 *) pixels;

chafa/internal/chafa-private.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@ gint *chafa_gen_noise_matrix (gdouble magnitude);
207207
/* Math stuff */
208208

209209
#ifdef HAVE_MMX_INTRINSICS
210-
void calc_colors_mmx (const ChafaPixel *pixels, ChafaColorAccum *accums_out, const guint8 *cov);
210+
void chafa_extract_cell_mean_colors_mmx (const ChafaPixel *pixels, ChafaColorAccum *accums_out, const guint8 *cov);
211211
#endif
212212

213213
#ifdef HAVE_SSE41_INTRINSICS
214-
gint calc_error_sse41 (const ChafaPixel *pixels, const ChafaColorPair *color_pair, const guint8 *cov) G_GNUC_PURE;
214+
gint chafa_calc_cell_error_sse41 (const ChafaPixel *pixels, const ChafaColorPair *color_pair, const guint8 *cov);
215215
#endif
216216

217217
#ifdef HAVE_AVX2_INTRINSICS
218-
gint calc_error_avx2 (const ChafaPixel *pixels, const ChafaColorPair *color_pair,
219-
const guint32 *sym_mask_u32) G_GNUC_PURE;
220-
void calc_colors_avx2 (const ChafaPixel *pixels, ChafaColorAccum *accums_out,
221-
const guint32 *sym_mask_u32);
218+
gint chafa_calc_cell_error_avx2 (const ChafaPixel *pixels, const ChafaColorPair *color_pair,
219+
const guint32 *sym_mask_u32);
220+
void chafa_extract_cell_mean_colors_avx2 (const ChafaPixel *pixels, ChafaColorAccum *accums_out,
221+
const guint32 *sym_mask_u32);
222222
void chafa_color_accum_div_scalar_avx2 (ChafaColorAccum *accum, guint16 divisor);
223223
#endif
224224

chafa/internal/chafa-sse41.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "internal/chafa-private.h"
2525

2626
gint
27-
calc_error_sse41 (const ChafaPixel *pixels, const ChafaColorPair *color_pair, const guint8 *cov)
27+
chafa_calc_cell_error_sse41 (const ChafaPixel *pixels, const ChafaColorPair *color_pair, const guint8 *cov)
2828
{
2929
const guint32 *u32p0 = (const guint32 *) pixels;
3030
guint32 cpair_u32 [2];

chafa/internal/chafa-work-cell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fetch_canvas_pixel_block (const ChafaPixel *src_image, gint src_width,
5757
}
5858

5959
static void
60-
calc_colors_plain (const ChafaPixel *block, ChafaColorAccum *accums, const guint8 *cov)
60+
extract_cell_mean_colors_plain (const ChafaPixel *block, ChafaColorAccum *accums, const guint8 *cov)
6161
{
6262
const guint8 *in_u8 = (const guint8 *) block;
6363
gint i;
@@ -82,14 +82,14 @@ chafa_work_cell_get_mean_colors_for_symbol (const ChafaWorkCell *wcell, const Ch
8282

8383
#ifdef HAVE_AVX2_INTRINSICS
8484
if (chafa_have_avx2 ())
85-
calc_colors_avx2 (wcell->pixels, accums, sym->mask_u32);
85+
chafa_extract_cell_mean_colors_avx2 (wcell->pixels, accums, sym->mask_u32);
8686
else
8787
#elif defined(HAVE_MMX_INTRINSICS)
8888
if (chafa_have_mmx ())
89-
calc_colors_mmx (wcell->pixels, accums, covp);
89+
chafa_extract_cell_mean_colors_mmx (wcell->pixels, accums, covp);
9090
else
9191
#endif
92-
calc_colors_plain (wcell->pixels, accums, covp);
92+
extract_cell_mean_colors_plain (wcell->pixels, accums, covp);
9393

9494
if (sym->fg_weight > 1)
9595
chafa_color_accum_div_scalar (&accums [1], sym->fg_weight);

0 commit comments

Comments
 (0)