Skip to content
  • Ell's avatar
    algorithms: improve boxfilter accuracy · 9b4099db
    Ell authored
    Don't multiply individual pixels by combined row/column weights.
    Instead, calculate the columns separately, using only the row
    weights, and then combine them using the column weights.  This
    improves accuracy sufficiently so that when all the input value
    are 1, the result is not greater than 1, which could previously
    happen (or at least it's far less likely to happen now.)
    
    Performance should be at most marginally worse for 4-component
    pixels, about the same for 3-component pixels, and slightly better
    for 2- and 1-component pixels.
    9b4099db