[FFmpeg-devel] [PATCH] Move the filters table in postprocess.c to .rodata

Diego 'Flameeyes' Pettenò flameeyes
Tue Jan 8 14:19:56 CET 2008


Michael Niedermayer <michaelni at gmx.at> writes:

> hmm the size of the struct after your change is 36 byte, that is not left
> shift friendly ...
> also 3 of the ints in the struct can be changed to uint8_t
> with that the struct would be 28 byte
> and if you would use bitfields you could get it to 24byte

Okay new patch with the changes you suggested, it's down to 21 bytes.
I haven't made shortName an array of two characters, as that most likely
would slow down the code (and make it look worse) as it's used for
comparison.

I also moved the structure definition from postprocess_internal.h
directly to postprocess.c as no other structure is declared with that type.

> and then all accesses to the struct are sequential so theres no need for a
> constant size per entry and you could really store the whole in 15 bytes
> per entry on average

I'm a bit confused about this. I suppose you wanted to say to make the
single structure size variable, but as far as I know you can't make a
proper array of those, as the variable-sized entry (that can be only the
last entry) would have official size 0.
If there is any C feature I'm missing here, I'd gladly like to know
about it :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libpostproc-rodata-filters.patch
Type: text/x-patch
Size: 12498 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080108/8b6e2499/attachment.bin>
-------------- next part --------------


-- 
Diego "Flameeyes" Petten?
http://farragut.flameeyes.is-a-geek.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080108/8b6e2499/attachment.pgp>



More information about the ffmpeg-devel mailing list