الصيغ لأجهزة إزاحة U و V العازلة
-
19-09-2019 - |
سؤال
ماذا يجب أن يكون العازلة تعويض القيمة ل u & v في yuv444. نوع التنسيق؟
مثل للحصول على مثال إذا كنت أستخدم تنسيق YV12، فإن القيمة هي كما يلي:
ppdata.inputidmachannel.ubufoffet = iinputheight * iinputwidth + (iinputheight * iinputwidth) / 4؛ ppdata.inputidmachannel.vbufoffet = 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.ubufoffet. & ppdata.inputidmachannel.vbufoffet. بالنسبة yuv444.
شكرا مقدما
المحلول 2
منذ YUV444 تتكون من 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