summaryrefslogtreecommitdiff
path: root/libavfilter/opencl.c
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2019-01-22 14:47:54 +0800
committerRuiling Song <ruiling.song@intel.com>2019-03-22 09:33:28 +0800
commit2593122a167de3294abd5b9cf04df5b8072ee3ed (patch)
treeb8a13fc78c49461bef06e69ee3f4c6407266ef8f /libavfilter/opencl.c
parentd0f3798b4e7f9ec3142f74946f7de41b9e3485cb (diff)
lavfi/opencl: add ff_opencl_print_const_matrix_3x3()
This is used to print a 3x3 matrix into a part of OpenCL source code. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Diffstat (limited to 'libavfilter/opencl.c')
-rw-r--r--libavfilter/opencl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/opencl.c b/libavfilter/opencl.c
index ac5eec68c6..95f0bfc604 100644
--- a/libavfilter/opencl.c
+++ b/libavfilter/opencl.c
@@ -337,3 +337,16 @@ int ff_opencl_filter_work_size_from_image(AVFilterContext *avctx,
return 0;
}
+
+void ff_opencl_print_const_matrix_3x3(AVBPrint *buf, const char *name_str,
+ double mat[3][3])
+{
+ int i, j;
+ av_bprintf(buf, "__constant float %s[9] = {\n", name_str);
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++)
+ av_bprintf(buf, " %.5ff,", mat[i][j]);
+ av_bprintf(buf, "\n");
+ }
+ av_bprintf(buf, "};\n");
+}