summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authormaxd <[email protected]>2017-12-04 19:21:03 +0100
committerScott <[email protected]>2017-12-04 18:55:01 +0000
commitd58a91da1b53483fd608cf7a28ac686cc9ef5a65 (patch)
tree2372ba70abad946fa407fb8dfebfd0ebdaf20783 /libhb
parente35ed035e615e6e570cdc3b9c6a4ce9d88f912a5 (diff)
qsv: range as 0-63
Diffstat (limited to 'libhb')
-rw-r--r--libhb/enc_qsv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c
index 228eb401c..05771b7e5 100644
--- a/libhb/enc_qsv.c
+++ b/libhb/enc_qsv.c
@@ -980,18 +980,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
// introduced in API 1.1
// HEVC 10b has QP range as [-12;51]
// with shift +12 needed to be in QSV's U16 range
- unsigned int low_limit = 0;
- unsigned int shift = 0;
+ unsigned int upper_limit = 51;
if (pv->param.videoParam->mfx.CodecProfile == MFX_PROFILE_HEVC_MAIN10)
{
- low_limit = -12;
- shift = 12;
+ upper_limit = 63;
}
pv->param.videoParam->mfx.RateControlMethod = MFX_RATECONTROL_CQP;
- pv->param.videoParam->mfx.QPI = HB_QSV_CLIP3(low_limit, 51, job->vquality + pv->param.rc.cqp_offsets[0]) + shift;
- pv->param.videoParam->mfx.QPP = HB_QSV_CLIP3(low_limit, 51, job->vquality + pv->param.rc.cqp_offsets[1]) + shift;
- pv->param.videoParam->mfx.QPB = HB_QSV_CLIP3(low_limit, 51, job->vquality + pv->param.rc.cqp_offsets[2]) + shift;
+ pv->param.videoParam->mfx.QPI = HB_QSV_CLIP3(0, upper_limit, job->vquality + pv->param.rc.cqp_offsets[0]);
+ pv->param.videoParam->mfx.QPP = HB_QSV_CLIP3(0, upper_limit, job->vquality + pv->param.rc.cqp_offsets[1]);
+ pv->param.videoParam->mfx.QPB = HB_QSV_CLIP3(0, upper_limit, job->vquality + pv->param.rc.cqp_offsets[2]);
// CQP + ExtBRC can cause bad output
pv->param.codingOption2.ExtBRC = MFX_CODINGOPTION_OFF;