diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-06-06 16:28:31 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-06-06 16:28:31 +0300 |
commit | c07af1f4713b4d014de8fd0d401f9e3ed639f6d6 (patch) | |
tree | d5310540eccbcaef5be515a4e80665ac5bf62818 /lib/igt_matrix.c | |
parent | c8f1ae58e1b7da17af4722a5ce5a9cd8b9a34059 (diff) |
lib/igt_matrix: Unroll and inline igt_matrix_transform()
Using the current igt_matrix for NV12 conversion ends up being
about 4x as slow as the current non-igt_matrix based code. Unrolling
and inlining igt_matrix_transform() improves that factor to ~1.5x.
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_matrix.c')
-rw-r--r-- | lib/igt_matrix.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/igt_matrix.c b/lib/igt_matrix.c index 3fa6c96c..35a9c321 100644 --- a/lib/igt_matrix.c +++ b/lib/igt_matrix.c @@ -24,8 +24,6 @@ #include "igt_core.h" #include "igt_matrix.h" -#define m(row, col) ((col) * 4 + (row)) - /** * SECTION:igt_matrix * @short_description: Matrix math library @@ -111,29 +109,6 @@ struct igt_mat4 igt_matrix_translate(float x, float y, float z) } /** - * igt_matrix_transform: - * - * Transform the vector @v by the matrix @m. @m is on the left, - * @v on the right. - * - * Returns: - * The transformed vector. - */ -struct igt_vec4 igt_matrix_transform(const struct igt_mat4 *m, - const struct igt_vec4 *v) -{ - struct igt_vec4 ret = {}; - - for (int row = 0; row < 4; row++) { - for (int i = 0; i < 4; i++) { - ret.d[row] += m->d[m(row, i)] * v->d[i]; - } - } - - return ret; -} - -/** * igt_matrix_multiply: * * Multiply two matrices together. @a is on the left, |