[FFmpeg-devel] [PATCH 09/15] avfilter/palettegen: average color in linear space

Clément Bœsch u at pkh.me
Sat Nov 5 20:50:36 EET 2022


On Sat, Nov 05, 2022 at 04:39:26PM +0100, Paul B Mahol wrote:
> On 11/5/22, Clément Bœsch <u at pkh.me> wrote:
> > sRGB colors are gamma encoded, averaging them naively is incorrect.
> > ---
> >  libavfilter/vf_palettegen.c        | 18 ++++++++++--------
> >  tests/ref/fate/filter-palettegen-1 |  2 +-
> >  tests/ref/fate/filter-palettegen-2 |  2 +-
> >  3 files changed, 12 insertions(+), 10 deletions(-)
> >
> 
> Compared speed of processing of before and after?

Definitely slower:

Before:

  palettegen:
    Time (mean ± σ):      2.700 s ±  0.022 s    [User: 2.926 s, System: 0.080 s]
    Range (min … max):    2.674 s …  2.736 s    10 runs
  
  paletteuse:
    Time (mean ± σ):      2.315 s ±  0.036 s    [User: 2.566 s, System: 0.089 s]
    Range (min … max):    2.281 s …  2.400 s    10 runs

After:

  palettegen:
    Time (mean ± σ):      3.839 s ±  0.030 s    [User: 4.076 s, System: 0.070 s]
    Range (min … max):    3.788 s …  3.894 s    10 runs
  
  paletteuse:
    Time (mean ± σ):      2.850 s ±  0.040 s    [User: 3.094 s, System: 0.110 s]
    Range (min … max):    2.805 s …  2.954 s    10 runs

-- 
Clément B.


More information about the ffmpeg-devel mailing list