Ticket #130: fix-scaling-for-triangle.patch

File fix-scaling-for-triangle.patch, 1.4 KB (added by rlliao, 6 years ago)
  • source/Lib/CommonLib/UnitTools.cpp

    From 4144b6de3f872af471e1d43743edadb6a0ce0153 Mon Sep 17 00:00:00 2001
    From: Ru-Ling Liao <ruling.liao@sg.panasonic.com>
    Date: Thu, 6 Dec 2018 15:04:46 +0800
    Subject: [PATCH] fix scaling process of averaging L0 and L1 motion vectors in
     triangle list derivation
    
    ---
     source/Lib/CommonLib/UnitTools.cpp | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp
    index a2be738..fee9892 100644
    a b void PU::getTriangleMergeCandidates( const PredictionUnit &pu, MergeCtx& triangl 
    49804980      int32_t refPicPocL0 = slice.getRefPOC(REF_PIC_LIST_0, candidate[i].refIdx[0]);
    49814981      int32_t refPicPocL1 = slice.getRefPOC(REF_PIC_LIST_1, candidate[i].refIdx[1]);
    49824982      Mv aveMv = candidate[i].mv[1];
    4983       aveMv = aveMv.scaleMv( xGetDistScaleFactor( curPicPoc, refPicPocL0, curPicPoc, refPicPocL1 ) ); // scaling to L0
     4983      int32_t distscale = xGetDistScaleFactor( curPicPoc, refPicPocL0, curPicPoc, refPicPocL1 );
     4984      if( distscale != 4096 )
     4985      {
     4986        aveMv = aveMv.scaleMv( distscale ); // scaling to L0
     4987      }
    49844988      aveMv.setHor( ( aveMv.getHor() + candidate[i].mv[0].getHor() + 1 ) >> 1 );
    49854989      aveMv.setVer( ( aveMv.getVer() + candidate[i].mv[0].getVer() + 1 ) >> 1 );
    49864990