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

Marcelo Galvão Póvoa marspeoplester
Fri Sep 10 01:12:35 CEST 2010


On 9 September 2010 03:48, Rob <robert.swain at gmail.com> wrote:
> 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.
>

Yes, I think it is a good solution despite having to move the code to
the header file.

Since the amr.c file don't exist anymore (or should I keep it?) I may
remove the "amr.o" dependency from the Makefile?

So here is the patch now.

-- 
Marcelo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amr.diff
Type: application/octet-stream
Size: 3685 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100909/2460f092/attachment.obj>



More information about the ffmpeg-devel mailing list