⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmdlmbs2_local.h

📁 PNX1500上做视频缩放MBS的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:

} tmdlMbsUpdateFlags_t;

//-----------------------------------------------------------------------------
// Types:
//-----------------------------------------------------------------------------

union _mbsLoadRegsOpcode
{
#if (TMFL_ENDIAN == TMFL_ENDIAN_BIG)
    struct
    {
        unsigned long count  : 8;
        unsigned long : 4;
        unsigned long mask   : 4;
        unsigned long : 4;
        unsigned long index  : 10;
        unsigned long opcode : 2;
    } bits;
#else
    struct
    {
        unsigned long opcode : 2;
        unsigned long index  : 10;
        unsigned long : 4;
        unsigned long mask   : 4;
        unsigned long : 4;
        unsigned long count  : 8;
    } bits;
#endif
    unsigned long u32;
};

union _mbsLinkOpcode
{
#if (TMFL_ENDIAN == TMFL_ENDIAN_BIG)
    struct
    {
        unsigned long offset : 23;
        unsigned long : 1;
        unsigned long opcode : 2;
    } bits;
#else
    struct
    {
        unsigned long opcode : 2;
        unsigned long : 1;
        unsigned long offset : 23;
    } bits;
#endif
    unsigned long u32;
};


union _mbsHorzScaleInfo_t
{
    struct
    {
        unsigned long dto_offset : 14;
        unsigned long            : 2;
        unsigned long nr_taps    : 8;
        unsigned long            : 8;
    } bits;
    unsigned long u32;
};

union _mbsVertScaleInfo_t
{
    struct
    {
        unsigned long dto_offset_l  : 14;
        unsigned long dto_offset_c  : 6;
        unsigned long nr_taps       : 4;
        unsigned long prev_first    : 1;
        unsigned long               : 7;
    } bits;
    unsigned long u32;
};

typedef union _tmdlMbsFormatInfo_t
{
    struct
    {
        UInt32  Yuv420          :   1;  //  format is a YUV 420 format
        UInt32  YuvPair         :   1;  //  format is a YUV 422/420 format
        UInt32  rgb             :   1;  //  format is RGB
        UInt32  singleField     :   1;  //  buffer is single field
        UInt32  comps           :   4;  //  components
        UInt32  planes          :   4;  //  buffer planes
        UInt32  buffers         :   4;
        UInt32  bppYRGB         :   8;
        UInt32  bppUV           :   8;
    } bits;

    UInt32  u32;

} tmdlMbsFormatInfo_t;

//  information stored for each task

typedef struct _tmdlMbsTaskInfo_t
{
    Bool                        empty;
    tmdlMbsTaskHandle_t         taskHandle;

    tmInstance_t                vidMeasInstance;

    struct _tmdlMbsTaskInfo_t   *pLinkedTask;   // pointer to a linked task

    tmCallback_t                pCallback;      // callback function
    UInt32                      userData;       // data returned to callback
    UInt32                      eventMask;      // event mask for callback
    tmdlMbsTaskStatus_t         taskStatus;     // task status info

    Bool                        abortTask;
    Bool                        internallySliced;
    tmRect_t                    internalSliceRect;
    UInt32                      taskBase;       // phys offset of task commands
    pUInt32                     pCtrlRegs;      // ptr to control reg cmds

    // ------------------------------------------------------------------------
    //  the next group of pointers need to be updated during tmdlMbsTaskCopy

    pUInt32                     pMeasRegs;      // ptr to meas reg commands
    pUInt32                     pNextCmd;       // ptr to place next command
    pUInt32                     pAfterBaseCmds; // ptr to start links

    pUInt32                     pUVcoeffLink;   // ptr to UV coeff link cmd
    pUInt32                     pUVcoeffLoad;   // ptr to UV coeff load cmd

    pUInt32                     pHorzCoeff;     // ptr to horz coeff in tl
    UInt32                      horzCoeffs;     // number of coefficients
    pUInt32                     pVertYcoeff;    // ptr to vert Y coeff in tl
    pUInt32                     pVertUVcoeff;   // ptr to vert UV coeff in tl
    UInt32                      vertCoeffs;     // number of coefficients

    // ------------------------------------------------------------------------
    //  the members below are copied from srcTask to dstTask in tmdlMbsTaskCopy

    UInt32                      updateFlags;
    tmdlMbsTaskPriority_t       priority;
// eh04#468
        Bool                        clockFreqUpdate; // Indicator for clock update.
        tmdlMbs2_clockFreq_t        clockFreq;       // Clock Freq for this task.
// eh04#468 END

    tmdlMbsTaskDescriptor_t     dlTaskDescr;    // dl task descriptor

    tmdlMbsFilterSetup_t        hFilterSetup;
    tmdlMbsFilterSetup_t        vFilterSetup;

    UInt32                      iffMode;        // store for base iff & dff
    UInt32                      dffMode;        //  mode values

    Bool                        dynamicZoom;

        // values to modify the scaling in case of transposed filtering
        Int32                       transSrcHorzShift;  // change in left coordinate for transposed filtering
        Int32                       transSrcSizeShift;  // change in size for transposed filtering
        Int32                       transSrcPhaseShift; // phase shift change for transposed filtering
    //  values used to support AntiAging

    Int32                       horzOutputShift;// in 64ths of a pixel
    Int32                       horzShift;      // pixel shift for rect
    Bool                        bBumpX;         // add extra pixel at right
    Int32                       vertOutputShift;// in 64ths of a line
    Int32                       vertShift;      // line shift for rect
    Bool                        bBumpY;         // add extra line at bottom

    tmdlMbsEddiSetup_t          eddiSetup;      // EDDI setup
    tmdlMbsDeInterMode_t        diMode;         // deinterlace mode
    tmdlMbsMsa3Ctrl_t           msa1Ctrl_t;     // control params for MSA3
                                                //  dynamic mode
    UInt32                      measFlags;      // measurement flags
    UInt32                      intMeasFlags;   // copy used for interrupts
    tmdlVidMeasSetup_t          userMeasSetup;  // user measurement setup
    tmdlVidMeasSetup_t          measSetup;      // our measurement setup
    ptmdlVidMeasurements_t      pMeasBuffer;    // ptr to measurement buffer
    UInt32                      blkBarAdjust;   // adjustment for black bar
                                                // values when slicing
    tmRect_t                    srcClipRect;    // src clip rectangle
                                                //  for measurement windows
    union _mbsHorzScaleInfo_t   horzScaleInfo;  // stored scaling information
    union _mbsVertScaleInfo_t   vertScaleInfo;

    tmdlMbsFormatInfo_t         srcFormatInfo;  // buffer format info
    tmdlMbsFormatInfo_t         dstFormatInfo;

    UInt32                      vertScaleComps;
    UInt32                      horzScaleComps;
    tmdlMbsPhaseCorrType_t      phaseCorrReqd;  //  phase correction needed

    UInt32                      sliceInfo;      //  slice position/info bits

    tmAvPhysBuffer_t            buf1InOffsets;  //  offset into buffers due
    tmAvPhysBuffer_t            buf2InOffsets;  //  to rectangles/slicing
    UInt32                      buf3InOffset;   
    tmAvPhysBuffer_t            buf1OutOffsets;
    tmAvPhysBuffer_t            buf2OutOffsets;
    Bool                        inYbufferSwap;  //  double buffering,
    Bool                        inUVbufferSwap; //  buffer swap
    Bool                        outBufferSwap;

    UInt32                      tlSize;         //  size in bytes of the main
                                                //  register portion of the 
                                                //  task list
    UInt32                      lastMember;     //  this must be the last
                                                //  member in the struct,
                                                //  used for tmdlMbsTaskCopy

} tmdlMbsTaskInfo_t, *ptmdlMbsTaskInfo_t;


typedef struct _tmdlClutModuleInfo_t
{
    Bool         empty;
    tmColor4_t   colorTable[256];     // CLUT
    UInt32       nrOfEntries;         // nr of table entries

} tmdlClutModuleInfo_t, *ptmdlClutModuleInfo_t;

