[FFmpeg-soc] [PATCH 2/2]aacsbr: Change vk0 and vk1 to int16_t to prevent a size mismatch on memcpy.

Alex Converse alex.converse at gmail.com
Thu Nov 26 23:50:09 CET 2009


On Thu, Nov 26, 2009 at 2:15 AM, Robert Swain <robert.swain at gmail.com> wrote:
> On Wed, 2009-11-25 at 19:55 -0500, Alex Converse wrote:
>
> [int -> int16_t for vk* arrays]
>
> Why?
>

f_master is uint16_t. We memcpy from vk* to f_master. We memcpy from
from f_master to f_tablelow.

As far as it fitting in int16_t, I did some back of the envelope
calculations and
k[1] <= 2.499 * k[0]
bands <= 12
ergo num_bands0 < = 16
NINT (sbr->k[0] * (k[1] / k[0])^((k + 1) / num_bands_0)) - NINT(k[0] *
(k[1] / k[0])^  (k / num_bands_0)) < k[1]
ergo vk0[n] < 16*k[1] << SHORT_MAX

> PS - As all this code is pretty much just written from the spec and
> hasn't been cleaned up or plugged together, you may as well commit
> directly and I'll complain if I see anything in the commit log that
> causes concern. That way you can work more quickly rather than waiting
> for review of these simple changes. :)
>

Committed accidentally with the others


More information about the FFmpeg-soc mailing list