Formulae for U and V buffer offset
Posted
by Abhi
on Stack Overflow
See other posts from Stack Overflow
or by Abhi
Published on 2010-03-12T07:31:09Z
Indexed on
2010/03/12
7:37 UTC
Read the original article
Hit count: 259
Hi all !
What should be the buffer offset value for U & V in YUV444 format type?
Like for an example if i am using YV12 format the value is as follows:
ppData.inputIDMAChannel.UBufOffset = iInputHeight * iInputWidth + (iInputHeight * iInputWidth)/4; ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth;
iInputHeight = 160 & iInputWidth = 112
ppdata is an object for the following structure:
typedef struct ppConfigDataStruct
{
//---------------------------------------------------------------
// General controls
//---------------------------------------------------------------
UINT8 IntType;
// FIRSTMODULE_INTERRUPT: the interrupt will be
// rised once the first sub-module finished its job.
// FRAME_INTERRUPT: the interrput will be rised
// after all sub-modules finished their jobs.
//---------------------------------------------------------------
// Format controls
//---------------------------------------------------------------
// For input
idmaChannel inputIDMAChannel;
BOOL bCombineEnable;
idmaChannel inputcombIDMAChannel;
UINT8 inputcombAlpha;
UINT32 inputcombColorkey;
icAlphaType alphaType;
// For output
idmaChannel outputIDMAChannel;
CSCEQUATION CSCEquation; // Selects R2Y or Y2R CSC Equation
icCSCCoeffs CSCCoeffs; // Selects R2Y or Y2R CSC Equation
icFlipRot FlipRot; // Flip/Rotate controls for VF
BOOL allowNopPP; // flag to indicate we need a NOP PP processing
}*pPpConfigData, ppConfigData;
and idmaChannel structure is as follows:
typedef struct idmaChannelStruct
{
icFormat FrameFormat; // YUV or RGB
icFrameSize FrameSize; // frame size
UINT32 LineStride;// stride in bytes
icPixelFormat PixelFormat;// Input frame RGB format, set NULL
// to use standard settings.
icDataWidth DataWidth;// Bits per pixel for RGB format
UINT32 UBufOffset;// offset of U buffer from Y buffer start address
// ignored if non-planar image format
UINT32 VBufOffset;// offset of U buffer from Y buffer start address
// ignored if non-planar image format
} idmaChannel, *pIdmaChannel;
I want the formulae for ppData.inputIDMAChannel.UBufOffset & ppData.inputIDMAChannel.VBufOffset for YUV444
Thanks in advance
© Stack Overflow or respective owner