[FFmpeg-devel] AAC decoder round 5

Robert Swain robert.swain
Fri Aug 8 21:03:23 CEST 2008


2008/8/8 Robert Swain <robert.swain at gmail.com>:
> 2008/8/8 Robert Swain <robert.swain at gmail.com>:
>> 2008/8/8 Michael Niedermayer <michaelni at gmx.at>:
>>> On Thu, Aug 07, 2008 at 11:53:39PM +0100, Robert Swain wrote:
>>>> 2008/8/7 Michael Niedermayer <michaelni at gmx.at>:
>>>> >> >> +
>>>> >> >> +
>>>> >> >> +static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, const uint8_t * buf, int buf_size) {
>>>> >> >> +    AACContext * ac = avccontext->priv_data;
>>>> >> >> +    GetBitContext gb;
>>>> >> >> +    enum RawDataBlockID id;
>>>> >> >> +    int err, tag;
>>>> >> >> +
>>>> >> >> +    init_get_bits(&gb, buf, buf_size*8);
>>>> >> >> +
>>>> >> >> +    // parse
>>>> >> >> +    while ((id = get_bits(&gb, 3)) != ID_END) {
>>>> >> >> +        tag = get_bits(&gb, 4);
>>>> >> >> +        err = -1;
>>>> >> >> +        switch (id) {
>>>> >> >> +
>>>> >> >
>>>> >> >> +        case ID_SCE:
>>>> >> >> +            if(!ac->che[ID_SCE][tag]) {
>>>> >> >
>>>> >> > this id / tag naming confuses the hell out of me ...
>>>> >> > Both values together identify the "thing". the id here is the
>>>> >> > type (channel pair / single channel / ...)
>>>> >>
>>>> >> Why is it confusing? As you say, the id is the type and the tag is
>>>> >> (and I know you don't like this but I'm going to use it anyway because
>>>> >> I'm happy with it) the instance of that type.
>>>> >
>>>> > Well iam not a native englishman ...
>>>> > but to me id is something by which a specific individual or instance can
>>>> > uniquely be identified. This isnt true here ...
>>>> >
>>>> > That is, the number on the license plate of a car is an ID,
>>>> > Rolls Royce Phantom II is not an ID its the type or model.
>>>>
>>>> Hmm, I agree. In the spec it uses ID but something like element_type
>>>> and element_id instead of id and tag respectively would be better,
>>>> wouldn't you agree?
>>>
>>> yes
>>
>> Should I also rename all the ID_*E in the enum? What to? ELEM_TYPE_SCE
>> etc? And MAX_TAGID to MAX_ELEM_ID?
>
> See an attempt attached.

You haven't commented on this one yet (not that I'm rushing you) but
here's (see attached) an updated patch with the TYPE_SCE change you
suggested.

Regards,
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080808-1754-rename_id_tag-type_id.diff
Type: text/x-diff
Size: 20665 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080808/daf8b726/attachment.diff>



More information about the ffmpeg-devel mailing list