Skip to content

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.

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