From 880ccf4e972d3050c8e6109cdf243fd3d0d307f7 Mon Sep 17 00:00:00 2001 From: Bradley Sepos Date: Sat, 9 Sep 2023 21:24:09 -0400 Subject: [PATCH] libhb: Refactor VCN AV1 quality offset taper. Same result with the default parameters, now correct with others. --- libhb/encavcodec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index cb05ee51e4e7..2654a5a25e3f 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -846,14 +846,15 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) char quality[7]; char qualityP[7]; char qualityB[7]; + double qualityOffsetThreshold = 32; double qualityOffsetP = 8; double qualityOffsetB; double adjustedQualityP; double adjustedQualityB; - if (job->vquality <= 32) + if (job->vquality <= qualityOffsetThreshold) { - qualityOffsetP = job->vquality / qualityOffsetP * 2; + qualityOffsetP = job->vquality / qualityOffsetThreshold * qualityOffsetP; } qualityOffsetB = qualityOffsetP * 2;