[FFmpeg-devel] [RFC] [PATCH] Make ModeAlphabet constant in vp3.c

Michael Niedermayer michaelni
Thu Jan 10 02:42:28 CET 2008


On Sat, Jan 05, 2008 at 02:52:18PM +0100, Diego 'Flameeyes' Petten? wrote:
> 
> The attached patch makes ModeAlphabet constant, by removing the custom
> mode from the top, and using a static variable array inside the
> unpack_modes instead for custom modes.
> 
> This way the big part of ModeAlphabet can be moved into .rodata.
> 
> I admit I'm not sure if this is good myself (hence the RFC).
> 

> Make ModeAlphabet a constant table, and use a temporary table instead for
> 
> From: Diego 'Flameeyes' Petten? <flameeyes at gmail.com>
> 
> the custom mode.

ARGH! ideg! no, this is wrong, and the original is no better
please _REMOVE_ the non constant static not move it around

[...]
> -static int ModeAlphabet[7][CODING_MODE_COUNT] =
> +static const int ModeAlphabet[7][CODING_MODE_COUNT] =
>  {
> -    /* this is the custom scheme */
> -    { 0, 0, 0, 0, 0, 0, 0, 0 },
> -
[...]
> +        static int custom_mode[CODING_MODE_COUNT]; 
[...]
> -                ModeAlphabet[scheme][get_bits(gb, 3)] = i;
> +                custom_mode[get_bits(gb, 3)] = i;


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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20080110/e3abb2e1/attachment.pgp>



More information about the ffmpeg-devel mailing list