[FFmpeg-cvslog] r8916 - in trunk/libavcodec: vc1.c vc1data.c vc1data.h

Michael Niedermayer michaelni
Sun May 6 13:46:15 CEST 2007


On Sun, May 06, 2007 at 01:40:42PM +0200, kostya wrote:
[...]
> Modified: trunk/libavcodec/vc1data.c
> ==============================================================================
> --- trunk/libavcodec/vc1data.c	(original)
> +++ trunk/libavcodec/vc1data.c	Sun May  6 13:40:42 2007
> @@ -30,27 +30,27 @@
>  #include "vc1data.h"
>  
>  /** Table for conversion between TTBLK and TTMB */
> -const int ttblk_to_tt[3][8] = {
> +const int vc1_ttblk_to_tt[3][8] = {
>    { TT_8X4, TT_4X8, TT_8X8, TT_4X4, TT_8X4_TOP, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT },
>    { TT_8X8, TT_4X8_RIGHT, TT_4X8_LEFT, TT_4X4, TT_8X4, TT_4X8, TT_8X4_BOTTOM, TT_8X4_TOP },
>    { TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP }
>  };
>  
> -const int ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
> +const int vc1_ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
>  
>  /** MV P mode - the 5th element is only used for mode 1 */
> -const uint8_t mv_pmode_table[2][5] = {
> +const uint8_t vc1_mv_pmode_table[2][5] = {
>    { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_MIXED_MV },
>    { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_1MV_HPEL_BILIN }
>  };
> -const uint8_t mv_pmode_table2[2][4] = {
> +const uint8_t vc1_mv_pmode_table2[2][4] = {
>    { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV },
>    { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN }
>  };


a vc1_ prefix is insufficient for global variables, they should have
a ffmpeg/libavcodec specific prefix, that is ff_ for internal variables
a prefix like vc1_ or ac3_ would not prevent name clashes with other
implementations of the same codec and such other implementations are the
most likely things where name clashes would occur ...

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070506/542a34ac/attachment.pgp>



More information about the ffmpeg-cvslog mailing list