Skip to content

Commit

Permalink
hrdを設定するオプションを追加。(--enforce-hrd)
Browse files Browse the repository at this point in the history
こちら( GPUOpen-LibrariesAndSDKs/AMF#73 / #1 )に報告のあったように、
現状のAMFではこのオプションを使用するとHEVCエンコード時にレート制御が不安定になることから、
デフォルトではオフとする。
  • Loading branch information
rigaya committed Feb 13, 2017
1 parent 75c4125 commit 664ebb0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VCECore/VCECore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,8 @@ AMF_RESULT VCECore::initEncoder(VCEParam *prm) {
m_Params.SetParam(AMF_PARAM_VBV_BUFFER_SIZE(prm->nCodecId), (amf_int64)prm->nVBVBufferSize * 1000);
m_Params.SetParam(AMF_PARAM_INITIAL_VBV_BUFFER_FULLNESS(prm->nCodecId), (amf_int64)prm->nInitialVBVPercent);

m_Params.SetParam(AMF_PARAM_ENFORCE_HRD(prm->nCodecId), true);
//m_Params.SetParam(AMF_PARAM_FILLER_DATA_ENABLE(prm->nCodecId), false);
m_Params.SetParam(AMF_PARAM_ENFORCE_HRD(prm->nCodecId), prm->bEnforceHRD != 0);
if (prm->bVBAQ) m_Params.SetParam(AMF_PARAM_ENABLE_VBAQ(prm->nCodecId), true);
m_Params.SetParam(AMF_PARAM_SLICES_PER_FRAME(prm->nCodecId), (amf_int64)prm->nSlices);
m_Params.SetParam(AMF_PARAM_GOP_SIZE(prm->nCodecId), (amf_int64)nGOPLen);
Expand Down
2 changes: 2 additions & 0 deletions VCECore/VCEParam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ void init_vce_param(VCEParam *prm) {
prm->vui.transfer = get_value_from_chr(list_transfer, _T("undef"));
prm->vui.fullrange = false;
prm->vui.infoPresent = false;

prm->bEnforceHRD = FALSE;
}
2 changes: 1 addition & 1 deletion VCECore/VCEParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ typedef struct {
int nBframes;
int bBPyramid;
int nMotionEst;
int bEnforceHDR;
int bEnforceHRD;
int nIDRPeriod;
int nGOPLen;
const TCHAR *pInputFile;
Expand Down
6 changes: 6 additions & 0 deletions VCEEncC/VCEEncC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ static tstring help() {
_T("\n")
_T(" --crop <int>,<int>,<int>,<int>\n")
_T(" set crop pixels of left, up, right, bottom.\n")
_T("\n")
_T(" --enforce-hrd enforce hrd compatibility of bitstream\n")
);
//str += PrintListOptions(_T("--videoformat <string>"), list_videoformat, 0);
//str += PrintListOptions(_T("--colormatrix <string>"), list_colormatrix, 0);
Expand Down Expand Up @@ -1519,6 +1521,10 @@ int ParseOneOption(const TCHAR *option_name, const TCHAR* strInput[], int& i, in
return 0;
}
#endif
if (IS_OPTION("enforce-hrd")) {
pParams->bEnforceHRD = TRUE;
return 0;
}
if (IS_OPTION("log")) {
i++;
pParams->pStrLogFile = _tcsdup(strInput[i]);
Expand Down

0 comments on commit 664ebb0

Please sign in to comment.