//  instance information

typedef struct _tmdlMbsInstance_t
{
    UInt32                  key;        // magic key number to identify instance
    tmUnitSelect_t          unit;       // associated MBS unit
    UInt32                  features;   // features present

    tmInstance_t            vidMeasInstance;
    tmmlMmspHandle_t        mbsMemSpace;// memory memspace handle
    UInt32                  virt2physOffset;
    UInt32                  dmaBase;    // DMA base for MBS HW block
    UInt32                  cpuId;      // CPU ID of used CPU for this instance
    tmdlMbsInstanceSetup_t  setup;      // setup values
    Bool                    setupDone;  // True if instance has been setup yet 
    ptmdlMbsTaskInfo_t      pTaskInfo;  // task info
    ptmdlClutModuleInfo_t   pClutInfo;  // clut info 
    pVoid                   ptlMemory;  // task list memory
    Bool                    streamMode; // True if in stream mode
    Bool                    useVidMeas; // using video measurement
    UInt32                  nrOfSlicedTasks;  // number of tasks required for max res.
        UInt32                  maxInternalSliceVerticalSize;
    UInt32                  totalNrOfTasks;   // max number of user & internal tasks

} tmdlMbsInstance_t, *ptmdlMbsInstance_t;

//  
//  Color Space Conversion
//  -----------------------
//
//  a = input value
//  a'= output value
//  m = -1, if negativeEn = True, (compensates that coefficients 
//                                had been pre-multiplied with -1)
//  m = 1,  if negativeEn = False
//
//  shift = quantization shift, used if "schoolbook" coefficients exceed
//      [-1...1[ area, or the offsets exceed [-128..128[ 
//
//  the color space conversion matrix is defined as:
//
//  out            coeff       in+offs final-offset
//            /                              \
//  [a0']    | [c00 c01 c02]   [a0+d0]   [e0] |        
//  [a1'] =  | [c20 c11 c12] x [a1+d1] + [e1] | * m * (1 >> shift) 
//  [a2']    | [c20 c11 c22]   [a2+d2]   [e2] |
//            \                              /
//
//  with   -512 <=  cXX  <  512, (cXX = 512 * coeffXX / (1 >> shift))
//         -128 <=  dX   <  256,
//         -512 <=  eX   <  512, (eX = 4 * final-offsetXX / (1 >> shift)) 
//          -3  <= shift <  2
//
// example: YCbCr to RGB
//
//  Y  =  0.257 * R + 0.504 * G + 0.098 * B + 16
//  Cb = -0.148 * R - 0.291 * G + 0.439 * B + 128
//  Cr =  0.439 * R - 0.368 * G - 0.071 * B + 128
//
//  because e1 and e2 would exceed 127.75, we need to set shift = 1 (for * 2)
//  and divide the cXX and eX values by 2.
//
//  shift = 1
//  c00 = 512 *  0.257 / 2  c01 = 512 *  0.504 / 2  c02 = 512 *  0.098 / 2
//  c10 = 512 * -0.148 / 2  c11 = 512 * -0.291 / 2  c12 = 512 *  0.439 / 2
//  c20 = 512 *  0.439 / 2  c21 = 512 * -0.368 / 2  c22 = 512 * -0.071 / 2
//  d0  = 0                 d1  = 0                 d2  = 0
//  e0  = 4 * 16 / 2        e1  = 4 * 128 / 2       e2  = 4 * 128 / 2
//  negativeEn = False

typedef struct _tmhwMbsConvMatrix_t         // CSC-Matrix coeffs
{                                       
    Int32  c[3][3];                         // -512..511 representing -1..1
    Int32  d[3];                            // -128..255
    Int32  e[3];                            // -512..511 representing -128..127.75
    Int32  shift;                           //  -3..2  (negative = shift left)
    Bool   negativeEn;                      // True: c coeffs are negative

} tmdlMbsConvMatrix_t, *ptmdlMbsConvMatrix_t;


#ifdef __cplusplus
}
#endif

#endif // TMDL_MBS2_LOCAL_H


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -