[FFmpeg-devel] [PATCH] lavfi: remove noise libmpcodecs wrapper

Paul B Mahol onemda at gmail.com
Sat Apr 6 18:24:15 CEST 2013


On 4/6/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Apr 05, 2013 at 11:50:01PM +0000, Paul B Mahol wrote:
>> Native filter have been implemented.
>>
>> Even with inline assembly manually enabled, this filter
>> is significanly slower than native one.
>>
>> Optimization to native filter can be added at any time
>> and there is no reason to keep mp filter just because
>> it have inline assembly that gets never enabled.
>
> noise=all_strength=30
> 22863845 decicycles in noise, 32 runs, 0 skips
> the filter shows artifacts (quality is IMHO not acceptable)


What artifacts?

You did not provide full command line (so i can make sure you tested
same pixel format).

The only difference is not using random().

>
> mp=noise=30:30
> 15285560 decicycles in mpnoise, 32 runs, 0 skips
>
> forcing MMX2
> mp=noise=30:30
> 2790510 decicycles in mpnoise, 32 runs, 0 skips
>
> PS: why does the native filter not handle shorthand notation ?

What kind of shorthand notation? The one mp=noise use can not
be done with it.

>
> tested using:
>
> diff --git a/libavfilter/libmpcodecs/vf_noise.c
> b/libavfilter/libmpcodecs/vf_noise.c
> index 3b946e9..606ea66 100644
> --- a/libavfilter/libmpcodecs/vf_noise.c
> +++ b/libavfilter/libmpcodecs/vf_noise.c
> @@ -351,11 +351,11 @@ static int put_image(struct vf_instance *vf,
> mp_image_t *mpi, double pts){
>          }
>  //else printf("dr\n");
>          dmpi= vf->dmpi;
> -
> +START_TIMER
>          noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0],
> mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
>          noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1],
> mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
>          noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2],
> mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
> -
> +STOP_TIMER("mpnoise")
>          ff_vf_clone_mpi_attributes(dmpi, mpi);
>
>  #if HAVE_MMX
> diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
> index 8db5329..8782b4a 100644
> --- a/libavfilter/vf_noise.c
> +++ b/libavfilter/vf_noise.c
> @@ -309,11 +309,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *inpicref)
>          }
>          av_frame_copy_props(out, inpicref);
>      }
> -
> +START_TIMER
>      for (i = 0; i < n->nb_planes; i++)
>          noise(out->data[i], inpicref->data[i], out->linesize[i],
>                inpicref->linesize[i], n->linesize[i], n->height[i], n, i);
> -
> +STOP_TIMER("noise")
>      ret = ff_filter_frame(outlink, out);
>      if (inpicref != out)
>          av_frame_free(&inpicref);
>
> [...]

I feared of such kind of "benchmark".

I tested with "time".

Also mp=noise supports only several pixel formats.

> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> DNS cache poisoning attacks, popular search engine, Google internet
> authority
> dont be evil, please
>


More information about the ffmpeg-devel mailing list