Advertisement
lamiastella

gcov result

Jun 22nd, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.33 KB | None | 0 0
  1.         -:    0:Source:common/calcSobel_dY.c
  2.         -:    0:Graph:calcSobel_dY.gcno
  3.         -:    0:Data:calcSobel_dY.gcda
  4.         -:    0:Runs:1
  5.         -:    0:Programs:1
  6.         -:    1:/********************************
  7.         -:    2:Author: Sravanthi Kota Venkata
  8.         -:    3:********************************/
  9.         -:    4:
  10.         -:    5:#include "sdvbs_common.h"
  11.         -:    6:
  12.         9:    7:F2D* calcSobel_dY(F2D* imageIn)
  13.         -:    8:{
  14.         -:    9:    int rows, cols;
  15.         -:   10:    I2D *kernel_1, *kernel_2;
  16.         -:   11:    float temp;
  17.         -:   12:    int kernelSize, startCol, endCol, halfKernel, startRow, endRow, i, j, kernelSum;
  18.         -:   13:    int k, kernelSum_2, outputRows, outputCols;
  19.         -:   14:    F2D *imageOut, *tempOut;
  20.         -:   15:    float kernelSum_1;
  21.         -:   16:
  22.         9:   17:    rows = imageIn->height;
  23.         9:   18:    cols = imageIn->width;
  24.         -:   19:    
  25.         -:   20:    // level 1 is the base image.
  26.         -:   21:
  27.         -:   22:    outputRows = rows;
  28.         -:   23:    outputCols = cols;
  29.         -:   24:
  30.         9:   25:    imageOut = fSetArray(outputRows, outputCols, 0);
  31.         9:   26:    tempOut = fSetArray(outputRows, outputCols, 0);
  32.         9:   27:    kernel_1 = iMallocHandle(1, 3);
  33.         9:   28:    kernel_2 = iMallocHandle(1, 3);
  34.         -:   29:
  35.         9:   30:    asubsref(kernel_1,0) = 1;
  36.         9:   31:    asubsref(kernel_1,1) = 0;
  37.         9:   32:    asubsref(kernel_1,2) = -1;
  38.         -:   33:    kernelSize = 3;
  39.         -:   34:    kernelSum_1 = 2.0;
  40.         -:   35:    
  41.         9:   36:    asubsref(kernel_2,0) = 1;
  42.         9:   37:    asubsref(kernel_2,1) = 2;
  43.         9:   38:    asubsref(kernel_2,2) = 1;
  44.         -:   39:    kernelSum_2 = 4;
  45.         -:   40:
  46.         -:   41:    startCol = 1;
  47.         9:   42:    endCol = cols - 1;
  48.         -:   43:    halfKernel = 1;
  49.         -:   44:
  50.         -:   45:    startRow = 1;
  51.         9:   46:    endRow = rows - 1;
  52.         -:   47:
  53.      7551:   48:    for(i=startRow; i<endRow; i++)
  54.         -:   49:    {
  55.  12399636:   50:        for(j=startCol; j<endCol; j++)
  56.         -:   51:        {
  57.         -:   52:            temp = 0;
  58.  37198908:   53:            for(k=-halfKernel; k<=halfKernel; k++)
  59.         -:   54:            {
  60.  37198908:   55:                temp += subsref(imageIn,(i+k),j) * asubsref(kernel_1,k+halfKernel);
  61.         -:   56:            }
  62.  12399636:   57:            subsref(tempOut,i,j) = temp/kernelSum_1;
  63.         -:   58:        }
  64.         -:   59:    }
  65.         -:   60:
  66.      7542:   61:    for(i=startRow; i<endRow; i++)
  67.         -:   62:    {
  68.  12399636:   63:        for(j=startCol; j<endCol; j++)
  69.         -:   64:        {
  70.         -:   65:            temp = 0;
  71.  37198908:   66:            for(k=-halfKernel; k<=halfKernel; k++)
  72.         -:   67:            {
  73.  37198908:   68:                temp += subsref(tempOut,i,j+k) * asubsref(kernel_2,k+halfKernel);
  74.         -:   69:            }
  75.  12399636:   70:            subsref(imageOut,i,j) = temp/(float)kernelSum_2;
  76.         -:   71:        }
  77.         -:   72:    }
  78.         -:   73:
  79.         9:   74:    fFreeHandle(tempOut);
  80.         9:   75:    iFreeHandle(kernel_1);
  81.         9:   76:    iFreeHandle(kernel_2);
  82.         9:   77:    return imageOut;
  83.         -:   78:    
  84.         -:   79:}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement