[Ffmpeg-devel] [patch] vp3 disable patch

Aurelien Jacobs aurel
Wed Dec 20 01:33:28 CET 2006


On Tue, 19 Dec 2006 11:02:34 -0800
Tom Harper <d.thomas.harper at gmail.com> wrote:

> Hi,
> 
> Attached is a patch to reduce the final build size if you choose not
> to build vp3 (like me!).
> 
> Index: libavcodec/dsputil.c
> ===================================================================
> --- libavcodec/dsputil.c	(revision 7332)
> +++ libavcodec/dsputil.c	(working copy)
> @@ -3872,11 +3872,13 @@
>              c->idct_add= ff_jref_idct_add;
>              c->idct    = j_rev_dct;
>              c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
> +#ifdef CONFIG_CONFIG_VP3_DECODER
          ^^^^^^^^^^^^^^
typo ! This should obviously be CONFIG_VP3_DECODER (same all along
your patch).

>          }else if(avctx->idct_algo==FF_IDCT_VP3){
>              c->idct_put= ff_vp3_idct_put_c;
>              c->idct_add= ff_vp3_idct_add_c;
>              c->idct    = ff_vp3_idct_c;
>              c->idct_permutation_type= FF_NO_IDCT_PERM;

The vp3 dsp functions are also used by vp5 and vp6 so you also need
to check for them.

> +#endif
>          }else{ //accurate/default
>              c->idct_put= simple_idct_put;
>              c->idct_add= simple_idct_add;
> Index: libavcodec/i386/dsputil_mmx.c
> ===================================================================
> --- libavcodec/i386/dsputil_mmx.c	(revision 7332)
> +++ libavcodec/i386/dsputil_mmx.c	(working copy)
> @@ -2700,9 +2700,11 @@
>  void ff_mmx_idct(DCTELEM *block);
>  void ff_mmxext_idct(DCTELEM *block);
>  
> +#ifdef CONFIG_CONFIG_VP3_DECODER
>  void ff_vp3_idct_sse2(int16_t *input_data);
>  void ff_vp3_idct_mmx(int16_t *data);
>  void ff_vp3_dsp_init_mmx(void);
> +#endif

No need to protect function declaration.

> [...]
> 
> @@ -86,6 +85,7 @@
>  OBJS-$(CONFIG_H261_DECODER)            += h261.o
>  OBJS-$(CONFIG_H261_ENCODER)            += h261.o
>  OBJS-$(CONFIG_H264_DECODER)            += h264.o
> +# to add:h264cavlc.o

Unrelated change !

>  OBJS-$(CONFIG_H264_ENCODER)            += h264enc.o h264dsp.o
>  OBJS-$(CONFIG_HUFFYUV_DECODER)         += huffyuv.o
>  OBJS-$(CONFIG_HUFFYUV_ENCODER)         += huffyuv.o
> @@ -134,7 +134,7 @@
>  OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1.o
>  OBJS-$(CONFIG_SVQ3_DECODER)            += h264.o
>  OBJS-$(CONFIG_TARGA_DECODER)           += targa.o
> -OBJS-$(CONFIG_THEORA_DECODER)          += vp3.o
> +OBJS-$(CONFIG_THEORA_DECODER)          += vp3.o vp3dsp.o
>  OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
>  OBJS-$(CONFIG_TIFF_DECODER)            += tiff.o lzw.o
>  OBJS-$(CONFIG_TRUEMOTION1_DECODER)     += truemotion1.o
> @@ -151,7 +151,7 @@
>  OBJS-$(CONFIG_VMNC_DECODER)            += vmnc.o
>  OBJS-$(CONFIG_VORBIS_DECODER)          += vorbis.o vorbis_data.o
>  OBJS-$(CONFIG_VORBIS_ENCODER)          += vorbis_enc.o vorbis.o vorbis_data.o
> -OBJS-$(CONFIG_VP3_DECODER)             += vp3.o
> +OBJS-$(CONFIG_VP3_DECODER)             += vp3.o vp3dsp.o
>  OBJS-$(CONFIG_VP5_DECODER)             += vp5.o vp56.o vp56data.o
>  OBJS-$(CONFIG_VP6_DECODER)             += vp6.o vp56.o vp56data.o

vp3dsp.o must also be built along with vp5.o and vp6.o.

>  OBJS-$(CONFIG_VQA_DECODER)             += vqavideo.o
> @@ -329,12 +329,13 @@
>          i386/simple_idct_mmx.o \
>          i386/idct_mmx_xvid.o \
>          i386/fft_sse.o \
> -        i386/vp3dsp_mmx.o \
> -        i386/vp3dsp_sse2.o \
>          i386/fft_3dn.o \
>          i386/fft_3dn2.o \
>          i386/snowdsp_mmx.o \
>  
> +OBJS-$(CONFIG_THEORA_DECODER)          += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o
> +OBJS-$(CONFIG_VP3_DECODER)             += i386/vp3dsp_mmx.o i386/vp3dsp_sse2.o

Same here. Those objects are also needed for vp5 and vp6.


By the way, you may want to add somehting like this somewhere to avoid
overly long lines all over the place:

#define ENABLE_VP_DECODER (CONFIG_VP3_DECODER|CONFIG_VP5_DECODER|CONFIG_VP6_DECODER)

Then you could protect part of the code simply with

#if ENABLE_VP_DECODER
...
#endif

Aurel




More information about the ffmpeg-devel mailing list