[FFmpeg-devel] AAC decoder round 5
Robert Swain
robert.swain
Sat Aug 9 11:37:17 CEST 2008
2008/8/8 Michael Niedermayer <michaelni at gmx.at>:
> On Fri, Aug 08, 2008 at 08:03:23PM +0100, Robert Swain wrote:
>> 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.
>
> ok
Applied.
Rob
More information about the ffmpeg-devel
mailing list