• Urvang Joshi's avatar
    optimize_b_greedy: Avoid left shift of negative value. · 6eb35eb4
    Urvang Joshi authored
    accu_error was always <= 0:
    - It was initialized to zero, and
    - Became more and more negative through the iterations.
    This meant that RDOPT() macro usage on accu_error was causing left shift
    of negative value.
    - accu_error is initialized to a large positive value.
    - It becomes smaller on every iteration but remains >= always.
    This is functionally equivalent: verified that there's no change in
    output due to this patch.
    Change-Id: I654572a72234c588c8f332d5b66a5587fc6610b4