"Ronald S. Bultje" <[email protected]> writes:

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

DSPContext should be chopped up in tiny pieces.  This is a step in the
right direction.

> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index b535430..26ba9c5 100644
> --- 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

Please put that line at the top of the file alongside the other shared tools.

> 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

Where did the contents of these files go?

> @@ -465,8 +441,6 @@ typedef struct DSPContext {
>  #define EDGE_TOP    1
>  #define EDGE_BOTTOM 2
>
> -    void (*prefetch)(void *mem, int stride, int h);
> -

Has anyone checked (recently) how much difference, if any, that function
actually makes?  I wouldn't be surprised if it does no good at all.

> diff --git a/libavcodec/ppc/videodsp.c b/libavcodec/ppc/videodsp.c
> new file mode 100644
> index 0000000..e69de29

Missing file contents.

> diff --git a/libavcodec/videodsp.c b/libavcodec/videodsp.c
> new file mode 100644
> index 0000000..b3d513b
> --- /dev/null
> +++ b/libavcodec/videodsp.c

[...]

> +void ff_video_dsp_context_init(VideoDSPContext *ctx, int bpp)

Please call this function ff_videodsp_init().  That's how all other such
functions are named.

> +{
> +    ctx->prefetch = just_return;
> +    assert(bpp <= 16);

Is assert() really called for here?

> +    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);
> +}

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to