Pregunta

¿Qué debería ser el desplazamiento de búfer valor para U y V en YUV444 tipo de formato?

Como por ejemplo, si estoy usando el formato YV12 el valor es el siguiente:

  

ppData.inputIDMAChannel.UBufOffset =   iInputHeight * + iInputWidth   (IInputHeight * iInputWidth) / 4;       ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth;

iInputHeight = 160 y iInputWidth = 112

ppData es un objeto para la siguiente estructura:

    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;

y la estructura idmaChannel es como sigue:

 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;

Quiero que las fórmulas para ppData.inputIDMAChannel.UBufOffset & ppData.inputIDMAChannel.VBufOffset YUV444

Gracias de antemano

¿Fue útil?

Solución 2

Desde YUV444 consisten de 24 bits por pixel

Por lo tanto el desplazamiento U & V tampón será

ppData.inputIDMAChannel.UBufOffset = iInputHeight * iInputWidth;
ppData.inputIDMAChannel.VBufOffset = 2 * iInputHeight * iInputWidth;

Otros consejos

Dado que YUV444 utiliza 8 bits por componente, me parece que las fórmulas deben ser sencillo:

ppData.inputIDMAChannel.UBufOffset = 2 * iInputHeight * iInputWidth;
ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top