[Ffmpeg-devel] [Patch] DVB Subtitle decoder

Ian Caulfield imc25
Mon Jul 11 01:09:30 CEST 2005


On Mon, 11 Jul 2005, Michael Niedermayer wrote:

> Hi
>
>> static uint16_t getbe16(const uint8_t *p)
>> {
>>     return (p[0] << 8) | p[1];
>> }
>
> why not use BE_16() ?
>
>
>> static unsigned char cropTbl[256 + 2 * MAX_NEG_CROP];
>
> code duplication, this already exists in dsputil.*
>
>> static int get_bits(int num, uint8_t **srcbuf, uint8_t *sbuf_end, int
> *bit_pos)
>
> why dont you use bitstream.c/h?

Sorry, wasn't aware of these, will adapt to remove the duplicate code.

>
>>     while (ptr != NULL) {
>>         ptr = ptr->next;
>>     }
>>
>>     ptr = first;
>
> the while loop above seems useless
>
>
>>     while (ptr != NULL && ptr->id != object_id) {
>>         ptr = ptr->next;
>>     }
>>
>>     if (ptr != NULL && ptr->id == object_id)
>>         return ptr;
>>
>>     return NULL;
>
> the 'if(...)' and the 'return NULL;' are useless too

I'm sure I had good reasons originally - though I can't fathom them now!

>
>>                   if (obj2 != object)
>>                        abort();
>
> libavcodec is a library, you cannot just call abort() in a lib

Oops, thought I'd tidied up all my debugging stuff - evidently not.

I'll fix all these up and resubmit at some point.

Ian





More information about the ffmpeg-devel mailing list