U および V バッファー オフセットの計算式
-
19-09-2019 - |
質問
何 であるべきです バッファオフセット U と V の値 YUV444 フォーマットタイプ?
たとえば、YV12 形式を使用している場合、値は次のようになります。
ppdata.inputidmachannel.ubufoffset = iinputheight * iinputwidth +(iinputheight * iinputwidth)/4;ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth;
iInputHeight = 160 & iInputWidth = 112
ppdata は、次の構造体のオブジェクトです。
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;
idmaChannel の構造は次のとおりです。
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;
の公式が欲しいです ppData.inputIDMAChannel.UBufOffset & ppData.inputIDMAChannel.VBufOffset のために YUV444
前もって感謝します
解決 2
YUV444は1ピクセルあたり24ビットで構成されているため、
したがって、U & V バッファー オフセットは次のようになります。
ppData.inputIDMAChannel.UBufOffset = iInputHeight * iInputWidth;
ppData.inputIDMAChannel.VBufOffset = 2 * iInputHeight * iInputWidth;
他のヒント
YUV444 がコンポーネントごとに 8 ビットを使用することを考えると、式は単純になるはずだと私には思われます。
ppData.inputIDMAChannel.UBufOffset = 2 * iInputHeight * iInputWidth;
ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth;
所属していません StackOverflow