• Paul E. Murphy's avatar
    imgproc(resize): improve 8u3 HResize vector exit calc · c1cdb241
    Paul E. Murphy authored
    Actually, we can do this in constant time. xofs always
    contains same or increasing offset values. We can instead
    find the most extreme value used and never attempt to load it.
    
    Similarly, we can note for all dx >= 0 and dx < (dwidth - cn)
    where xofs[dx] + cn < xofs[dwidth-cn] implies dx < (dwidth - cn).
    
    Thus, we can use this to control our loop termination optimally.
    
    This fixes #16137 with little or no performance impact. I have
    also added a debug check as a sanity check.
    c1cdb241
Name
Last commit
Last update
.github Loading commit data...
3rdparty Loading commit data...
apps Loading commit data...
cmake Loading commit data...
data Loading commit data...
doc Loading commit data...
include Loading commit data...
modules Loading commit data...
platforms Loading commit data...
samples Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...