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

Add support for planar data channels #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

telc
Copy link

@telc telc commented Feb 25, 2020

Needed to be able to use planar samples instead of packed. This approach seemed to be the least error prone, but gives a bit of code duplication.

@@ -675,6 +675,74 @@ EBUR128_FILTER(int, INT_MIN, INT_MAX)
EBUR128_FILTER(float, -1.0f, 1.0f)
EBUR128_FILTER(double, -1.0, 1.0)

#define EBUR128_FILTER_PLANAR(type, min_scale, max_scale) \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating all this code, you could do access to the src samples via a macro that is defined differently for interleaved/planar. Something like

#define GET_SAMPLE_INTERLEAVED(src, channels, c, s) ((src)[(channels) * (s) + (c)])
#define GET_SAMPLE_PLANAR(src, channels, c, s) ((src)[(c)][(s)])

Make such macro an argument to the existing FILTER / ADD_FRAMES macros and make use of them in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants