History log of /haiku/src/add-ons/media/media-add-ons/mixer/Interpolate.cpp
Revision Date Author Comments
# ad398477 22-Apr-2022 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

Enable some more Werror and fix compiler warnings

- All servers are now Werror
- All bus_managers are now Werror
- All input_server add-ons are now Werror
- Some more things in bin/ are Werror

Only tested on x86_64, I'll let the buildbot test on x86_gcc2 and RISC-V

Change-Id: I5ec86512eac729c862828a45d8431f85c4ec422b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5226
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 2e68fbd2 11-Dec-2020 Máximo Castañeda <antiswen@yahoo.es>

Fix wrap for AUDIO_INT

Floats don't have enough precision for all 32 bit integers. In
particular, near INT32_MAX their value is INT32_MAX + 1, which, when
converted back to int becomes INT32_MIN.

Change-Id: Ief3c1177b4f69baac13df5bac977882fea95ae01
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3511
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# cfe72209 27-Nov-2020 Máximo Castañeda <antiswen@yahoo.es>

U8 sound format

U8 sound has a nonzero value as its zero amplitude, so it needs to be
special-cased when mixing, applying gains and other transformations.

Change-Id: I5ad96b5f39d454bffad2449ac9f27b2ae61e2ccd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3470
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# d23c4131 08-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Interpolating resampler: un-break it.

The interpolation was performed only on the samples in a buffer,
without "linking" with the previous one. This can't work.
* Remember the last sample from a buffer to be able to use it when
interpolating the first samples of the next one
* Adjust the kernel to properly loop over all samples in the buffer

Fixes #9438.


# 27606dae 08-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Mixer resampler: refactor using templates.

There is no need to copypaste the resampling code which is mostly the
same for all formats. However, gcc2 is confused by member function
templates (I hit an internal compiler error) so the resampling code was
moved to a static function instead.


# eadad13a 16-Jul-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Fix one more off-by-one error in the interpolating resampler
* Since it now doesn't crash anymore; set it as default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61215fd5 16-Jul-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

fix bugs in interpolating resampler :
* I got the downsampling version completely wrong. It should now be much better.
* A small bug in the delta calculation sometimes caused an off-by-one read to the source and a crash of the media add-on server

Effect of this resampler can be heard very clearly using the following setup in Cortex :
* Demo Audio producer producing a sinewave at any frequency (sampling rate is hardcoded at 44100Hz)
* Audio output set to 48000 Hz
* system mixer in between
select either resampler in the mixer and you'll hear the difference immediately.

Should finally fix #1351.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42435 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3d88d51 13-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix clang build. modf is not good for optimizations it seems


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff617a11 12-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Add a resampler that interpolates instead of dropping/copying samples.
* Not plugged anywhere yet.
* I'm not sure the downsampling is done properly, either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38037 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d23c4131888e026b1366cb3e4f3331b4850fd3e3 08-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Interpolating resampler: un-break it.

The interpolation was performed only on the samples in a buffer,
without "linking" with the previous one. This can't work.
* Remember the last sample from a buffer to be able to use it when
interpolating the first samples of the next one
* Adjust the kernel to properly loop over all samples in the buffer

Fixes #9438.


# 27606dae3658767f5995699ada7fc8a645677ee5 08-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Mixer resampler: refactor using templates.

There is no need to copypaste the resampling code which is mostly the
same for all formats. However, gcc2 is confused by member function
templates (I hit an internal compiler error) so the resampling code was
moved to a static function instead.


# eadad13a4f9bdbbf5b31cacd28d5daeb2f589073 16-Jul-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Fix one more off-by-one error in the interpolating resampler
* Since it now doesn't crash anymore; set it as default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61215fd53d586e92b87522b9940a63a400cc8234 16-Jul-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

fix bugs in interpolating resampler :
* I got the downsampling version completely wrong. It should now be much better.
* A small bug in the delta calculation sometimes caused an off-by-one read to the source and a crash of the media add-on server

Effect of this resampler can be heard very clearly using the following setup in Cortex :
* Demo Audio producer producing a sinewave at any frequency (sampling rate is hardcoded at 44100Hz)
* Audio output set to 48000 Hz
* system mixer in between
select either resampler in the mixer and you'll hear the difference immediately.

Should finally fix #1351.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42435 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3d88d51603ae8486c297e261b374a629607f02d 13-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix clang build. modf is not good for optimizations it seems


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff617a11dda81e55fd32cfc1a6e926d14c4fbe9e 12-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Add a resampler that interpolates instead of dropping/copying samples.
* Not plugged anywhere yet.
* I'm not sure the downsampling is done properly, either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38037 a95241bf-73f2-0310-859d-f6bbb57e9c96