[FFmpeg-devel] MPEG-PS demuxer index memory usage

Michael Niedermayer michaelni
Sun Jan 13 14:33:55 CET 2008


On Sun, Jan 13, 2008 at 11:59:02AM +0000, Paul Kelly wrote:
[...]
>> [...]
>>> +        int in, out= 0;
>>> +        /* Halve the size of the index by removing every second entry */
>>> +        for(in=0; in<st->nb_index_entries; in+= 2)
>>> +            st->index_entries[out++]= st->index_entries[in];
>>> +        st->nb_index_entries= out;
>>
>> int i;
>> for(i=0; 2*i<st->nb_index_entries; i++)
>>    st->index_entries[i]= st->index_entries[2*i];
>> st->nb_index_entries= i;
>
> Changed also. Why is it better? Multiplication by 2 can be optimised?

1 varable less, simpler more readable code

patch applied with some changes

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080113/2ca0e834/attachment.pgp>



More information about the ffmpeg-devel mailing list