summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/iReshape.c
blob: 511a8ed2e5f6954de0895b79819ea91740381672 (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
/********************************
Author: Sravanthi Kota Venkata
********************************/

#include "sdvbs_common.h"

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

    r = in->height;
    c = in->width;
    
    out = iMallocHandle(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;
}