Add helpers for converting to/from normalized (perceptual) volume

These routines were taken from alsamixer and converted to fixed
point for Rockbox.

Change-Id: I64e8bf08da02b1e6e3ef10fdc78254bf8e87ff20
This commit is contained in:
Aidan MacDonald 2022-11-22 19:19:01 +00:00
parent 66519000f4
commit dc83963962
3 changed files with 132 additions and 0 deletions

View file

@ -143,3 +143,25 @@ From: https://github.com/cnSchwarzer/bsdiff-win
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*************************************************************************
In: apps/misc.c, to_normalized_volume and from_normalized_volume
From: https://git.alsa-project.org/?p=alsa-utils.git
alsamixer/volume_mapping.c
*************************************************************************
/*
* Copyright (c) 2010 Clemens Ladisch <clemens@ladisch.de>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/