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.

Is there any example of image processing on DM648?

Hi

I am using DM648 EVM. this evm support NTSC input,output from camera to monitor.

I have tried image processing with this BT656 data. (rotate an image and 4 images into one frame 704 *480)

I still dont find any answer.  could anyone know where can i find example to solve above problem?

 

My work flowchart is

1) ' get BT656 data from framepointer = (capChInfo[count].frame->frame.frameBufferPtr);   '

2) put Ydata into Ybuffer,    put CBdata into CBbuffer ,   put CRdata into CRbuffer.   (Ybuffer, CBbuffer, CRbuffer are just variable)

3) change resolution, rearrange position of images.(several images into one buffer and make one frame)

4) display TV monitor

 

I did 1) and 2) section and tried to put '0' value to each Y,CB,CR buffer. 

Actually It has to be nothing on the TV screen, However, it displays images just like normal.

 

What is the problem? I am desperate. please help me.

 

 

  • If your video data is being put in the DDR2 memory using EDMA and you're doing all the manipulations with the CPU then you will need to manage a couple user-initiated cache operations.  The procedure for processing a frame should look like this:

    1. Manually cache-invalidate buffer before reading from it (make sure you're getting fresh data, not reusing the last frame).
    2. Do your processing.
    3. Manually cache-writeback buffer once you're done writing to it (so the data gets pushed back out to DDR2 where the EDMA will copy it to the video port).

     

  • Thank you for reply.

    I am using psp_driver example which is called psp_bios_vport_sd_compositor.

    In there, the code already has declaration of cache-invalidate function and write-back. I just put my own function between them like below code.

    Did I miss something in there? 

     

               for (count = 0; count < numCapChannel; count++)
                {
                    /* Invalidate the buffer before giving to capture driver */
                    BCACHE_inv((Uint8 *)capChInfo[count].frame->frame.iFrm.y1, (CAP_FRAME_SIZE),TRUE);

                    /* Capture buffer will return the latest captured buffer */
                    status |= FVID_exchange(capChInfo[count].chanHandle, &(capChInfo[count].frame));
          
                     /////////////   my code   /////////////
                    framepointer = (capChInfo[count].frame->frame.frameBufferPtr);
        

                    Make_Image_Buffer();  //  make each buffer dir       

                    //////////////////////////////////////////////      
                }

                 video_compositor(&disChInfo, &capChInfo[0], numCompositorChannel,  DIS_NUMPIXELS,  DIS_NUMLINES,  capNumPixels,  CAP_NUMLINES);             /* inNumLines */


                /* Flush and invalidate the processed buffer so that the EDMA reads
                   the processed data */
                BCACHE_wbInv((Uint8 *)disChInfo.frame->frame.iFrm.y1,   DIS_FRAME_SIZE,TRUE);

                status |= FVID_exchange(disChInfo.chanHandle, &(disChInfo.frame));

  • this is Make_Image_Buffer() code.  code size is big. I just cut out key part.

    void Make_Image_Buffer()
    {
      unsigned int i=0,i1 = 0,i2 = 0, i3 = 0,j=0,j1=0,j2=0;
      unsigned int Yi1=0,Yj1=0,Yi2=0,Yj2=0,Yi3=0,Yj3=0,Yi4=0,Yj4=0;
      unsigned int CBi1=0,CBj1=0,CBi2=0,CBj2=0,CBi3=0,CBj3=0,CBi4=0,CBj4=0;
      unsigned int CRi1=0,CRj1=0,CRi2=0,CRj2=0,CRi3=0,CRj3=0,CRi4=0,CRj4=0;

      unsigned int Fcnt = 0;


     
      for(Fcnt = 0; Fcnt < CAP_NUMPIXELS * CAP_NUMLINES; Fcnt++)
      {
        // 4 each Y data buffer
                                   //  704             240
       if(Fcnt < (CAP_NUMPIXELS * CAP_NUMLINES)/2 )
       {

         if(Fcnt < (CAP_NUMPIXELS * Yi1) + (CAP_NUMPIXELS/2) && Yi1 < (CAP_NUMLINES/2) )   // BOX 1
         {
           Ybuffer1[Yi1][Yj1] = (unsigned int) *(framepointer + Fcnt);

           *(framepointer + Fcnt) =   0 ;    ---->  for test to display ,     
       
            if(Yj1 < CAP_NUMPIXELS / 2)
           {
              Yj1++;
            }
            else
           {
             Yj1 = 0;
             Yi1++;
           }
         }