| Index: third_party/qcms/src/transform-sse1.c
|
| diff --git a/third_party/qcms/src/transform-sse1.c b/third_party/qcms/src/transform-sse1.c
|
| index 2f34db5c1672d6df25653c381df9fcc1663488b6..aaee1bf22e00e73569f70561d56185a6a33cd30e 100644
|
| --- a/third_party/qcms/src/transform-sse1.c
|
| +++ b/third_party/qcms/src/transform-sse1.c
|
| @@ -34,7 +34,8 @@ static const ALIGN float clampMaxValueX4[4] =
|
| void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform,
|
| unsigned char *src,
|
| unsigned char *dest,
|
| - size_t length)
|
| + size_t length,
|
| + qcms_format_type output_format)
|
| {
|
| unsigned int i;
|
| float (*mat)[4] = transform->matrix;
|
| @@ -70,6 +71,8 @@ void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform,
|
|
|
| /* working variables */
|
| __m128 vec_r, vec_g, vec_b, result;
|
| + const int r_out = output_format.r;
|
| + const int b_out = output_format.b;
|
|
|
| /* CYA */
|
| if (!length)
|
| @@ -116,9 +119,9 @@ void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform,
|
| src += 3;
|
|
|
| /* use calc'd indices to output RGB values */
|
| - dest[0] = otdata_r[output[0]];
|
| - dest[1] = otdata_g[output[1]];
|
| - dest[2] = otdata_b[output[2]];
|
| + dest[r_out] = otdata_r[output[0]];
|
| + dest[1] = otdata_g[output[1]];
|
| + dest[b_out] = otdata_b[output[2]];
|
| dest += 3;
|
| }
|
|
|
| @@ -141,9 +144,9 @@ void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform,
|
| result = _mm_movehl_ps(result, result);
|
| *((__m64 *)&output[2]) = _mm_cvtps_pi32(result);
|
|
|
| - dest[0] = otdata_r[output[0]];
|
| - dest[1] = otdata_g[output[1]];
|
| - dest[2] = otdata_b[output[2]];
|
| + dest[r_out] = otdata_r[output[0]];
|
| + dest[1] = otdata_g[output[1]];
|
| + dest[b_out] = otdata_b[output[2]];
|
|
|
| _mm_empty();
|
| }
|
| @@ -151,7 +154,8 @@ void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform,
|
| void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform,
|
| unsigned char *src,
|
| unsigned char *dest,
|
| - size_t length)
|
| + size_t length,
|
| + qcms_format_type output_format)
|
| {
|
| unsigned int i;
|
| float (*mat)[4] = transform->matrix;
|
| @@ -187,6 +191,8 @@ void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform,
|
|
|
| /* working variables */
|
| __m128 vec_r, vec_g, vec_b, result;
|
| + const int r_out = output_format.r;
|
| + const int b_out = output_format.b;
|
| unsigned char alpha;
|
|
|
| /* CYA */
|
| @@ -239,9 +245,9 @@ void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform,
|
| src += 4;
|
|
|
| /* use calc'd indices to output RGB values */
|
| - dest[0] = otdata_r[output[0]];
|
| - dest[1] = otdata_g[output[1]];
|
| - dest[2] = otdata_b[output[2]];
|
| + dest[r_out] = otdata_r[output[0]];
|
| + dest[1] = otdata_g[output[1]];
|
| + dest[b_out] = otdata_b[output[2]];
|
| dest += 4;
|
| }
|
|
|
| @@ -266,9 +272,9 @@ void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform,
|
| result = _mm_movehl_ps(result, result);
|
| *((__m64 *)&output[2]) = _mm_cvtps_pi32(result);
|
|
|
| - dest[0] = otdata_r[output[0]];
|
| - dest[1] = otdata_g[output[1]];
|
| - dest[2] = otdata_b[output[2]];
|
| + dest[r_out] = otdata_r[output[0]];
|
| + dest[1] = otdata_g[output[1]];
|
| + dest[b_out] = otdata_b[output[2]];
|
|
|
| _mm_empty();
|
| }
|
|
|