History

avfilter/af_astats: rework sample loops

The channel loop is now the outer loop for both planar and interleaved. This is needed by the next patch, and the speed difference is negligable if any.

Marton Balint committed 7 years ago

Commit 5cc4b791 parent 235228e1 file · +9 −8Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_astats.c+9−8
@@ -410,17 +410,18 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 409 unmodified lines
410 for (int c = 0; c < channels; c++) { \410 for (int c = 0; c < channels; c++) { \
411 ChannelStats *p = &s->chstats[c]; \411 ChannelStats *p = &s->chstats[c]; \
412 const type *src = (const type *)data[c]; \412 const type *src = (const type *)data[c]; \
413 for (int i = 0; i < samples; i++, src++) \413 const type * const srcend = src + samples; \
414 for (; src < srcend; src++) \
414 update_stat(s, p, double_sample, normalized_sample, int_sample); \415 update_stat(s, p, double_sample, normalized_sample, int_sample); \
415 }416 }
416 417
417#define UPDATE_STATS_I(type, double_sample, normalized_sample, int_sample) \418#define UPDATE_STATS_I(type, double_sample, normalized_sample, int_sample) \
418 { \419 for (int c = 0; c < channels; c++) { \
419 const type *src = (const type *)data[0]; \420 ChannelStats *p = &s->chstats[c]; \
420 for (int i = 0; i < samples; i++) { \421 const type *src = (const type *)data[0]; \
421 for (int c = 0; c < channels; c++, src++) \422 const type * const srcend = src + samples * channels; \
422 update_stat(s, &s->chstats[c], double_sample, normalized_sample, int_sample); \423 for (src += c; src < srcend; src += channels) \
423 } \424 update_stat(s, p, double_sample, normalized_sample, int_sample); \
424 }425 }
425 426
426#define UPDATE_STATS(planar, type, sample, normalizer_suffix, int_sample) \427#define UPDATE_STATS(planar, type, sample, normalizer_suffix, int_sample) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t