From be7b8819c71b056f63a63b2da0dbc34f5541d898 Mon Sep 17 00:00:00 2001 From: Kevin Larke Date: Sun, 10 Aug 2014 13:03:32 -0700 Subject: [PATCH] cmVectOpsTemplateHdr/Code.h : Add MeanM2() and Interp1(). --- vop/cmVectOpsTemplateCode.h | 42 +++++++++++++++++++++++++++++++++++++ vop/cmVectOpsTemplateHdr.h | 14 +++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/vop/cmVectOpsTemplateCode.h b/vop/cmVectOpsTemplateCode.h index e8859c9..e160766 100644 --- a/vop/cmVectOpsTemplateCode.h +++ b/vop/cmVectOpsTemplateCode.h @@ -235,6 +235,21 @@ VECT_OP_TYPE* VECT_OP_FUNC(MeanM)( VECT_OP_TYPE* dp, const VECT_OP_TYPE* sp, return dp; } +VECT_OP_TYPE* VECT_OP_FUNC(MeanM2)( VECT_OP_TYPE* dp, const VECT_OP_TYPE* sp, unsigned srn, unsigned scn, unsigned dim, unsigned cnt ) +{ + unsigned i; + unsigned cn = dim == 0 ? scn : srn; + unsigned rn = dim == 0 ? srn : scn; + unsigned inc = dim == 0 ? srn : 1; + unsigned stride = dim == 0 ? 1 : srn; + unsigned d0 = 0; + + for(i=0; i