Christophe Gisquet <christophe.gisq...@gmail.com> writes:

> 2012/2/29 Mashiat Sarker Shakkhar <shahriman_...@yahoo.com>:
>>>>  +        if (s->bV3RTM)
>>>>  +            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
>>>>  +                s->cdlms[ich][ilms].lms_updates[icoef + recent] /= 2;
>>>>  +        else
>>>>  +            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
>>>>  +                s->cdlms[ich][ilms].lms_updates[icoef] /= 2;
>>>
>>> shift instead?
>>
>> Don't think so. IIRC, there is an issue regarding zero-truncation
>> involved here. Please ask Mans to comment. I'm not an authority here.
>
> Those are signed values, so shift is probably not correct here, while
> division is. But for such a divisor, most compilers will generate the
> proper sequence of adds and shifts to emulate it.

Yes, shift and division are different for negative numbers.  For
constant divisors, gcc does the right though.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to