I have developed an OpenCL based resampler for foobar2000 v 1.x |
![]() ![]() |
I have developed an OpenCL based resampler for foobar2000 v 1.x |
Mar 14 2012, 04:02
Post
#1
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
This is based on the basic framework of SoX program. I removed the whole SoX algorithm and implemted mine.
My algorithm is very simple. I use the ideal interpolation function (sinc) to caculate the new sampling point and blackman window function to truncate the input sequence. My algorithm is not table based. Because table based method usually needs linear interpolation to get the coefficient that does not fall under the table index. So, my algorithm caculates the sinc function at each time required. The computing overhead can be amortised by the powerful GPU computing. So, I use CUDA to accelarating the conversion progress. The feature is shown below: Currently, this resampler only support 44->48 for it's just a test program about CUDA acceleration in foobar2000. The CPU usage is under 6% the THD distortion is under 0.0005% the IMD distortion is under 0.0041% The frequency response is almost a straight line with vibrating less than 0.01db. The transition band is about 4KHz. I am working on optimization and debug now. I am from china main land. So, my english expresion may not be good enough to express my point. If you have any questions, please email me. |
|
|
|
Mar 15 2012, 16:17
Post
#2
|
|
|
Group: Members Posts: 306 Joined: 2-July 10 Member No.: 81991 |
Sounds great! As soon as more sample rates are implemented I will give it a try.
|
|
|
|
Mar 17 2012, 01:26
Post
#3
|
|
![]() Group: Developer (Donating) Posts: 711 Joined: 1-December 07 Member No.: 49165 |
CUDA...I thought there was delays when calculating info on the GPU. Or am I mistaken?
|
|
|
|
Mar 24 2012, 15:41
Post
#4
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
First, how can I add a attachment for this topic? I am a fresh man here. Thanks.
This reampler is developed based on the framework of resampler for foobar2000(SoX). I remove the ratelib and the RR_XXX function by adding my resampling algorithm. My algorthm's theories are all from my textbook-(Discrete Time Signal Processing and the web site of digital audio resampling of stanford university). I use the basic band-limited interpolation and the interpolation filter's cutoff frequency is adjusted when doing downsampling to prevent aliasing. Curently, each output sample is caculating by 128 samples. I will make the number of samples needed to caculate a output sample be a adjustable parameter recently. This code is compiled by nVidia's opencl library and it's compitable with AMD's Radeon Card with the newest APP driver. This version is a pure GPU accelerated one and can only work with nvidia and amd's card. I tested the GTX480 and HD5870, it works! So, you need a GTX460 or HD5850 or better GPU card. The cpu occupancy is less than 3% with AMD 965+HD5870. Installation: 1.open foobar and install the foo_resampler.dll 2.copy the kernel.cl to your D drive's root directory. PS:you may need the latest nvidia or AMD's opencl driver! configuration: I do not modify the origial framework, so the phase and passband option don't work. You can only adjust the output sample rate. Please note! It currently only support 2 channel audio format!!! Modification: the kernel.cl contains the kernel algorithm of my basic and urgly code, you can modify it directly and it will be compiled in the runtime. And the full code I will release in a few weeks for I am leaving my school and I would not have a opencl compitable GPU until july. Basic Performance of 44.1->48KHz@16bit Frequency responese:-0.00.+0.01db Noise Level:-97.2db Dynamic range:96.8db THD:0.0005% IMD:0.0040% Stero crosstalk:-97.5db Sorry for my poor english, I am from China mainland. If you encounter any problem, please contanct me. cxn4689@live.cn nick name: Mulder |
|
|
|
Mar 24 2012, 16:13
Post
#5
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
|
|
|
|
Mar 24 2012, 16:18
Post
#6
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
Sounds great! As soon as more sample rates are implemented I will give it a try. I have modified it to be an opencl version and it supports 32->96khz output rate and 192khz is not tested for device not support. I have a problem with the attatchment. how can i add an atatchment to a tpoic? by the way, it supports both nvidia 460gtx or better and amd hd5850 or better. latest amd or nvidia opencl driver is needed! |
|
|
|
Mar 24 2012, 16:48
Post
#7
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
this is the download link:
http://sharesend.com/bq8an opencl version resampler support 32K->96Khz, 192khz is not tested for my device limitation. |
|
|
|
Mar 25 2012, 17:34
Post
#8
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
Modified the file name. The new download link is :http://sharesend.com/s8szr
|
|
|
|
Mar 30 2012, 14:31
Post
#9
|
|
|
Group: Members Posts: 10 Joined: 14-March 12 Member No.: 97789 |
I have optimized the thread mapping of opencl for nvidia GPU. This 003 version can be downloaded here: http://sharesend.com/t4js6
|
|
|
|
Apr 26 2012, 22:39
Post
#10
|
|
|
Group: Members Posts: 12 Joined: 7-April 12 Member No.: 98484 |
Great idea, tried it out... worked fine as long as the output sample rate wasn't above 48kHz... tried 88.2kHz and 96kHz and got silence (GTX 295, Xonar D2X over ASIO).
|
|
|
|
Apr 29 2012, 01:21
Post
#11
|
|
|
Group: Members Posts: 103 Joined: 3-February 11 Member No.: 87877 |
This would be a nice plug-in if would do 96kHz and use some good quality algorithms for resample. There are hundreds of algorithms out there and some of them are producing horrid results...
You can take a look at SOX one: http://sox.sourceforge.net/SoX/Resampling This post has been edited by SoNic67: Apr 29 2012, 01:23 |
|
|
|
May 28 2012, 19:31
Post
#12
|
|
|
Group: Super Moderator Posts: 4334 Joined: 23-June 06 Member No.: 32180 |
I have (finally, since I thought about it months ago) merged your two threads into this single one and split off the posts about licensing (and posts arguing about posts): Discussion: are (L)GPL-licensed components compatible with fb2k’s SDK?
This post has been edited by db1989: May 28 2012, 19:46 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 13:00 |