Hi,
I fill in the missing chroma information in here:
j = 0; // Make a copy of Cb and Cr components
// and retrieve the missing pixels
for (i = 0; i < (720*576); i += 2)
{
Y[i] = Ptr[j+1];
Y[i+1] = Ptr[j+3];
Cb[i] = Ptr[j];
temp = (short) Ptr[j] + (short) Ptr[j+4];
Cb[i+1] = (unsigned char) (temp >> 1);
Cr[i] = Ptr[j+2];
temp = (short) Ptr[j+2] + (short) Ptr[j+6];
Cr[i+1] = (unsigned char) (temp >> 1);
j += 4;
}
And thanks for your help,
I change PIXEL_PER_LINE to 864, then in file PPI0_Init.c, I change sizeof(short) to 3
#include "main.h"
/********************************************************************************/
/***** InitPPI0() *****/
/***** PPI0 is configured for video in in 656 mode *****/
/***** This routine configures both the PPI and the associated DMA channel *****/
/***** Supports Entire Field and active video only, as well as 8 and 32 bit *****/
/***** packing according to the input parameters *****/
/***** DMA is setup in descriptor list mode, input is pointer to 1st header *****/
/********************************************************************************/
void InitPPI0(bool entire_field, bool pack32, tDMA_descriptor* First_Header, short pixel, short lines)
{ short transfer_length_bytes = ((pack32) ? 4 : 1);
// configure PPI0 - not enabled yet
*pPPI0_CONTROL = (entire_field << 2) | FLD_SEL | (pack32 << 7)| (pack32 << 8);
*pPPI0_FRAME = lines;
ssync();
// configure DMA for PPI0 - not enabled yet
*pDMA1_0_START_ADDR=0x00;
*pDMA1_0_X_COUNT = pixel * sizeof(short) / transfer_length_bytes; // 2 bytes for each pixel, count divided by four if 32-bit DMA transfers are done
*pDMA1_0_Y_COUNT = lines;
*pDMA1_0_X_MODIFY = transfer_length_bytes;
*pDMA1_0_Y_MODIFY = transfer_length_bytes;
*pDMA1_0_NEXT_DESC_PTR = First_Header;
*pDMA1_0_CONFIG = 0x7000 | 0x0400 | DI_EN | RESTART| DMA2D | (pack32 << 3) | WNR;
ssync();
}
void DisablePPI0(void)
{
// disable transfers
*pPPI0_CONTROL &= ~PORT_EN;
ssync();
*pDMA1_0_CONFIG &= ~DMAEN;
ssync();
}
void EnablePPI0(void)
{
// enable transfers
*pDMA1_0_CONFIG |= DMAEN;
ssync();
*pPPI0_CONTROL |= PORT_EN;
ssync();
}
Now the 1/3 picture that I get is correct and 2/3 still have errors
What do I need to do next ?
Please give me more advices, your advices always help me to solve something.
Thank you once more.