Skip to content
  • Yaowu Xu's avatar
    fixed the wrong rounding in inverse haar transform · 152ce6b2
    Yaowu Xu authored
    Given the current forward haar transform:
     f0 = I0 + I1 + I2 + I3
     f1 = I0 + I1 - I2 - I3
     f2 = I0 - I1 + I2 - I3
     f3 = I0 - I1 - I2 + I3
    the output of the inverse haar prior rounding:
     i0 = f0 + f1 + f2 + f3 = I0 * 4;
     i1 = f0 + f1 - f2 - f3 = I1 * 4;
     i2 = f0 - f1 + f2 - f3 = I2 * 4;
     i3 = f0 - f1 - f2 + f3 = I3 * 4;
    As all the numbers are 4 multiples, simply >>2 always produces prefect
    results in term of forward-inverse transform round trip error.
    
    Change-Id: Id6658b00ea819ee61cfeef8c5985d4cd3e77f44e
    152ce6b2