[FFmpeg-devel] [PATCH] move h264data.h #defines to a better place

Michael Niedermayer michaelni
Mon Nov 24 16:28:55 CET 2008


On Mon, Nov 24, 2008 at 03:32:04PM +0100, Diego Biurrun wrote:
> Here is a patch to a move a few #defines from h264data.h to h264.h and
> h264.c, where they fit better.
> 
> And yes, this will eventually lead towards splitting h264.c and svq3.c
> :)
> 
> Diego

> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 15924)
> +++ libavcodec/h264.c	(working copy)
> @@ -48,6 +48,10 @@
>   */
>  #define DELAYED_PIC_REF 4
>  
> +#define MB_TYPE_8x8DCT     0x01000000
> +#define IS_REF0(a)       ((a)&MB_TYPE_REF0)
> +#define IS_8x8DCT(a)     ((a)&MB_TYPE_8x8DCT)
> +
>  static VLC coeff_token_vlc[4];
>  static VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2];
>  static const int coeff_token_vlc_tables_size[4]={520,332,280,256};

> @@ -1590,6 +1594,7 @@
>  //FIXME need to check that this does not overflow signed 32 bit for low qp, I am not sure, it's very close
>  //FIXME check that gcc inlines this (and optimizes intra & separate_dc stuff away)
>  static inline int quantize_c(DCTELEM *block, uint8_t *scantable, int qscale, int intra, int separate_dc){
> +#define QUANT_SHIFT 22
>      int i;
>      const int * const quant_table= quant_coeff[qscale];
>      const int bias= intra ? (1<<QUANT_SHIFT)/3 : (1<<QUANT_SHIFT)/6;

stray hunk ...


> Index: libavcodec/h264.h
> ===================================================================
> --- libavcodec/h264.h	(revision 15924)
> +++ libavcodec/h264.h	(working copy)
> @@ -92,6 +92,8 @@
>  
>  #define EXTENDED_SAR          255
>  
> +#define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16 bit
> +
>  /* NAL unit types */
>  enum {
>      NAL_SLICE=1,

id move all the 4 to h264.h

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- 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/20081124/26adb3c8/attachment.pgp>



More information about the ffmpeg-devel mailing list