From 9fc55b8370323fd8f7364a5abfcee3af65899a97 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Thu, 29 Jun 2017 20:26:08 +0530 Subject: till disp complete --- src/c/signalProcessing/includes/dct.h | 2 + src/c/signalProcessing/includes/idct.h | 2 + src/c/signalProcessing/interfaces/int_dct.h | 4 + src/c/signalProcessing/interfaces/int_idct.h | 2 + src/c/signalProcessing/transforms/dct/sdcta.c | 160 ++++++++++++++++++++++++ src/c/signalProcessing/transforms/idct/sidcta.c | 83 ++++++++++++ 6 files changed, 253 insertions(+) create mode 100644 src/c/signalProcessing/transforms/dct/sdcta.c create mode 100644 src/c/signalProcessing/transforms/idct/sidcta.c (limited to 'src/c/signalProcessing') diff --git a/src/c/signalProcessing/includes/dct.h b/src/c/signalProcessing/includes/dct.h index 5255241..80668ff 100644 --- a/src/c/signalProcessing/includes/dct.h +++ b/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/src/c/signalProcessing/includes/idct.h b/src/c/signalProcessing/includes/idct.h index 13458b7..1e7b85b 100644 --- a/src/c/signalProcessing/includes/idct.h +++ b/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/src/c/signalProcessing/interfaces/int_dct.h b/src/c/signalProcessing/interfaces/int_dct.h index 6cfb21c..3481c4d 100644 --- a/src/c/signalProcessing/interfaces/int_dct.h +++ b/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/src/c/signalProcessing/interfaces/int_idct.h b/src/c/signalProcessing/interfaces/int_idct.h index c3a174a..f705fe2 100644 --- a/src/c/signalProcessing/interfaces/int_idct.h +++ b/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/src/c/signalProcessing/transforms/dct/sdcta.c b/src/c/signalProcessing/transforms/dct/sdcta.c new file mode 100644 index 0000000..9f380e8 --- /dev/null +++ b/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 */ +#include + +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*/ +#include + +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