[FFmpeg-devel] [PATCH 2/2] aacdec: Convert some loop copies into memcpy()s.

Alex Converse alex.converse
Fri Jan 28 17:55:45 CET 2011


2011/1/28 M?ns Rullg?rd <mans at mansr.com>:
> Alex Converse <alex.converse at gmail.com> writes:
>
>> ---
>> ?libavcodec/aacdec.c | ? ?9 +++------
>> ?1 files changed, 3 insertions(+), 6 deletions(-)
>>
>>
>> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
>> index 2d5fb54..2127099 100644
>> --- a/libavcodec/aacdec.c
>> +++ b/libavcodec/aacdec.c
>> @@ -1723,8 +1723,7 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
>> ? ? ? ? ? ? ?(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
>> ? ? ? ? ?ac->dsp.vector_fmul_window( ? ?out, ? ? ? ? ? ? ? saved, ? ? ? ? ? ?buf, ? ? ? ? lwindow_prev, 0, 512);
>> ? ? ?} else {
>> - ? ? ? ?for (i = 0; i < 448; i++)
>> - ? ? ? ? ? ?out[i] = saved[i];
>> + ? ? ? ?memcpy( ? ? ? ? ? ? ? ? ? ? ? ?out, ? ? ? ? ? ? ? saved, ? ? ? ? ? ?448 * sizeof(float));
>
> I'd prefer if you used sizeof(*out), just in case the type is ever
> changed.
>

That was what I initially wrote but all the surrounding memcpy()s did
sizeof(float) so I changed it to what you see above for consistency.



More information about the ffmpeg-devel mailing list