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

📄 umc_vc1_enc_debug.h

📁 audio-video-codecs.rar语音编解码器
💻 H
字号:
/* /////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2007 Intel Corporation. All Rights Reserved.
//
//
//          VC-1 (VC1) encoder, debug functionality
//
*/
#include "umc_defs.h"

#if defined (UMC_ENABLE_VC1_VIDEO_ENCODER)

#ifndef __UMC_VC1_ENC_DEBUG_H__
#define __UMC_VC1_ENC_DEBUG_H__

#include "umc_defs.h"

#include "vm_types.h"
#include "ippdefs.h"

namespace UMC_VC1_ENCODER
{
#ifdef VC1_ENC_DEBUG_ON

extern const Ipp32u  VC1_ENC_DEBUG;             //current debug output
extern const Ipp32u  VC1_ENC_FRAME_DEBUG;       //on/off frame debug
extern const Ipp32u  VC1_ENC_FRAME_MIN;         //first frame to debug
extern const Ipp32u  VC1_ENC_FRAME_MAX;         //last frame to debug

extern const Ipp32u VC1_ENC_POSITION;          //Frame num, frame type, frame size,
                                               //MB, Block positions, skip info
extern const Ipp32u VC1_ENC_COEFFS;            // DC, AC coefficiens
extern const Ipp32u VC1_ENC_AC_PRED;           // AC prediction
extern const Ipp32u VC1_ENC_QUANT;             //quant info
extern const Ipp32u VC1_ENC_CBP;               // coded block patern info
extern const Ipp32u VC1_ENC_MV;                // motion vectors info
extern const Ipp32u VC1_ENC_PRED;



typedef struct
{
    Ipp16s BlockDiff[64];
    Ipp8u  intra;
    Ipp32s DC;
    Ipp32s DCDiff;
    Ipp32s DCDirection;
    Ipp16s AC[7];
    Ipp32s ACPred;

//motion vectors info
    Ipp16s MV[2][2];    //X/Y, forward/backward
    Ipp16s PredMV[2][2]; //X/Y, forward/backward
    Ipp16s difMV[2][2]; //X/Y, forward/backward

//run, level paramc
    Ipp8u  Run  [65];
    Ipp16s Level[64];
    Ipp8u  Pairs[4];
    Ipp8u  Mode[65];

//interpolation info
    Ipp8u  FDst[64];   //forward
    Ipp8u  BDst[64];   //backward
    Ipp8u  FSrc;
    Ipp32s BSrc;

}VC1BlockDebugInfo;

typedef struct
{
    VC1BlockDebugInfo Block[6];
    Ipp32s CBP;
    Ipp32s PredCBP;
    Ipp32s MBType;
    Ipp32s MQuant;
    Ipp8u  HalfQP;
    Ipp8u  skip;
}VC1MBDebugInfo;

class VC1EncDebug
{
public:
    VC1EncDebug();
    ~VC1EncDebug();

    void Init(Ipp32s Width, Ipp32s Height);
    void Close();

    void WriteParams(Ipp32s _cur_frame, Ipp32s level,  vm_char *format,...);
    void WriteFrameInfo();   //wrote debug information
                             //and prepare frame params for next frame

    //Set picture params
    void SetPicType(Ipp32s picType);     //set current picture type
    void SetFrameSize(Ipp32s frameSize); //set currenr frame size
    void NextMB();      //change X, Y MB position

    //run - level params
    void SetRunLevelCoefs(Ipp8u* run, Ipp16s* level, Ipp8u* pairs, Ipp32s blk_num);
    void SetRLMode(Ipp8u mode, Ipp32s blk_num, Ipp32s coef_num);

    //DC, AC coef information
    void SetDCACInfo(Ipp32s ACPred, Ipp16s* pBlock, Ipp32s BlockStep,
                     Ipp16s* pPredBlock, Ipp32s PredBlockStep,
                     Ipp32s direction, Ipp32s blk_num);

    //MV information
    void SetMVInfo(Ipp16s X, Ipp16s Y, Ipp16s XPred, Ipp16s YPred, Ipp32s forward, Ipp32s blk_num);
    void SetMVDiff(Ipp16s DiffX, Ipp16s DiffY, Ipp32s forward, Ipp32s blk_num);

    //block difference
    void SetBlockDifference(Ipp16s** pBlock, Ipp32u* step);

    //MB information
    void SetMBAsSkip();
    void SetMBType(Ipp32s type);

    //intra information
    void SetBlockAsIntra(Ipp32s blk_num);

    //CBP
    void SetCPB(Ipp32s predcbp, Ipp32s cbp);

    //Interpolation Info
    void SetInterpInfo(Ipp8u* pBlock, Ipp32s step, Ipp32s blk_num, Ipp32s forward, Ipp8u src);

    void SetQuant(Ipp32s MQuant, Ipp8u  HalfQP);

private:
    vm_file*  LogFile;
    Ipp32u FrameCount;
    Ipp32u FrameType;
    Ipp32s FrameSize;

    Ipp32s MBHeight; //frame height in macroblocks
    Ipp32s MBWidth;  //frame width in macroblocks

    Ipp32s XPos;      // current MB X position
    Ipp32s YPos;      // current MB Y position

    VC1MBDebugInfo* MBs;
    VC1MBDebugInfo* pCurrMB;

    void PrintBlockDifference(Ipp32s blk_num);
    void PrintInterpolationInfo();
    void PrintMVInfo();
    void PrintRunLevel(Ipp32s blk_num);
};

extern VC1EncDebug *pDebug;

#endif
}//namespace

#endif //__UMC_VC1_ENC_DEBUG_H__

#endif // defined (UMC_ENABLE_VC1_VIDEO_ENCODER)

⌨️ 快捷键说明

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