This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

convertion from interlaced to progressive

Hello ,

I am trying to convert the interlaced output from CCDC into progressive on DM6437 EVM.

I  tried to implement this by using below function

void process_image( void* currentFrame,  int yRows, int xPixels)  
                 
{
int x = (xPixels * 2);
 int array[480][1440];
 int k;
 int j;

  for (j=0;j < x;j++)
  {
   for (k= 0; k < yRows ;k=k+2)
   {
     array[k][j] = (currentFrame[k][j]+currentFrame[k+1][j])/2;
     currentFrame[k][j] = array[k][j];
     currentFrame[k+1][j]= array[k][j];
   }
  }
 
}.

 

But here ia  getting error :   "video_preview.c", line 281: error: expression must be a pointer to a complete object type.

can i access the pixels of the framepointerbuffer like this ?

Can someone help me in this..?

 

  • The reason for your error is that you are trying to use a void* directly. Try casting it to a typed pointer before using it, like:

    void process_image(void* pCurrFrame, int yRows, int xPixels)
    {
    int* currentFrame = (int*)pCurrFrame;

    /* and then the rest of your function */
    }

     

    Good luck,

    Dennis

  • I tried to implement the same.. but still iam getting below error:

    "video_preview.c", line 288: error: expression must have pointer-to-object type
    "video_preview.c", line 288: error: expression must have pointer-to-object type
    "video_preview.c", line 289: error: expression must have pointer-to-object type
    "video_preview.c", line 290: error: expression must have pointer-to-object type

  • In general I would suggest using the pointer directly as done in the example instead of mapping it into an array (you just add a value to the pointer instead of specifying array dimensions), I suspect you could still do it this way with proper typecasting though.

    Another warning on this, you are trying to allocate a very large array in a function, meaning it will be a local array which has to fit on the stack, this can be ok if you have a sufficiently large stack but in general for embedded setups you may want to make this a global scratch buffer so it is not taking up massive stack space. Also note that the values in the image are actually byte values as opposed to int values so you would probably want 'char array[480][1440]' or alternatively 'short array [480][720]' if you want to look at each pixel instead of each luma and chroma sample.