[gegl] ceil -> ceilf
- From: Nicolas Robidoux <nrobidoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] ceil -> ceilf
- Date: Fri, 21 Dec 2012 18:01:31 +0000 (UTC)
commit f7f826e519d81691057d27b9dc2514dc1d635d3f
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date: Fri Dec 21 13:01:27 2012 -0500
ceil -> ceilf
gegl/buffer/gegl-sampler-lohalo.c | 138 +++++++++++++++---------------------
1 files changed, 58 insertions(+), 80 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index f614692..3a5be67 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -122,7 +122,6 @@
* index.
*/
-
#include "config.h"
#include <glib-object.h>
#include <math.h>
@@ -133,7 +132,6 @@
#include "gegl-sampler-lohalo.h"
-
/*
* LOHALO_MINMOD is an implementation of the minmod function which
* only needs two "conditional moves."
@@ -186,7 +184,6 @@
(gfloat) 0. \
)
-
/*
* Macros set up so the likely winner in in the first argument
* (forward branch likely etc):
@@ -196,7 +193,6 @@
#define LOHALO_ABS(_x_) ( (_x_) >= (gfloat) 0. ? (_x_) : -(_x_) )
#define LOHALO_SIGN(_x_) ( (_x_) >= (gfloat) 0. ? (gfloat) 1. : (gfloat) -1. )
-
/*
* Special case of of Knuth's floored division, that is:
*
@@ -212,7 +208,6 @@
*/
#define LOHALO_FLOORED_DIVISION_BY_2(_a_) ( (_a_)>>1 )
-
/*
* Convenience macros. _level_ and _previous_level_ must be a plain
* integers (like "1", "2" etc) because it it literally replaced (note
@@ -245,7 +240,6 @@
: \
(gfloat) ( ( LOHALO_OFFSET_##_previous_level_ + 1.5 ) );
-
#define LOHALO_FIND_CLOSEST_INDICES(_previous_level_,_level_) \
const gint in_left_##_level_ = \
-LOHALO_OFFSET_##_previous_level_ + odd_ix_##_previous_level_; \
@@ -256,7 +250,6 @@
const gint in_bot_##_level_ = \
( LOHALO_OFFSET_##_previous_level_ - 1 ) + odd_iy_##_previous_level_;
-
#define LOHALO_FIND_FARTHEST_INDICES(_level_) \
const gint out_left_##_level_ = \
LOHALO_MAX \
@@ -295,52 +288,47 @@
LOHALO_OFFSET_MIPMAP \
);
-
-#define LOHALO_MIPMAP_EWA_UPDATE(_level_) \
- { \
- gint i; \
- for ( i = out_top_##_level_; i <= in_top_##_level_; i++ ) \
- { \
- gint j = out_left_##_level_; \
- do \
- { \
- LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
- } while ( ++j <= out_rite_##_level_ ); \
- } \
- } \
- { \
- gint i = in_top_##_level_ + (gint) 1; \
- do \
- { \
- { \
- gint j; \
- for ( j = out_left_##_level_; j <= in_left_##_level_; j++ ) \
- { \
- LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
- } \
- } \
- { \
- gint j; \
- for ( j = in_rite_##_level_; j <= out_rite_##_level_; j++ ) \
- { \
- LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
- } \
- } \
- } while ( ++i < in_bot_##_level_ ); \
- } \
- { \
- gint i; \
- for ( i = in_bot_##_level_; i <= out_bot_##_level_; i++ ) \
- { \
- gint j = out_left_##_level_; \
- do \
- { \
- LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
- } while ( ++j <= out_rite_##_level_ ); \
- } \
+#define LOHALO_MIPMAP_EWA_UPDATE(_level_) \
+ { \
+ gint i; \
+ for ( i = out_top_##_level_; i <= in_top_##_level_; i++ ) \
+ { \
+ gint j = out_left_##_level_; \
+ do { \
+ LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
+ } while ( ++j <= out_rite_##_level_ ); \
+ } \
+ } \
+ { \
+ gint i = in_top_##_level_ + (gint) 1; \
+ do { \
+ { \
+ gint j; \
+ for ( j = out_left_##_level_; j <= in_left_##_level_; j++ ) \
+ { \
+ LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
+ } \
+ } \
+ { \
+ gint j; \
+ for ( j = in_rite_##_level_; j <= out_rite_##_level_; j++ ) \
+ { \
+ LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
+ } \
+ } \
+ } while ( ++i < in_bot_##_level_ ); \
+ } \
+ { \
+ gint i; \
+ for ( i = in_bot_##_level_; i <= out_bot_##_level_; i++ ) \
+ { \
+ gint j = out_left_##_level_; \
+ do { \
+ LOHALO_MIPMAP_PIXEL_UPDATE(_level_); \
+ } while ( ++j <= out_rite_##_level_ ); \
+ } \
}
-
#define LOHALO_MIPMAP_PIXEL_UPDATE(_level_) \
mipmap_ewa_update (_level_, \
j, \
@@ -363,14 +351,12 @@
#define LOHALO_FUDGE ( (gdouble) 1.e-6 )
#define LOHALO_FUDGEF ( (gfloat) 1.e-6 )
-
enum
{
PROP_0,
PROP_LAST
};
-
static void gegl_sampler_lohalo_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
@@ -387,7 +373,6 @@ gegl_sampler_lohalo_class_init (GeglSamplerLohaloClass *klass)
sampler_class->get = gegl_sampler_lohalo_get;
}
-
/*
* Because things are kept centered, the stencil width/height is 1 +
* twice the (size of) the offset.
@@ -466,7 +451,6 @@ gegl_sampler_lohalo_init (GeglSamplerLohalo *self)
GEGL_SAMPLER (self)->interpolate_format = babl_format ("RaGaBaA float");
}
-
static void inline
nohalo_subdivision (const gfloat uno_two,
const gfloat uno_thr,
@@ -857,7 +841,6 @@ nohalo_subdivision (const gfloat uno_two,
*qua_fou_1 = qua_fou;
}
-
static inline gfloat
lbb (const gfloat c00,
const gfloat c10,
@@ -1332,7 +1315,6 @@ lbb (const gfloat c00,
return newval;
}
-
static inline gfloat
teepee (const gfloat c_major_x,
const gfloat c_major_y,
@@ -1356,7 +1338,6 @@ teepee (const gfloat c_major_x,
return weight;
}
-
static inline void
ewa_update (const gint j,
const gint i,
@@ -1388,7 +1369,6 @@ ewa_update (const gint j,
ewa_newval[3] += weight * input_bptr[ skip + 3 ];
}
-
static inline void
mipmap_ewa_update (const gint level,
const gint j,
@@ -2295,7 +2275,7 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
const gint out_left_0 =
LOHALO_MAX
(
- (gint) ceil ( (double) ( x_0 - bounding_box_half_width ) )
+ (gint) ceilf ( (double) ( x_0 - bounding_box_half_width ) )
,
-LOHALO_OFFSET_0
);
@@ -2336,26 +2316,24 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
{
gint i = out_top_0;
- do
- {
- gint j = out_left_0;
- do
- {
- ewa_update (j,
- i,
- c_major_x,
- c_major_y,
- c_minor_x,
- c_minor_y,
- x_0,
- y_0,
- channels,
- row_skip,
- input_bptr,
- &total_weight,
- ewa_newval);
- } while ( ++j <= out_rite_0 );
- } while ( ++i <= out_bot_0 );
+ do {
+ gint j = out_left_0;
+ do {
+ ewa_update (j,
+ i,
+ c_major_x,
+ c_major_y,
+ c_minor_x,
+ c_minor_y,
+ x_0,
+ y_0,
+ channels,
+ row_skip,
+ input_bptr,
+ &total_weight,
+ ewa_newval);
+ } while ( ++j <= out_rite_0 );
+ } while ( ++i <= out_bot_0 );
}
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]