Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some conversion functions are not implemented in pa_converters.c #35

Open
PortAudio-admin opened this issue Nov 22, 2006 · 9 comments
Open
Labels
good first issue Good for newcomers P2 Priority: High src-common Common sources in /src/common

Comments

@PortAudio-admin
Copy link
Collaborator

Issue created by @RossBencina

Conversion functions in src/common/pa_converters.c copy audio data between PortAudio native buffers and host buffers.

https://www.assembla.com/code/portaudio/subversion/nodes/1930/portaudio/trunk/src/common/pa_converters.c

Some conversion functions are marked IMPLEMENT ME and do not pass any audio, some are marked REVIEW and may not currently work as expected.

All IMPLEMENT_ME functions are dithered variants of existing non-dither functions, so the non-dithered versions can be used as a starting point.

See also /test/patest_converters.c

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

removed assignment, i'm not taking responsibility for this, but i'll help if i can

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

I havn't volunteered to fix this, but I have been working on some code to test the converters if anyone is interested please email me or the list.

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

converter test code is in /test/patest_converters.c

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

This ticket will be greatly simplified once we decide on this one:

#112 -- require clipping for dithering sample conversion functions?

@PortAudio-admin
Copy link
Collaborator Author

Comment by @philburk

I implemented the Float32 to UInt8 conversions so that the loopback test would pass. The loopback test uses Float32 as its primary internal data type. Still more to go.

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

TRAC migration: propagating ticket status from TRAC

@dechamps
Copy link
Contributor

Hello from 2023. Just FYI, this is still an issue for a small number of dithered converters. Here's the output of patest_converters on latest master (4bccdfb):

= Sine wave in, something out =


== flags = paNoFlag ==

=== Output contains non-zero data ===
Key: . - pass, X - fail
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
f32             .       .       .       .       .       .
i32             .       .       X       .       .       X
i24             .       .       .       .       .       X
i16             .       .       .       .       X       X
 i8             .       .       .       .       .       .
ui8             .       .       .       .       .       .
}}}

=== Combined dynamic range (src->dest->float32) ===
Key: Noise amplitude in dBfs, X - fail (either above failed or dest->float32 failed)
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
 f32          -inf  -180.6  -138.5   -79.5   -31.5   -31.5
 i32        -144.5  -144.5     X     -85.9   -42.1     X
 i24        -138.5  -138.5  -138.5   -86.2   -42.1     X
 i16         -84.8   -84.8   -84.8   -84.8     X       X
  i8         -36.6   -36.6   -36.6   -36.6   -36.6   -36.6
 ui8         -36.4   -36.4   -36.4   -36.4   -36.4   -36.4
}}}

== flags = paClipOff ==

=== Output contains non-zero data ===
Key: . - pass, X - fail
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
f32             .       .       .       .       .       .
i32             .       .       X       .       .       X
i24             .       .       .       .       .       X
i16             .       .       .       .       X       X
 i8             .       .       .       .       .       .
ui8             .       .       .       .       .       .
}}}

=== Combined dynamic range (src->dest->float32) ===
Key: Noise amplitude in dBfs, X - fail (either above failed or dest->float32 failed)
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
 f32          -inf  -180.6  -138.5   -80.0   -31.7   -31.1
 i32        -144.5  -144.5     X     -85.8   -42.1     X
 i24        -138.5  -138.5  -138.5   -85.8   -42.1     X
 i16         -84.8   -84.8   -84.8   -84.8     X       X
  i8         -36.6   -36.6   -36.6   -36.6   -36.6   -36.6
 ui8         -36.4   -36.4   -36.4   -36.4   -36.4   -36.4
}}}

== flags = paDitherOff ==

=== Output contains non-zero data ===
Key: . - pass, X - fail
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
f32             .       .       .       .       .       .
i32             .       .       .       .       .       .
i24             .       .       .       .       .       .
i16             .       .       .       .       .       .
 i8             .       .       .       .       .       .
ui8             .       .       .       .       .       .
}}}

=== Combined dynamic range (src->dest->float32) ===
Key: Noise amplitude in dBfs, X - fail (either above failed or dest->float32 failed)
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
 f32          -inf  -187.2  -138.7   -84.8   -36.6   -36.6
 i32        -144.5  -144.5  -138.5   -90.3   -42.1   -42.1
 i24        -138.5  -138.5  -138.5   -90.3   -42.1   -42.1
 i16         -84.8   -84.8   -84.8   -84.8   -42.1   -42.1
  i8         -36.6   -36.6   -36.6   -36.6   -36.6   -36.6
 ui8         -36.4   -36.4   -36.4   -36.4   -36.4   -36.4
}}}

== flags = paClipOff | paDitherOff ==

=== Output contains non-zero data ===
Key: . - pass, X - fail
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
f32             .       .       .       .       .       .
i32             .       .       .       .       .       .
i24             .       .       .       .       .       .
i16             .       .       .       .       .       .
 i8             .       .       .       .       .       .
ui8             .       .       .       .       .       .
}}}

=== Combined dynamic range (src->dest->float32) ===
Key: Noise amplitude in dBfs, X - fail (either above failed or dest->float32 failed)
{{{
in|  out:      f32     i32     i24     i16      i8     ui8
 f32          -inf  -187.2  -138.5   -84.8   -36.6   -36.6
 i32        -144.5  -144.5  -138.5   -90.3   -42.1   -42.1
 i24        -138.5  -138.5  -138.5   -90.3   -42.1   -42.1
 i16         -84.8   -84.8   -84.8   -84.8   -42.1   -42.1
  i8         -36.6   -36.6   -36.6   -36.6   -36.6   -36.6
 ui8         -36.4   -36.4   -36.4   -36.4   -36.4   -36.4
}}}

The missing dithered i16 → i8 and i16 → ui8 converters are notably causing #168.

@philburk philburk modified the milestones: V19, V19.8 Feb 19, 2023
@philburk
Copy link
Collaborator

@dechamps - Thanks for the reminder. I added this to the V19.8 milestone.

@RossBencina
Copy link
Collaborator

#841 was work towards Int32_To_UInt8_Dither but was never finished (closed as abandoned). Could be useful as a reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers P2 Priority: High src-common Common sources in /src/common
Projects
None yet
Development

No branches or pull requests

4 participants