📄 umc_h264_avbr.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) 2006-2007 Intel Corporation. All Rights Reserved.
//
// Purpose
// AVBR frame adaptive bitrate control
*/
#include "ippdefs.h"
#include "umc_defs.h"
#include "umc_structures.h"
#include "umc_h264_pub.h"
namespace UMC_H264_ENCODER {
class H264_AVBR
{
protected :
Ipp32s mBitRate, mBitsDesiredFrame;
Ipp64s mBitsEncodedTotal, mBitsDesiredTotal;
Ipp8u *mRCqb;
Ipp32s mRCqh, mRCqs, mRCbf, mRClen;
bool mIsInit;
Ipp32s mQuantI, mQuantP, mQuantB, mQuantMax, mQuantPrev, mQuantOffset;
Ipp32s mMethod, mRCfap, mRCqap, mRCbap, mRCq;
Ipp64f mRCqa, mRCfa;
public :
H264_AVBR();
~H264_AVBR();
UMC::Status Init(Ipp32s histLen, Ipp32s bitRate, Ipp64f frameRate, Ipp32s fWidth, Ipp32s fHeight, Ipp32s bitDepth, Ipp32s chromaSampling, Ipp32s alpha);
UMC::Status Init(Ipp32s qas, Ipp32s fas, Ipp32s bas, Ipp32s bitRate, Ipp64f frameRate, Ipp32s fWidth, Ipp32s fHeight, Ipp32s bitDepth, Ipp32s chromaSampling, Ipp32s alpha);
void Close();
void PostFrame(EnumPicCodType frameType, Ipp32s bpfEncoded);
Ipp8u GetQP(EnumPicCodType frameType);
void SetQP( EnumPicCodType frameType, Ipp32s qp );
Ipp32s GetInitQP(Ipp32s bitRate, Ipp64f frameRate, Ipp32s fWidth, Ipp32s fHeight, Ipp32s bitDepth, Ipp32s chromaSampling, Ipp32s alpha);
};
#define h264_Clip(a, l, r) if (a < (l)) a = l; else if (a > (r)) a = r
#define h264_ClipL(a, l) if (a < (l)) a = l
#define h264_ClipR(a, r) if (a > (r)) a = r
#define h264_Abs(a) ((a) >= 0 ? (a) : -(a))
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -