]> git.sesse.net Git - ffmpeg/commit
adpcm: Replace any of the leaf nodes in the heap
authorMartin Storsjö <martin@martin.st>
Fri, 12 Nov 2010 12:30:27 +0000 (12:30 +0000)
committerMartin Storsjö <martin@martin.st>
Fri, 12 Nov 2010 12:30:27 +0000 (12:30 +0000)
commit38b3bda18f07a1a8dd18437105a12427c5a90c1c
treeb381272f230504ee0001d64da1e529a412910ed9
parent4106b7f1cd7151804e1138c473550cf20354c39b
adpcm: Replace any of the leaf nodes in the heap

By not looking for the exactly largest node, we avoid an O(n) seek through
the leaf nodes. Just pick one (not the same one every time) and try replacing
that node with the new one.

For -trellis 8, this lowers the run time from 190 to 158 seconds,
for a 30 second 44 kHz mono sample, on my machine.

Originally committed as revision 25733 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/adpcm.c