summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorukashanoor2017-06-29 20:26:08 +0530
committerukashanoor2017-06-29 20:26:08 +0530
commit2d8050d5bd74adc66b9a45f55078791a36434be8 (patch)
treeb3d833f497b7325668cbde443b485ca4855c7d8e
parentd1c244c6ad028c25544cb341967e13cbc01b7090 (diff)
downloadScilab2C-2d8050d5bd74adc66b9a45f55078791a36434be8.tar.gz
Scilab2C-2d8050d5bd74adc66b9a45f55078791a36434be8.tar.bz2
Scilab2C-2d8050d5bd74adc66b9a45f55078791a36434be8.zip
till disp complete
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleFunRC.binbin22484 -> 24064 bytes
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.binbin30104 -> 30376 bytes
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.binbin1639588 -> 1641572 bytes
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci7
-rw-r--r--2.3-1/macros/findDeps/getAllSources.binbin251248 -> 252292 bytes
-rw-r--r--2.3-1/macros/findDeps/getAllSources.sci5
-rw-r--r--2.3-1/src/c/elementaryFunctions/includes/linspace.h3
-rw-r--r--2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h4
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c49
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c33
-rw-r--r--2.3-1/src/c/interpolation/includes/interp1.h2
-rw-r--r--2.3-1/src/c/interpolation/interfaces/int_interp1.h8
-rw-r--r--2.3-1/src/c/interpolation/interp1/sinterp13a.c75
-rw-r--r--2.3-1/src/c/signalProcessing/includes/dct.h2
-rw-r--r--2.3-1/src/c/signalProcessing/includes/idct.h2
-rw-r--r--2.3-1/src/c/signalProcessing/interfaces/int_dct.h4
-rw-r--r--2.3-1/src/c/signalProcessing/interfaces/int_idct.h2
-rw-r--r--2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c160
-rw-r--r--2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c83
19 files changed, 437 insertions, 2 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin b/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin
index 70d8b561..c1a8062e 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin
+++ b/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin
Binary files differ
diff --git a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
index bdf35642..92289938 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
+++ b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
Binary files differ
diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
index 37cd5655..2d9cc0fc 100644
--- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
+++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
Binary files differ
diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index bf7ef244..8fec9496 100644
--- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -968,6 +968,8 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
//PrintStringInfo('d2'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('d2d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2d2d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'interp1';
@@ -1005,6 +1007,8 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
@@ -1034,6 +1038,7 @@ PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
@@ -1404,7 +1409,9 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d0d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0s0'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('d2d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin
index bf618020..56abe947 100644
--- a/2.3-1/macros/findDeps/getAllSources.bin
+++ b/2.3-1/macros/findDeps/getAllSources.bin
Binary files differ
diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci
index afa51194..a20fcde3 100644
--- a/2.3-1/macros/findDeps/getAllSources.sci
+++ b/2.3-1/macros/findDeps/getAllSources.sci
@@ -698,6 +698,8 @@ function allSources = getAllSources(SharedInfo)
"src/c/elementaryFunctions/bitset/u16bitsets.c"
"src/c/elementaryFunctions/bitget/u8bitgets.c"
"src/c/elementaryFunctions/bitget/u16bitgets.c"
+ "src/c/elementaryFunctions/linspace/slinspacea.c"
+ "src/c/elementaryFunctions/linspace/slinspaces.c"
"src/c/elementaryFunctions/linspace/dlinspaces.c"
"src/c/elementaryFunctions/linspace/dlinspacea.c"
"src/c/elementaryFunctions/logspace/dlogspaces.c"
@@ -968,9 +970,11 @@ function allSources = getAllSources(SharedInfo)
"src/c/string/string/i16stringa.c"
"src/c/string/string/i16strings.c"
"src/c/signalProcessing/modk/dmodka.c"
+ "src/c/signalProcessing/transforms/idct/sidcta.c"
"src/c/signalProcessing/transforms/idct/cidcta.c"
"src/c/signalProcessing/transforms/idct/zidcta.c"
"src/c/signalProcessing/transforms/idct/didcta.c"
+ "src/c/signalProcessing/transforms/dct/sdcta.c"
"src/c/signalProcessing/transforms/dct/cdcta.c"
"src/c/signalProcessing/transforms/dct/zdcta.c"
"src/c/signalProcessing/transforms/dct/ddcta.c"
@@ -1185,6 +1189,7 @@ function allSources = getAllSources(SharedInfo)
"src/c/elementaryFunctions/Trigonometry/sech/zsechs.c"
"src/c/elementaryFunctions/Trigonometry/sech/csecha.c"
"src/c/elementaryFunctions/Trigonometry/sech/csechs.c"
+ "src/c/interpolation/interp1/sinterp13a.c"
"src/c/interpolation/interp1/dinterp13a.c"
"src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcds.c"
"src/c/elementaryFunctions/discrete_mathematics/gcd/dgcda.c"
diff --git a/2.3-1/src/c/elementaryFunctions/includes/linspace.h b/2.3-1/src/c/elementaryFunctions/includes/linspace.h
index 92fe10e5..62d45015 100644
--- a/2.3-1/src/c/elementaryFunctions/includes/linspace.h
+++ b/2.3-1/src/c/elementaryFunctions/includes/linspace.h
@@ -21,8 +21,11 @@ extern "C" {
EXTERN_ELEMFUNCT void dlinspaces(double low_limit,double up_limit,double range_num, double* out);
+EXTERN_ELEMFUNCT void slinspaces(float low_limit,float up_limit,float range_num, float* out);
+
EXTERN_ELEMFUNCT void dlinspacea(double *low_limit,int row,double *up_limit,double range_num, double* out);
+EXTERN_ELEMFUNCT void slinspacea(float *low_limit,int row,float *up_limit,float range_num, float* out);
diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h
index f8af947a..15ea2696 100644
--- a/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h
+++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h
@@ -15,6 +15,10 @@
#define d0d0d0linspaced2(in1,in2,in3,out) dlinspaces(in1,in2,in3,out)
+#define s0s0s0linspaces2(in1,in2,in3,out) slinspaces(in1,in2,in3,out)
+
#define d2d2d0linspaced2(in1,size1,in2,size2,in3,out) dlinspacea(in1,size1[0],in2,in3,out)
+#define s2s2s0linspaces2(in1,size1,in2,size2,in3,out) slinspacea(in1,size1[0],in2,in3,out)
+
#endif
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c b/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c
new file mode 100644
index 00000000..38af3942
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include <stdlib.h>
+#include "linspace.h"
+
+void slinspacea(float *low_limit,int _row,float *up_limit,float range_num,float *out)
+{
+ int i,j,k;
+ float temp;
+ float *step_iterate; /* for each row the spacing between two values is different.*/
+ step_iterate = (float*) malloc((float)_row*sizeof(float));
+ for(i=0;i<_row;i++)
+ {
+
+ step_iterate[i] = (up_limit[i]-low_limit[i])/(range_num-1);
+
+ }
+ for(j=0;j < _row;j++)
+ {
+ out[j] = low_limit[j]; /* For every row first element is the first value of low_limit array*/
+ temp = low_limit[j];
+ for(k=1;k < (float)range_num;k++ )
+ {
+ out[(_row*k)+j] = temp + step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/
+ temp = out[(_row*k)+j];
+ if(k == (float)range_num-1 )
+ {
+ out[(_row*k)+j] = (float)up_limit[j]; /* Last value of output is equal to first value of up_limit array*/
+ }
+
+ }
+
+
+ }
+
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c b/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c
new file mode 100644
index 00000000..2404f4de
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include "linspace.h"
+void slinspaces(float low_limit,float up_limit,float range_num,float *out)
+{
+ int j;
+ float temp = low_limit;
+ float step_iterate = (up_limit-low_limit)/(range_num-1);
+ out[0] = low_limit; /*First value of output is equal to low_limit value*/
+ for(j=1; j<(float)range_num; j++)
+ {
+ out[j] = temp + step_iterate;
+ temp = out[j];
+ if(j == (float)range_num-1 )
+ {
+ out[j] = (float)up_limit; /* Last value of output is equal to up_limit value*/
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/interpolation/includes/interp1.h b/2.3-1/src/c/interpolation/includes/interp1.h
index 1c01417e..738bfe67 100644
--- a/2.3-1/src/c/interpolation/includes/interp1.h
+++ b/2.3-1/src/c/interpolation/includes/interp1.h
@@ -23,6 +23,8 @@ extern "C" {
//void dinterp13a(double *x,double *fx,double *q,int size,double *out);
void dinterp13a(double *x,int size1,double *fx,int size2,double *q,int size3,char *a,int size4,double *out);
+void sinterp13a(float *x,int size1,float *fx,int size2,float *q,int size3,char *a,int size4,float *out);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/2.3-1/src/c/interpolation/interfaces/int_interp1.h b/2.3-1/src/c/interpolation/interfaces/int_interp1.h
index 6d579e10..07d8ece4 100644
--- a/2.3-1/src/c/interpolation/interfaces/int_interp1.h
+++ b/2.3-1/src/c/interpolation/interfaces/int_interp1.h
@@ -19,9 +19,13 @@
#include "interp1.h"
#include <string.h>
-#define d2d2d2interp1d2(x,size1,fx,size2,q,size3,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size1[1],q,size3[0]*size3[1],"linear",6,out)
+#define d2d2d2interp1d2(x,size1,fx,size2,q,size3,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],"linear",6,out)
-#define d2d2d2g2interp1d2(x,size1,fx,size2,q,size3,ch,size4,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size1[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out)
+#define d2d2d2g2interp1d2(x,size1,fx,size2,q,size3,ch,size4,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out)
+
+#define s2s2s2interp1s2(x,size1,fx,size2,q,size3,out) sinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],"linear",6,out)
+
+#define s2s2s2g2interp1s2(x,size1,fx,size2,q,size3,ch,size4,out) sinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out)
#endif
diff --git a/2.3-1/src/c/interpolation/interp1/sinterp13a.c b/2.3-1/src/c/interpolation/interp1/sinterp13a.c
new file mode 100644
index 00000000..b8cb0851
--- /dev/null
+++ b/2.3-1/src/c/interpolation/interp1/sinterp13a.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "interp1.h"
+#include <string.h>
+
+void sinterp13a(float *x,int size1,float *fx,int size2,float *q,int size3,char *ch,int size4,float *out)
+{
+ int i,j,k,f;
+ float a,b;
+ if(strcmp(ch,"linear")==0)
+ {
+ for(i=0;i<size3;i++)
+ {
+ f=0;
+ for(j=0;j<size1;j++)
+ {
+ if(q[i]==x[j])
+ {
+ out[i]=fx[j];
+ f=1;
+ break;
+ }
+ }
+ if(f==0)
+ {
+ j=0;
+ while(q[i]>x[j])
+ {
+ j++;
+ }
+ a=x[j-1];
+ b=x[j];
+ out[i]=fx[j-1]+(q[i]-a)*((fx[j]-fx[j-1])/(b-a));
+ }
+ }
+ }
+ else if(strcmp(ch,"nearest")==0)
+ {
+ for(i=0;i<size3;i++)
+ {
+ f=0;
+ for(j=0;j<size1;j++)
+ {
+ if(q[i]==x[j])
+ {
+ out[i]=fx[j];
+ f=1;
+ break;
+ }
+ }
+ if(f==0)
+ {
+ j=0;
+ while(q[i]>x[j])
+ {
+ j++;
+ }
+ out[i]=fx[j];
+ }
+ }
+ }
+}
+
+
diff --git a/2.3-1/src/c/signalProcessing/includes/dct.h b/2.3-1/src/c/signalProcessing/includes/dct.h
index 5255241e..80668ffa 100644
--- a/2.3-1/src/c/signalProcessing/includes/dct.h
+++ b/2.3-1/src/c/signalProcessing/includes/dct.h
@@ -25,6 +25,8 @@ extern "C" {
void ddcta(double *in,int row,int col,int sign,double *out);
+void sdcta(float *in,int row,int col,int sign,float *out);
+
void zdcta(doubleComplex *in,int row,int col,int sign,doubleComplex *out);
void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out);
diff --git a/2.3-1/src/c/signalProcessing/includes/idct.h b/2.3-1/src/c/signalProcessing/includes/idct.h
index 13458b7d..1e7b85b3 100644
--- a/2.3-1/src/c/signalProcessing/includes/idct.h
+++ b/2.3-1/src/c/signalProcessing/includes/idct.h
@@ -25,6 +25,8 @@ extern "C" {
void didcta(double *in,int row,int col,double *out);
+void sidcta(float *in,int row,int col,float *out);
+
void zidcta(doubleComplex *in,int row,int col,doubleComplex *out);
void cidcta(floatComplex *in,int row,int col,floatComplex *out);
diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_dct.h b/2.3-1/src/c/signalProcessing/interfaces/int_dct.h
index 6cfb21c7..3481c4d5 100644
--- a/2.3-1/src/c/signalProcessing/interfaces/int_dct.h
+++ b/2.3-1/src/c/signalProcessing/interfaces/int_dct.h
@@ -21,6 +21,10 @@
#define d2d0dctd2(in,size,sign,out) ddcta(in,size[0],size[1],sign,out)
+#define s2dcts2(in,size,out) sdcta(in,size[0],size[1],-1,out)
+
+#define s2s0dcts2(in,size,sign,out) sdcta(in,size[0],size[1],sign,out)
+
#define z2dctz2(in,size,out) zdcta(in,size[0],size[1],-1,out)
#define z2d0dctz2(in,size,sign,out) zdcta(in,size[0],size[1],sign,out)
diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_idct.h b/2.3-1/src/c/signalProcessing/interfaces/int_idct.h
index c3a174ac..f705fe2d 100644
--- a/2.3-1/src/c/signalProcessing/interfaces/int_idct.h
+++ b/2.3-1/src/c/signalProcessing/interfaces/int_idct.h
@@ -19,6 +19,8 @@
#define d2idctd2(in,size,out) didcta(in,size[0],size[1],out)
+#define s2idcts2(in,size,out) sidcta(in,size[0],size[1],out)
+
#define z2idctz2(in,size,out) zidcta(in,size[0],size[1],out)
#define c2idctc2(in,size,out) cidcta(in,size[0],size[1],out)
diff --git a/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c b/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c
new file mode 100644
index 00000000..9f380e8b
--- /dev/null
+++ b/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c
@@ -0,0 +1,160 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "dct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void sdcta(float *in,int row,int col,int sign,float *out)
+{
+ int i,j,k,u,v;
+ int n;
+ int x,y;
+ float res,ress;
+ float re,z,q,m;
+ if(sign==-1)
+ {
+ if(row==1)
+ {
+ n=col;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ out[x]+=in[y]*(cos(((M_PI)*(y+1-1./2.)*(x))/n));
+ }
+ }
+ if(x==0)
+ out[x]*=1./(sqrt(n));
+ else
+ {
+ float res=2./n;
+ out[x]*=sqrt(res);
+ }
+ }
+ }
+ }
+ else
+ {
+ n=col*row;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ m=(float)in[j*row+i];
+ z=(float)(((float)j+1.0/2.0)*(float)v);
+ q=(float)(M_PI/(float)col);
+ re+=m*(cos(q*z));
+ }
+ z=(float)(((float)i+1.0/2.0)*(float)u);
+ q=(float)(M_PI/(float)row);
+ out[x]+=re*(cos(q*z));
+ }
+ if(u==0)
+ {
+ out[x]/=sqrt((float)row);
+ if(v==0)
+ out[x]/=sqrt((float)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ else
+ {
+ out[x]*=sqrt(2./row);
+ if(v==0)
+ out[x]/=sqrt((float)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ }
+ }
+
+ }
+ }
+ else if(sign==1)
+ {
+ n=col;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(float)in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((float)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((float)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c b/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c
new file mode 100644
index 00000000..62f85da0
--- /dev/null
+++ b/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "idct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void sidcta(float *in,int row,int col,float *out)
+{
+ int i,j,k,u,v;
+ int n=col;
+ int x,y;
+ float res,ress;
+ float re,z,q,m;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(float)in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((float)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((float)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+}