Yes, I understand your confusion, but the function indeed treats it as unsigned integer (will return 32 for -2147483648), but it does not mean you can pass 64-bit number into it. When you pass 2147483648 as "int" the behavior is compiler-dependent it seems.Tale wrote:Sorry, I seem to have missed your earlier reply. My confusion came from the "function treats the input value as unsigned", but you are absolutely right. Thanks for explaining (twice).Aleksey Vaneev wrote:As I've replied earlier, 2147483648 does NOT fit into 32-bit "int" range. Your test was flawed.
Open source high-quality pro audio sample rate converter library released from Voxengo
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Cool! BTW, I like the new clear() method; I can now reuse the resampler object as long as the sample rates don't change.Aleksey Vaneev wrote:I'm currently working on a better windowing function, and I think the number of taps can be reduced further down to 34 or 32 samples, that way it will be 10-15% faster.
So, what would you say is the current development stage? From the SVN changelog I gather it is sill in alpha stage, which I guess means I should probably not yet release a r8brained (beta) version of Combo Model V/F...
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
Yes, it's alpha with some development going on. The resampler is fully working, I do not think there will be serious changes to the code from now on. Note on MinPhase filtering - it's available, but it is not fully complete yet.
A "continous sample rate change" resampler will probably be a separate class anyway, if I ever get to implementing it.
A "continous sample rate change" resampler will probably be a separate class anyway, if I ever get to implementing it.
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Thanks for your reply. I am not too worried about possible future changes, I'll take them as they come. Anyway, I think I will be including r8brain in the next beta of ComboV/F.
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Done!Tale wrote:Anyway, I think I will be including r8brain in the next beta of ComboV/F.
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
Released v0.6. Huge achievements in all aspects - quality and speed.
CDSPResampler is now a templated class.
While this may seem impossible, in r8brain-free-src the decent quality full 16-bit audio resampling can be achieved by setting CInterpClass to "CDSPFracInterpolator< 14, 22, 9 >" and using ReqTransBand=3, ReqAtten=96. Such mode of operation is ultra fast: achieves 20 Mflops on a single core of Intel i7-4770K processor.
CDSPResampler is now a templated class.
While this may seem impossible, in r8brain-free-src the decent quality full 16-bit audio resampling can be achieved by setting CInterpClass to "CDSPFracInterpolator< 14, 22, 9 >" and using ReqTransBand=3, ReqAtten=96. Such mode of operation is ultra fast: achieves 20 Mflops on a single core of Intel i7-4770K processor.
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Thanks for the update.
I did some quick profiling, resampling an 8-second sine sweep from 96 to 44.1 kHz, and the updated code was ~9% faster while delivering virtually the same output (maximum difference: -138 dB).
I have also profiled the resampler with the "14:22" fractional delay filter, and it was ~26% faster than with the default filter settings. The maximum difference between the "14:22" and the default filter was -105 dB, so I'd say that even with the "14:22" filter r8brain still delivers more than decent quality.
I did some quick profiling, resampling an 8-second sine sweep from 96 to 44.1 kHz, and the updated code was ~9% faster while delivering virtually the same output (maximum difference: -138 dB).
I have also profiled the resampler with the "14:22" fractional delay filter, and it was ~26% faster than with the default filter settings. The maximum difference between the "14:22" and the default filter was -105 dB, so I'd say that even with the "14:22" filter r8brain still delivers more than decent quality.
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Er... I don't think so, but I might well be doing something wrong. Here my resample code:
When I use this to resample 8 seconds (in memory) of 96 to 44.1 kHz, it outputs e.g. 150873373 for 14:22 and 198643515 for 28:800, which makes 14:22 1.3x (or 24%) faster (right?). I am compiling with full optimizations (/O2).
Code: Select all
void rs(const double* src, double src_srate, int src_len, double* dest, double dest_srate, int dest_len)
{
const int block_len = 64;
double ReqTransBand = 3.;
double ReqAtten = 96.;
CDSPResampler<> rs(src_srate, dest_srate, ReqTransBand, ReqAtten, block_len);
unsigned __int64 t = 0;
while (dest_len > 0)
{
double buf[block_len], *p = buf;
int n = block_len;
if (n > src_len) n = src_len;
for (int i = 0; i < n; ++i) *p++ = *src++;
if (n < block_len) memset(p, 0, (block_len - n) * sizeof(double));
src_len -= n;
unsigned __int64 start, end;
start = __rdtsc();
n = rs.process(buf, block_len, p);
end = __rdtsc();
t += end - start;
if (n > dest_len) n = dest_len;
for (int i = 0; i < n; ++i) *dest++ = *p++;
dest_len -= n;
}
printf("%I64u\n", t);
}
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRian
- 519 posts since 12 Apr, 2010 from The Netherlands
Could well be. I used the MSVC 2010 compiler on x64, which is pretty good, but the Intel compiler is better, especially with IPP. It could also depend on the processor, mine was a Core2 Duo E6550 2.33 GHz.
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002
- KVRAF
- Topic Starter
- 4021 posts since 7 Sep, 2002