• Mans Rullgard's avatar
    g723.1: simplify and fix multiplication overflow · 52aa3015
    Mans Rullgard authored
    In 16-bit arithmetic, x * 0xffffc is simply x * -4 with extra overflows,
    (and the constant was probably meant to be 0xfffc).  Combined with the
    shift, this simplifies to -x >> 1.  Finally, clearing the low two bits
    with a 32-bit mask and switching to a 32-bit type allows more efficient
    code on 32-bit machines.
    Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
    52aa3015
g723_1.c 36.5 KB