[x265] [PATCH 3 of 3 STABLE] weightp: use source reference frames for weight analysis
Steve Borho
steve at borho.org
Fri Oct 25 00:17:59 CEST 2013
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1382652362 18000
# Thu Oct 24 17:06:02 2013 -0500
# Branch stable
# Node ID a44b48b74d6fa51712c86eec38df0c2f9c5428ee
# Parent 0315cf14dedaaf53b388105fb7744f9a44ae65c0
weightp: use source reference frames for weight analysis
This fixes weightp when used in combination with frame parallelism, where the
reference's reconstructed picture is most likely not yet avaialable.
Some measurements using the sintel 480p clip
no-weightp -F1: 408.47s (3.07 fps), 144.63 kb/s, Global PSNR: 48.956
no-weightp -F3: 361.14s (3.47 fps), 144.01 kb/s, Global PSNR: 48.746
Prior to this change (recon refs used for weightp analysis):
weightp -F1: 402.84s (3.11 fps), 131.09 kb/s, Global PSNR: 49.908
x265 [info]: 278 of 687 (40.47%) P frames weighted
weightp -F3: 355.88s (3.52 fps), 132.09 kb/s, Global PSNR: 49.768
x265 [info]: 242 of 687 (35.23%) P frames weighted
After this change (source refs used for weightp analysis):
weightp -F1: 404.83s (3.10 fps), 131.82 kb/s, Global PSNR: 49.414
x265 [info]: 325 of 687 (47.31%) P frames weighted
weightp -F3: 348.32s (3.60 fps), 131.01 kb/s, Global PSNR: 49.957
x265 [info]: 325 of 687 (47.31%) P frames weighted
Because of the lower bitrate, enabling weightp actually makes this clip encode
faster. No idea why -F1 has so much less PSNR than -F3; needs investigation.
diff -r 0315cf14deda -r a44b48b74d6f source/Lib/TLibEncoder/WeightPredAnalysis.cpp
--- a/source/Lib/TLibEncoder/WeightPredAnalysis.cpp Thu Oct 24 15:48:48 2013 -0500
+++ b/source/Lib/TLibEncoder/WeightPredAnalysis.cpp Thu Oct 24 17:06:02 2013 -0500
@@ -290,25 +290,25 @@
for (int refIdxTmp = 0; refIdxTmp < slice->getNumRefIdx(picList); refIdxTmp++)
{
Pel* fenc = pic->getLumaAddr();
- Pel* fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvRec()->getLumaAddr();
+ Pel* fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvOrg()->getLumaAddr();
int orgStride = pic->getStride();
- int refStride = slice->getRefPic(picList, refIdxTmp)->getPicYuvRec()->getStride();
+ int refStride = slice->getRefPic(picList, refIdxTmp)->getPicYuvOrg()->getStride();
// calculate SAD costs with/without wp for luma
SADWP = this->xCalcSADvalueWP(X265_DEPTH, fenc, fref, width, height, orgStride, refStride, denom, weightPredTable[refList][refIdxTmp][0].inputWeight, weightPredTable[refList][refIdxTmp][0].inputOffset);
SADnoWP = this->xCalcSADvalueWP(X265_DEPTH, fenc, fref, width, height, orgStride, refStride, denom, defaultWeight, 0);
fenc = pic->getCbAddr();
- fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvRec()->getCbAddr();
+ fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvOrg()->getCbAddr();
orgStride = pic->getCStride();
- refStride = slice->getRefPic(picList, refIdxTmp)->getPicYuvRec()->getCStride();
+ refStride = slice->getRefPic(picList, refIdxTmp)->getPicYuvOrg()->getCStride();
// calculate SAD costs with/without wp for chroma cb
SADWP += this->xCalcSADvalueWP(X265_DEPTH, fenc, fref, width >> 1, height >> 1, orgStride, refStride, denom, weightPredTable[refList][refIdxTmp][1].inputWeight, weightPredTable[refList][refIdxTmp][1].inputOffset);
SADnoWP += this->xCalcSADvalueWP(X265_DEPTH, fenc, fref, width >> 1, height >> 1, orgStride, refStride, denom, defaultWeight, 0);
fenc = pic->getCrAddr();
- fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvRec()->getCrAddr();
+ fref = slice->getRefPic(picList, refIdxTmp)->getPicYuvOrg()->getCrAddr();
// calculate SAD costs with/without wp for chroma cr
SADWP += this->xCalcSADvalueWP(X265_DEPTH, fenc, fref, width >> 1, height >> 1, orgStride, refStride, denom, weightPredTable[refList][refIdxTmp][2].inputWeight, weightPredTable[refList][refIdxTmp][2].inputOffset);
More information about the x265-devel
mailing list