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.

There is a problem with SWOSD. (How create yuv buffer, and why blur edge in uv buffer....?)

Hi everyone!

- Capture format video UYVY;

- Resizer video YUV420 NV12;

- my resolution 736x480;

- my resolution window in swosd 128x96;

How create Y buffer (luma buffer) and UV buffer (chroma buffer)?

My code:

......

line_offset_y = ( yLinePos * SWOSD_CharWidthLine_128_96 ) + xLinePos;
line_offset_uv = ( yLinePos/2 * SWOSD_CharWidthLine_128_96 ) + xLinePos;

.....

for( yPos = 0; yPos < 24; yPos++ ){
   for( xPos = 0; xPos < 24; xPos++ ){
      lineBuff_Y[line_offset_y + 0] = 0x29;
      line_offset_y++;
   }
line_offset_y += SWOSD_CharWidthLine_128_96 - 24;
}

for( yPos = 0; yPos < 10; yPos++ ){
   for( xPos = 0; xPos < 10; xPos++ ){
      lineBuff_UV[line_offset_uv + 27 + xPos] = 0xF0; //Cb
      lineBuff_UV[line_offset_uv + 58 + xPos + 1] = 0xF0; //Cr
      line_offset_uv++;
   }
line_offset_uv += SWOSD_CharWidthLine_128_96 - 10;
}

My result this code:

What's the trouble?

Please help me in solving this problem! Thank you in advance.

  • Hi guys!

    ... a little clarification to allocation buffer:

    ...

    cmem_params.type = CMEM_HEAP;
    cmem_params.flags = CMEM_NONCACHED;
    cmem_params.alignment = 32;

    ...

    lineBuff_Y = (char *)CMEM_alloc( (SWOSD_CharWidthLine_128_96 * SWOSD_CharHeightLine_128_96), &cmem_params );
    memset( lineBuff_Y, 0, (SWOSD_CharWidthLine_128_96 * SWOSD_CharHeightLine_128_96) );
    lineBuff_UV = (char *)CMEM_alloc( ((SWOSD_CharWidthLine_128_96 * SWOSD_CharHeightLine_128_96)/2), &cmem_params );
    memset( lineBuff_UV, 0, ((SWOSD_CharWidthLine_128_96 * SWOSD_CharHeightLine_128_96)/2) );

    ... please help me in solving this problem!

    Thank you in advance, with respect, Vladimir.