[FFmpeg-devel] [PATCH] avfilter/vf_removegrain: replace qsort with AV_QSORT
Ganesh Ajjanagadde
gajjanag at mit.edu
Mon Oct 26 12:15:54 CET 2015
On Mon, Oct 26, 2015 at 5:50 AM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Sun, Oct 25, 2015 at 03:10:27PM -0400, Ganesh Ajjanagadde wrote:
>> filter_slice calls qsort, so qsort is in a performance critical
>> position. AV_QSORT is substantially faster due to the inlining of the
>> comparison callback. Thus, the increase in performance is worth the
>> increase in binary size.
>>
>> Sample benchmark (x86-64, Haswell, GNU/Linux),
>> filter-removegrain-mode-02 (from FATE)
>> new:
>> 24060 decicycles in qsort, 1 runs, 0 skips
>> 15690 decicycles in qsort, 2 runs, 0 skips
>> 9307 decicycles in qsort, 4 runs, 0 skips
>> 5572 decicycles in qsort, 8 runs, 0 skips
>> 3485 decicycles in qsort, 16 runs, 0 skips
>> 2517 decicycles in qsort, 32 runs, 0 skips
>> 1979 decicycles in qsort, 64 runs, 0 skips
>> 1911 decicycles in qsort, 128 runs, 0 skips
>> 1568 decicycles in qsort, 256 runs, 0 skips
>> 1596 decicycles in qsort, 512 runs, 0 skips
>> 1614 decicycles in qsort, 1024 runs, 0 skips
>> 1874 decicycles in qsort, 2046 runs, 2 skips
>> 2186 decicycles in qsort, 4094 runs, 2 skips
>>
>> old:
>> 246960 decicycles in qsort, 1 runs, 0 skips
>> 135765 decicycles in qsort, 2 runs, 0 skips
>> 70920 decicycles in qsort, 4 runs, 0 skips
>> 37710 decicycles in qsort, 8 runs, 0 skips
>> 20831 decicycles in qsort, 16 runs, 0 skips
>> 12225 decicycles in qsort, 32 runs, 0 skips
>> 8083 decicycles in qsort, 64 runs, 0 skips
>> 6270 decicycles in qsort, 128 runs, 0 skips
>> 5321 decicycles in qsort, 256 runs, 0 skips
>> 4860 decicycles in qsort, 512 runs, 0 skips
>> 4424 decicycles in qsort, 1024 runs, 0 skips
>> 4191 decicycles in qsort, 2046 runs, 2 skips
>> 4934 decicycles in qsort, 4094 runs, 2 skips
>>
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>> libavfilter/vf_removegrain.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> LGTM
>
> thanks
pushed, thanks.
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list