[XviD-devel] vlc_codes.h

Radek Czyz radoslaw at syskin.cjb.net
Sun Feb 16 22:44:57 CET 2003


Lo everyone,

I have a new subject for you ;)

Maybe you have noticed that after the _BITS stuff, our library got
serveral tens of kilobytes larger. VfW dll was larger by at least
60kb.
You might ask me what kind of code I write. I promise you this is not
the size of _BITS functions.
The problem is that I had to #include vlc_codes.h to motion
estimation. This file contains all our hard-coded VLC tables, all
declared static. As a result, every table which is used in motion
estimation is incuded in motion estimation object file. All tables
needed for MB coding are included in mbcoding object. All tables
needed for intra block coding are included in mbprediction object.
They are all static - invisible to other modules.

I wanted to do something about it and came up with an idea which
works. I created a new object, vlc_codes.c . Here, all tables are
defined, not as static. The old vlc_codes.h, which is #included in
other modules, contains 'prototypes' (I don't know the correct
word...) of the tables - just all the tables again, without the actual
data and with 'extern' keyword.

This way, everything works correctly, but the VfW dll is smaller by
120kb ! Even if it doesn't have the real effect on performance (but
what about mem bandwith and cpu cache), it still looks much better.

There probably are better ways - we could include the actual tables to
some existing object - but I hope you agree that we should do
_something_ like this.

Best regards,
Radek



More information about the XviD-devel mailing list