Changes between Initial Version and Version 1 of Ticket #297


Ignore:
Timestamp:
3 Jun 2019, 14:05:45 (6 years ago)
Author:
ksuehring
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #297 – Description

    initial v1  
    11This ticket is reporting that some TMVP code in VTM can be cleaned up without change of performance.  (It’s not a bug.)
    22 
    3 The following piece of TMVP code appeared four times in VTM5.0 (in getInterMergeCandidates, fillMvpCand, fillAffineMvpCand, getAffineMergeCand).
    4 The four “if/else” branches below can be reduced to only one “if” statement and get identical result.
     3The following piece of TMVP code appeared four times in VTM5.0 (in `getInterMergeCandidates`, `fillMvpCand`, `fillAffineMvpCand`, `getAffineMergeCand`).
     4The four `if/else` branches below can be reduced to only one `if` statement and get identical result.
    55
     6{{{
     7#!C++
    68        Position posInCtu( posRB.x & pcv.maxCUWidthMask, posRB.y & pcv.maxCUHeightMask );
    79
     
    2729          / / same as for last column but not last row
    2830        }
    29 
     31}}}
    3032
    3133In the above code, the 4 branches and the resulting C0Avail are as follows:
    3234
    33 posInCtu.x+4<pcv.maxCUWidth....posInCtu.y+4<pcv.maxCUHeight....        C0Avail
    34 (1).............true....................................true...................................                                               true
    35 (2).............true....................................false....................................false
    36 (3).............false...................................true.....................................true
    37 (4).............false...................................false....................................false
     35{{{
     36     posInCtu.x+4<pcv.maxCUWidth      posInCtu.y+4<pcv.maxCUHeight     C0Avail
     37(1)  true                             true                             true
     38(2)  true                             false                            false
     39(3)  false                            true                             true
     40(4)  false                            false                            false
     41}}}
    3842
    39 As can be seen from the combinations, given posInCtu.y , the true/false branches with posInCtu.x can be merged together, so the check on posInCtu.x is unnecessary, and above logic is identical to
     43As can be seen from the combinations, given `posInCtu.y` , the true/false branches with `posInCtu.x` can be merged together, so the check on `posInCtu.x` is unnecessary, and above logic is identical to
    4044 
     45{{{
     46#!C++
    4147      int posYInCtu = posRB.y & pcv.maxCUHeightMask;
    4248      if (posYInCtu + 4 < pcv.maxCUHeight)
     
    4551        C0Avail = true;
    4652      }
     53}}}
    4754
    4855I already tested this simplification, and got identical results on the top of VTM5.0.