On Mon, Dec 10, 2012 at 08:56:57PM -0800, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <[email protected]>
> 
> Move some functions from dsputil. The idea is that videodsp contains
> functions that are useful for a large and varied set of video decoders.
> Currently, it contains emulated_edge_mc() and prefetch(). This allows
> vp8.c to be compiled without dsputil. Given the very limited depedency

depe_n_dency

> of vp3 and vp56 on dsputil, it's not unthinkable that these could - at
> some point - be made to compile without dsputil also.

The last sentence seems more like a comment on your patch than something
that should go into the log message.  --annotate may be of service.

> --- a/configure
> +++ b/configure
> @@ -1533,6 +1534,7 @@ mpeg4_decoder_select="h263_decoder mpeg4video_parser"
>  mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
> +mpegvideo_select="videodsp"
>  msmpeg4v1_decoder_select="h263_decoder"
> @@ -1578,12 +1580,12 @@ vc1_vdpau_decoder_select="vdpau vc1_decoder"
>  vorbis_encoder_select="mdct"
> -vp3_decoder_select="vp3dsp"
> -vp5_decoder_select="vp3dsp"
> -vp6_decoder_select="huffman vp3dsp"
> +vp3_decoder_select="vp3dsp videodsp"
> +vp5_decoder_select="vp3dsp videodsp"
> +vp6_decoder_select="huffman vp3dsp videodsp"
>  vp6a_decoder_select="vp6_decoder"
>  vp6f_decoder_select="vp6_decoder"
> -vp8_decoder_select="h264pred h264qpel"
> +vp8_decoder_select="h264pred videodsp"
>  wmapro_decoder_select="mdct sinewin"

Have you verified all of these still compile standalone?

> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -383,6 +383,7 @@ OBJS-$(CONFIG_VC1_DXVA2_HWACCEL)       += dxva2_vc1.o
>  OBJS-$(CONFIG_VC1_VAAPI_HWACCEL)       += vaapi_vc1.o
>  OBJS-$(CONFIG_VCR1_DECODER)            += vcr1.o
>  OBJS-$(CONFIG_VCR1_ENCODER)            += vcr1.o
> +OBJS-$(CONFIG_VIDEODSP)                += videodsp.o
>  OBJS-$(CONFIG_VMDAUDIO_DECODER)        += vmdav.o
>  OBJS-$(CONFIG_VMDVIDEO_DECODER)        += vmdav.o
>  OBJS-$(CONFIG_VMNC_DECODER)            += vmnc.o

This belongs with the generic options at the top, not with the en/decoders.

> --- a/libavcodec/arm/Makefile
> +++ b/libavcodec/arm/Makefile
> @@ -30,6 +30,9 @@ OBJS-$(CONFIG_RV30_DECODER)            += 
> arm/rv34dsp_init_arm.o
>  OBJS-$(CONFIG_RV40_DECODER)            += arm/rv34dsp_init_arm.o        \
>                                            arm/rv40dsp_init_arm.o        \
>  
> +OBJS-$(CONFIG_VIDEODSP)                += arm/videodsp_init_arm.o       \
> +                                          arm/videodsp_arm.o            \
> +
>  OBJS                                   += arm/dsputil_init_arm.o        \
>                                            arm/dsputil_arm.o             \
>                                            arm/fft_init_arm.o            \
> diff --git a/libavcodec/arm/videodsp_arm.S b/libavcodec/arm/videodsp_arm.S
> new file mode 100644
> index 0000000..e69de29
> diff --git a/libavcodec/arm/videodsp_init.c b/libavcodec/arm/videodsp_init.c
> new file mode 100644
> index 0000000..e69de29

You added empty files?

> --- a/libavcodec/ppc/Makefile
> +++ b/libavcodec/ppc/Makefile
> @@ -1,4 +1,5 @@
>  OBJS                                   += ppc/dsputil_ppc.o             \
> +                                          ppc/videodsp.o                \
>  
>  OBJS-$(CONFIG_VP3DSP)                  += ppc/vp3dsp_altivec.o
>  
> diff --git a/libavcodec/ppc/videodsp.c b/libavcodec/ppc/videodsp.c
> new file mode 100644
> index 0000000..e69de29

Again, what's with the empty file?

> --- /dev/null
> +++ b/libavcodec/videodsp.c
> @@ -0,0 +1,50 @@
> +
> +#include <assert.h>
> +#include "libavutil/common.h"
> +#include "videodsp.h"

nit: empty line between system and local headers

> +void ff_video_dsp_context_init(VideoDSPContext *ctx, int bpp)
> +{
> +    ctx->prefetch = just_return;
> +    assert(bpp <= 16);
> +    if (bpp <= 8) {
> +        ctx->emulated_edge_mc = ff_emulated_edge_mc_8;
> +    } else {
> +        ctx->emulated_edge_mc = ff_emulated_edge_mc_16;
> +    }
> +
> +    if (ARCH_ARM) ff_video_dsp_context_init_arm(ctx, bpp);
> +    if (ARCH_PPC) ff_video_dsp_context_init_ppc(ctx, bpp);
> +    if (ARCH_X86) ff_video_dsp_context_init_x86(ctx, bpp);

nit: Break those lines.

> --- a/libavcodec/vp8dsp.h
> +++ b/libavcodec/vp8dsp.h
> @@ -27,6 +27,7 @@
>  #ifndef AVCODEC_VP8DSP_H
>  #define AVCODEC_VP8DSP_H
>  
> +#include <stdint.h>
>  #include "dsputil.h"

nit: empty line between system and local headers

> --- /dev/null
> +++ b/libavcodec/videodsp.h
> @@ -0,0 +1,71 @@
> +/*
> + * Copyright (C) 2012 Ronald S. Bultje
> + *
> --- /dev/null
> +++ b/libavcodec/videodsp_template.c
> @@ -0,0 +1,92 @@
> +/*
> + * Copyright (C) 2012 Ronald S. Bultje
> + *
> --- /dev/null
> +++ b/libavcodec/x86/videodsp.asm
> @@ -0,0 +1,612 @@
> +;******************************************************************************
> +;* Core video DSP functions
> +;* Copyright (c) 2012 Ronald S. Bultje <[email protected]>
> +;*

Your copyright on all these files is dubious as you are mostly moving
code around, not adding it.

> --- /dev/null
> +++ b/libavcodec/x86/videodsp_init.c
> @@ -0,0 +1,119 @@
> +
> +void ff_video_dsp_context_init_x86(VideoDSPContext *ctx, int bpp)
> +{
> +#if HAVE_YASM
> +    int mm_flags = av_get_cpu_flags();
> +
> +#if ARCH_X86_32
> +    if (bpp <= 8 && mm_flags & AV_CPU_FLAG_MMX) {
> +        c->emulated_edge_mc = emulated_edge_mc_mmx;
> +    }
> +    if (mm_flags & AV_CPU_FLAG_AMD3DNOW) {
> +        ctx->prefetch = ff_prefetch_3dnow;
> +    }
> +#endif        
> +    if (mm_flags & AV_CPU_FLAG_MMXEXT) {
> +        ctx->prefetch = ff_prefetch_mmxext;
> +    }
> +    if (bpp <= 8 && mm_flags & AV_CPU_FLAG_SSE) {
> +        ctx->emulated_edge_mc = emulated_edge_mc_sse;
> +    }
> +#endif
> +}

nit: Please comment the #endifs; if you look at the other dsp-related
init files, they have a tendency to accumulate ifdefs...

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to