Re: [FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-25 Thread Michael Niedermayer
On Sat, Oct 24, 2015 at 09:05:21AM -0400, Ganesh Ajjanagadde wrote: > On Thu, Oct 22, 2015 at 10:25 PM, Ganesh Ajjanagadde > wrote: > > > > On Thu, Oct 22, 2015 at 9:28 PM, Timothy Gu wrote: > > > On Thu, Oct 22, 2015 at 5:01 PM Ganesh Ajjanagadde

Re: [FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-25 Thread Ganesh Ajjanagadde
On Sun, Oct 25, 2015 at 8:12 AM, Michael Niedermayer wrote: > On Sat, Oct 24, 2015 at 09:05:21AM -0400, Ganesh Ajjanagadde wrote: >> On Thu, Oct 22, 2015 at 10:25 PM, Ganesh Ajjanagadde >> wrote: >> > >> > On Thu, Oct 22, 2015 at 9:28 PM, Timothy

Re: [FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-24 Thread Ganesh Ajjanagadde
On Thu, Oct 22, 2015 at 10:25 PM, Ganesh Ajjanagadde wrote: > > On Thu, Oct 22, 2015 at 9:28 PM, Timothy Gu wrote: > > On Thu, Oct 22, 2015 at 5:01 PM Ganesh Ajjanagadde > > wrote: > >> > >> Sample benchmark (x86-64,

[FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-22 Thread Ganesh Ajjanagadde
ff_huff_build_tree uses qsort underneath. AV_QSORT is substantially faster due to the inlining of the comparison callback. Furthermore, this code is reasonably performance critical, since in e.g the fraps codec, ff_huff_build_tree is called on every frame. This routine is also called in vp6 on

Re: [FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-22 Thread Timothy Gu
On Thu, Oct 22, 2015 at 5:01 PM Ganesh Ajjanagadde wrote: > Sample benchmark (x86-64, Haswell, GNU/Linux), fraps-v2 from FATE: > new: > 280110 decicycles in qsort, 1 runs, 0 skips > 268260 decicycles in qsort, 2 runs, 0 skips > > old: > 1469910

Re: [FFmpeg-devel] [PATCH] avcodec/huffman: replace qsort with AV_QSORT

2015-10-22 Thread Ganesh Ajjanagadde
On Thu, Oct 22, 2015 at 9:28 PM, Timothy Gu wrote: > On Thu, Oct 22, 2015 at 5:01 PM Ganesh Ajjanagadde > wrote: >> >> Sample benchmark (x86-64, Haswell, GNU/Linux), fraps-v2 from FATE: >> new: >> 280110 decicycles in qsort, 1 runs, 0