[arrayfire] 233/408: Replaced padArray calls with Jit operations in ycbcr conversions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:12:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit 384cbc7f2b9e7600ec2fb43803a8d172b11247db
Author: pradeep <pradeep at arrayfire.com>
Date:   Wed Aug 12 15:35:35 2015 -0400

    Replaced padArray calls with Jit operations in ycbcr conversions
---
 src/api/c/ycbcr_rgb.cpp | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/api/c/ycbcr_rgb.cpp b/src/api/c/ycbcr_rgb.cpp
index 1477e27..b3dd5ea 100644
--- a/src/api/c/ycbcr_rgb.cpp
+++ b/src/api/c/ycbcr_rgb.cpp
@@ -15,7 +15,6 @@
 #include <err_common.hpp>
 #include <backend.hpp>
 #include <arith.hpp>
-#include <copy.hpp>
 #include <join.hpp>
 #include <math.hpp>
 
@@ -27,8 +26,11 @@ static Array<T> mix(const Array<T>& X, const Array<T>& Y,
                 double xf, double yf)
 {
     dim4 dims = X.dims();
-    Array<T> fX = padArray<T, T>(X, dims, scalar<T>(0), xf);
-    Array<T> fY = padArray<T, T>(Y, dims, scalar<T>(0), yf);
+    Array<T> xf_cnst = createValueArray<T>(dims, xf);
+    Array<T> yf_cnst = createValueArray<T>(dims, yf);
+
+    Array<T> fX = arithOp<T, af_mul_t>(xf_cnst, X, dims);
+    Array<T> fY = arithOp<T, af_mul_t>(yf_cnst, Y, dims);
 
     return arithOp<T, af_add_t>(fX, fY, dims);
 }
@@ -38,9 +40,13 @@ static Array<T> mix(const Array<T>& X, const Array<T>& Y, const Array<T>& Z,
                 double xf, double yf, double zf)
 {
     dim4 dims = X.dims();
-    Array<T> fX = padArray<T, T>(X, dims, scalar<T>(0), xf);
-    Array<T> fY = padArray<T, T>(Y, dims, scalar<T>(0), yf);
-    Array<T> fZ = padArray<T, T>(Z, dims, scalar<T>(0), zf);
+    Array<T> xf_cnst = createValueArray<T>(dims, xf);
+    Array<T> yf_cnst = createValueArray<T>(dims, yf);
+    Array<T> zf_cnst = createValueArray<T>(dims, zf);
+
+    Array<T> fX = arithOp<T, af_mul_t>(xf_cnst, X, dims);
+    Array<T> fY = arithOp<T, af_mul_t>(yf_cnst, Y, dims);
+    Array<T> fZ = arithOp<T, af_mul_t>(zf_cnst, Z, dims);
 
     Array<T> fx_fy = arithOp<T, af_add_t>(fX, fY, dims);
     return arithOp<T, af_add_t>(fx_fy, fZ, dims);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list