Changes between Initial Version and Version 1 of Ticket #297
- Timestamp:
- 3 Jun 2019, 14:05:45 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #297 – Description
initial v1 1 1 This ticket is reporting that some TMVP code in VTM can be cleaned up without change of performance. (It’s not a bug.) 2 2 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.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. 5 5 6 {{{ 7 #!C++ 6 8 Position posInCtu( posRB.x & pcv.maxCUWidthMask, posRB.y & pcv.maxCUHeightMask ); 7 9 … … 27 29 / / same as for last column but not last row 28 30 } 29 31 }}} 30 32 31 33 In the above code, the 4 branches and the resulting C0Avail are as follows: 32 34 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 }}} 38 42 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.xis unnecessary, and above logic is identical to43 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 40 44 45 {{{ 46 #!C++ 41 47 int posYInCtu = posRB.y & pcv.maxCUHeightMask; 42 48 if (posYInCtu + 4 < pcv.maxCUHeight) … … 45 51 C0Avail = true; 46 52 } 53 }}} 47 54 48 55 I already tested this simplification, and got identical results on the top of VTM5.0.