diff --git a/gfx/qcms/chain.c b/gfx/qcms/chain.c index a259499db6b6..edc91715396c 100644 --- a/gfx/qcms/chain.c +++ b/gfx/qcms/chain.c @@ -138,12 +138,12 @@ static void qcms_transform_module_clut_only(struct qcms_modular_transform *trans float linear_g = *src++; float linear_b = *src++; - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float x_d = linear_r * (transform->grid_size-1) - x; float y_d = linear_g * (transform->grid_size-1) - y; float z_d = linear_b * (transform->grid_size-1) - z; @@ -198,12 +198,12 @@ static void qcms_transform_module_clut(struct qcms_modular_transform *transform, float linear_b = lut_interp_linear_float(device_b, transform->input_clut_table_b, transform->input_clut_table_length); - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float x_d = linear_r * (transform->grid_size-1) - x; float y_d = linear_g * (transform->grid_size-1) - y; float z_d = linear_b * (transform->grid_size-1) - z; @@ -271,12 +271,12 @@ static void qcms_transform_module_tetra_clut(struct qcms_modular_transform *tran float linear_b = lut_interp_linear_float(device_b, transform->input_clut_table_b, transform->input_clut_table_length); - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float rx = linear_r * (transform->grid_size-1) - x; float ry = linear_g * (transform->grid_size-1) - y; float rz = linear_b * (transform->grid_size-1) - z; diff --git a/gfx/qcms/transform.c b/gfx/qcms/transform.c index 51ab83f5daab..103b65bb8efc 100644 --- a/gfx/qcms/transform.c +++ b/gfx/qcms/transform.c @@ -435,12 +435,12 @@ static void qcms_transform_data_clut(qcms_transform *transform, unsigned char *s unsigned char in_b = *src++; float linear_r = in_r/255.0f, linear_g=in_g/255.0f, linear_b = in_b/255.0f; - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float x_d = linear_r * (transform->grid_size-1) - x; float y_d = linear_g * (transform->grid_size-1) - y; float z_d = linear_b * (transform->grid_size-1) - z; @@ -496,12 +496,12 @@ static void qcms_transform_data_tetra_clut_rgba(qcms_transform *transform, unsig unsigned char in_a = *src++; float linear_r = in_r/255.0f, linear_g=in_g/255.0f, linear_b = in_b/255.0f; - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float rx = linear_r * (transform->grid_size-1) - x; float ry = linear_g * (transform->grid_size-1) - y; float rz = linear_b * (transform->grid_size-1) - z; @@ -611,12 +611,12 @@ static void qcms_transform_data_tetra_clut(qcms_transform *transform, unsigned c unsigned char in_b = *src++; float linear_r = in_r/255.0f, linear_g=in_g/255.0f, linear_b = in_b/255.0f; - int x = floor(linear_r * (transform->grid_size-1)); - int y = floor(linear_g * (transform->grid_size-1)); - int z = floor(linear_b * (transform->grid_size-1)); - int x_n = ceil(linear_r * (transform->grid_size-1)); - int y_n = ceil(linear_g * (transform->grid_size-1)); - int z_n = ceil(linear_b * (transform->grid_size-1)); + int x = floorf(linear_r * (transform->grid_size-1)); + int y = floorf(linear_g * (transform->grid_size-1)); + int z = floorf(linear_b * (transform->grid_size-1)); + int x_n = ceilf(linear_r * (transform->grid_size-1)); + int y_n = ceilf(linear_g * (transform->grid_size-1)); + int z_n = ceilf(linear_b * (transform->grid_size-1)); float rx = linear_r * (transform->grid_size-1) - x; float ry = linear_g * (transform->grid_size-1) - y; float rz = linear_b * (transform->grid_size-1) - z; diff --git a/gfx/qcms/transform_util.c b/gfx/qcms/transform_util.c index 364feb41d966..c3d03c561960 100644 --- a/gfx/qcms/transform_util.c +++ b/gfx/qcms/transform_util.c @@ -76,8 +76,8 @@ float lut_interp_linear_float(float value, float *table, int length) { int upper, lower; value = value * (length - 1); - upper = ceil(value); - lower = floor(value); + upper = ceilf(value); + lower = floorf(value); //XXX: can we be more performant here? value = table[upper]*(1. - (upper - value)) + table[lower]*(upper - value); /* scale the value */