[FFmpeg-devel] [PATCH 2/2] avfilter/vf_waveform: reduce number of operations a little

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Sep 3 17:30:52 CEST 2015


On Thu, Sep 3, 2015 at 7:32 AM, Paul B Mahol <onemda at gmail.com> wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/vf_waveform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
> index dbf06a0..858c718 100644
> --- a/libavfilter/vf_waveform.c
> +++ b/libavfilter/vf_waveform.c
> @@ -584,7 +584,7 @@ static void flat(WaveformContext *s, AVFrame *in, AVFrame *out,
>
>          if (mirror) {
>              d0_data += s->size - 1;
> -            d1_data += s->size;
> +            d1_data += s->size - 1;
>          }
>
>          for (y = 0; y < src_h; y++) {
> @@ -603,7 +603,7 @@ static void flat(WaveformContext *s, AVFrame *in, AVFrame *out,
>
>                  for (p = c0 - c1; p < c0 + c1; p++) {
>                      if (mirror)
> -                        target = d1_data - p - 1;
> +                        target = d1_data - p;
>                      else
>                          target = d1_data + p;
>
> --
> 1.7.11.2

LGTM.
Even if the asm generated was identical due to some compiler tricks
(have not checked), I consider this still an improvement since it
symmetrizes stuff.

>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list