PDA

View Full Version : Pascal port of the integer-only OGG vorbis decoder TREMOR



BeRo
15-04-2012, 06:05 PM
I've ported the integer-only (32.32bit fixed point) OGG vorbis decoder TREMOR to pascal. And here it is:

http://www.rosseaux.net/code/opensource/pasvorbistremor/ all files

http://www.rosseaux.net/code/opensource/pasvorbistremor/pasvorbistremor.pas the main src itself

It is licensed under the same BSD-style like the original TREMOR C-source itself. And it's so far worklng.

Have fun with it :D

virtual
15-04-2012, 08:17 PM
when i read the title i expect you :) , thanks for sharing , very helpfull

Andru
15-04-2012, 09:51 PM
Great work! :) But is there any performance comparison of C and Pascal version of this library? Because ARM platform(where it will be useful) is very performance-sensetive, and it will be interesting to know how much this port can win/lose in performance.

paul_nicholls
15-04-2012, 11:42 PM
Very very nice work Benjamin! Thanks for sharing, and your continuing great work as always :)

BeRo
16-04-2012, 06:18 AM
Great work! :) But is there any performance comparison of C and Pascal version of this library? Because ARM platform(where it will be useful) is very performance-sensetive, and it will be interesting to know how much this port can win/lose in performance.

I did the port mainly for the ARM android target, because I'm working on a commerical android game (for currenr midrange and highend ARM-based smartphones and tablets) in the moment, where I've needed it, see the few ARM inline assembler source parts of it. :)

And i've uploaded a new version now, which fixes a small bug in the codebook decoder (which had decline some few but non-corrupted oggs falsely), and where I've optimized the memory allocation stuff a bit.

Andru
16-04-2012, 10:10 AM
because I'm working on a commerical android game
Hmm, then why do not use a Tremolo (http://wss.co.uk/pinknoise/tremolo/)? :) It's 15%-20% faster then Tremor.

code_glitch
16-04-2012, 03:31 PM
Andru - in the context of the real world, why use windows over linux now we have wine 1.4? ;)

Either way, this is indeed a very nice bit of news! Once again I am in awe at what you've managed to cram into such little space... I will definitely be checking this out later on :)

Andru
16-04-2012, 05:15 PM
Andru - in the context of the real world, why use windows over linux now we have wine 1.4?
Because WINE is too buggy for support Windows software :) I just asked, maybe BeRo didn't know about Tremolo as better solution in performance. And I agree that his work is indeed great, and good that there is asm code inside this port, because I have a pity experience using PasJPEG and PasZlib. These solutions are too slow and better to use original versions.

code_glitch
16-04-2012, 05:19 PM
Lol. I guess you do have a point, but now we have some .NET 3.5 goodness and most of office 2010 running smoothly, I can't really complain :)

As for speed, I find ports tend to be a tad slower than originals unless it has been 'over-viewed' by the person porting the code and improved upon. However, for things that are indeed very slow, I prefer to dump it into a separate thread, which on dual core system makes is appear as fast as it should be. I know the clock cycles are still going in, but from a user point of view, it can be quite the neat solution :D

Drewski
29-03-2014, 04:55 PM
To anyone who wants to know: I did a simple test where I decoded an ogg file multiple times on a raspberrypi. The hard float version(libvorbisdec.so) took 60 seconds and this pascal -O3 integer version took 83 seconds. The -O1 version took about 120 seconds.

I don't have a comparison to the library version of vorbistremor.

Andrew

PS in case you dont know -O1 and -O3 are compiler flags for generating faster code

Andru
29-03-2014, 05:34 PM
Andrew

PS in case you dont know -O1 and -O3 are compiler flags for generating faster code
I guess this answer is for me? Then LOL ) Anyway, thanks for the test.

BeRo
30-03-2014, 04:24 PM
To anyone who wants to know: I did a simple test where I decoded an ogg file multiple times on a raspberrypi. The hard float version(libvorbisdec.so) took 60 seconds and this pascal -O3 integer version took 83 seconds. The -O1 version took about 120 seconds.

I don't have a comparison to the library version of vorbistremor.

Andrew

PS in case you dont know -O1 and -O3 are compiler flags for generating faster code

Which FPC version have you used? Not the SVN trunk (a ka 2.7.1)? Because the SVN trunk of FPC has many new code generator optimizations specially for the ARM cpu target.