#define COLOR_LEVELS 30
typedef struct tag_INFO_BLOCK
{
unsigned short** correlogram;
}INFO_BLOCK, BLOCK_INFO;
BLOCK_INFO* newv_Blocks (int n)
{
int k,j;
BLOCK_INFO* ptr;
ptr = malloc(sizeof(BLOCK_INFO)*n);
if (ptr == NULL)
{
printf("Error: v_Block not allocated\n");
return ptr;
}
else
{
for (k=0;k<n;k++)
{
//ptr[k].correlogram = newShortMatrix();
ptr[k].correlogram=(unsigned short**)malloc(sizeof(unsigned short*)*COLOR_LEVELS);
for (j=0;j<COLOR_LEVELS;j++){
ptr[k].correlogram[j]=malloc(COLOR_LEVELS*sizeof(unsigned short));
if(!ptr[k].correlogram[j])
{
printf("\nMemory allocation failed for info");
exit(2);
}
}
}
}
reset_v_Blocks(ptr,n);
return ptr;
}