[FFmpeg-devel] [PATCH] Create ff_amr_bit_reorder() in a shared amr.h file

Rob robert.swain
Thu Sep 9 08:48:25 CEST 2010


On 8 September 2010 22:32, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> On Wed, Sep 8, 2010 at 4:30 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>> 1) Convert amrnbdata.h order mode tables to 16-bit like in your patch
>> (wastes space)
>> 2) duplicate this code in amrwbdec.c and amrwbdec.c (ugly)
>> 3) Use a preprocessor trick to create both functions (messy).
>>
>> For the last option, one would move all the code to amr.h (*not* amr.c) and
>> put something like in it
>>
>> #ifdef AMR_USE_16BIT_TABLES
>> #define TABLE_TYPE uint16_t
>> #else
>> #define TABLE_TYPE uint8_t
>> #endif
>>
>> static inline void ff_amr_bit_reorder(uint16_t *out, int size,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const uint8_t *data,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const TABLE_TYPE *ord_table)
>> {
>> ...
>> }
>>
>> So the different files might do either
>>
>> #include "amr.h"
>>
>> or
>>
>> #define AMR_USE_16BIT_TABLES
>> #include "amr.h"
>> .
>>
>> I prefer slightly option (3), but if others have a strong opinion for
>> another option I will not oppose. Michael, Rob, Ronald?
>
> Option 3 is of course best, if Marcelo is willing to go this way.

Option 3.

Regards,
Rob



More information about the ffmpeg-devel mailing list