summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/fReshape.c
blob: a078826d25616660e32e64b4a6a043d6a2ed66f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/********************************
Author: Sravanthi Kota Venkata
********************************/

#include "sdvbs_common.h"

F2D* fReshape(F2D* in, int rows, int cols)
{
    F2D *out;
    int i, j, k;
    int r, c;

    r = in->height;
    c = in->width;
    
    out = fMallocHandle(rows, cols);
    
    k = 0;
    for(i=0; i<c; i++) {
        for(j=0; j<r; j++) {
            asubsref(out,k++) = subsref(in,j,i);
		}
   	} 
    return out;
}