History

avfilter/af_astats: fix identation

Marton Balint committed 7 years ago

Commit 233fdd81 parent e85f37d1 file · +74 −74Browse files

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

Unified · Split

libavfilter/af_astats.c+74−74
@@ -331,79 +331,79 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 330 unmodified lines
331331 max_sigma_x = p->sigma_x;
332332
333333 if (s->measure_perchannel & MEASURE_DC_OFFSET)
334− set_meta(metadata, c + 1, "DC_offset", "%f", p->sigma_x / p->nb_samples);
334+ set_meta(metadata, c + 1, "DC_offset", "%f", p->sigma_x / p->nb_samples);
335335 if (s->measure_perchannel & MEASURE_MIN_LEVEL)
336− set_meta(metadata, c + 1, "Min_level", "%f", p->min);
336+ set_meta(metadata, c + 1, "Min_level", "%f", p->min);
337337 if (s->measure_perchannel & MEASURE_MAX_LEVEL)
338− set_meta(metadata, c + 1, "Max_level", "%f", p->max);
338+ set_meta(metadata, c + 1, "Max_level", "%f", p->max);
339339 if (s->measure_perchannel & MEASURE_MIN_DIFFERENCE)
340− set_meta(metadata, c + 1, "Min_difference", "%f", p->min_diff);
340+ set_meta(metadata, c + 1, "Min_difference", "%f", p->min_diff);
341341 if (s->measure_perchannel & MEASURE_MAX_DIFFERENCE)
342− set_meta(metadata, c + 1, "Max_difference", "%f", p->max_diff);
342+ set_meta(metadata, c + 1, "Max_difference", "%f", p->max_diff);
343343 if (s->measure_perchannel & MEASURE_MEAN_DIFFERENCE)
344− set_meta(metadata, c + 1, "Mean_difference", "%f", p->diff1_sum / (p->nb_samples - 1));
344+ set_meta(metadata, c + 1, "Mean_difference", "%f", p->diff1_sum / (p->nb_samples - 1));
345345 if (s->measure_perchannel & MEASURE_RMS_DIFFERENCE)
346− set_meta(metadata, c + 1, "RMS_difference", "%f", sqrt(p->diff1_sum_x2 / (p->nb_samples - 1)));
346+ set_meta(metadata, c + 1, "RMS_difference", "%f", sqrt(p->diff1_sum_x2 / (p->nb_samples - 1)));
347347 if (s->measure_perchannel & MEASURE_PEAK_LEVEL)
348− set_meta(metadata, c + 1, "Peak_level", "%f", LINEAR_TO_DB(FFMAX(-p->nmin, p->nmax)));
348+ set_meta(metadata, c + 1, "Peak_level", "%f", LINEAR_TO_DB(FFMAX(-p->nmin, p->nmax)));
349349 if (s->measure_perchannel & MEASURE_RMS_LEVEL)
350− set_meta(metadata, c + 1, "RMS_level", "%f", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
350+ set_meta(metadata, c + 1, "RMS_level", "%f", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
351351 if (s->measure_perchannel & MEASURE_RMS_PEAK)
352− set_meta(metadata, c + 1, "RMS_peak", "%f", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
352+ set_meta(metadata, c + 1, "RMS_peak", "%f", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
353353 if (s->measure_perchannel & MEASURE_RMS_TROUGH)
354− set_meta(metadata, c + 1, "RMS_trough", "%f", LINEAR_TO_DB(sqrt(p->min_sigma_x2)));
354+ set_meta(metadata, c + 1, "RMS_trough", "%f", LINEAR_TO_DB(sqrt(p->min_sigma_x2)));
355355 if (s->measure_perchannel & MEASURE_CREST_FACTOR)
356− set_meta(metadata, c + 1, "Crest_factor", "%f", p->sigma_x2 ? FFMAX(-p->min, p->max) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
356+ set_meta(metadata, c + 1, "Crest_factor", "%f", p->sigma_x2 ? FFMAX(-p->min, p->max) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
357357 if (s->measure_perchannel & MEASURE_FLAT_FACTOR)
358− set_meta(metadata, c + 1, "Flat_factor", "%f", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
358+ set_meta(metadata, c + 1, "Flat_factor", "%f", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
359359 if (s->measure_perchannel & MEASURE_PEAK_COUNT)
360− set_meta(metadata, c + 1, "Peak_count", "%f", (float)(p->min_count + p->max_count));
360+ set_meta(metadata, c + 1, "Peak_count", "%f", (float)(p->min_count + p->max_count));
361361 if (s->measure_perchannel & MEASURE_BIT_DEPTH) {
362− bit_depth(s, p->mask, p->imask, &depth);
363− set_meta(metadata, c + 1, "Bit_depth", "%f", depth.num);
364− set_meta(metadata, c + 1, "Bit_depth2", "%f", depth.den);
362+ bit_depth(s, p->mask, p->imask, &depth);
363+ set_meta(metadata, c + 1, "Bit_depth", "%f", depth.num);
364+ set_meta(metadata, c + 1, "Bit_depth2", "%f", depth.den);
365365 }
366366 if (s->measure_perchannel & MEASURE_DYNAMIC_RANGE)
367− set_meta(metadata, c + 1, "Dynamic_range", "%f", LINEAR_TO_DB(2 * FFMAX(FFABS(p->min), FFABS(p->max))/ p->min_non_zero));
367+ set_meta(metadata, c + 1, "Dynamic_range", "%f", LINEAR_TO_DB(2 * FFMAX(FFABS(p->min), FFABS(p->max))/ p->min_non_zero));
368368 if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS)
369− set_meta(metadata, c + 1, "Zero_crossings", "%f", p->zero_runs);
369+ set_meta(metadata, c + 1, "Zero_crossings", "%f", p->zero_runs);
370370 if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS_RATE)
371− set_meta(metadata, c + 1, "Zero_crossings_rate", "%f", p->zero_runs/(double)p->nb_samples);
371+ set_meta(metadata, c + 1, "Zero_crossings_rate", "%f", p->zero_runs/(double)p->nb_samples);
372372 }
373373
374374 if (s->measure_overall & MEASURE_DC_OFFSET)
375− set_meta(metadata, 0, "Overall.DC_offset", "%f", max_sigma_x / (nb_samples / s->nb_channels));
375+ set_meta(metadata, 0, "Overall.DC_offset", "%f", max_sigma_x / (nb_samples / s->nb_channels));
376376 if (s->measure_overall & MEASURE_MIN_LEVEL)
377− set_meta(metadata, 0, "Overall.Min_level", "%f", min);
377+ set_meta(metadata, 0, "Overall.Min_level", "%f", min);
378378 if (s->measure_overall & MEASURE_MAX_LEVEL)
379− set_meta(metadata, 0, "Overall.Max_level", "%f", max);
379+ set_meta(metadata, 0, "Overall.Max_level", "%f", max);
380380 if (s->measure_overall & MEASURE_MIN_DIFFERENCE)
381− set_meta(metadata, 0, "Overall.Min_difference", "%f", min_diff);
381+ set_meta(metadata, 0, "Overall.Min_difference", "%f", min_diff);
382382 if (s->measure_overall & MEASURE_MAX_DIFFERENCE)
383− set_meta(metadata, 0, "Overall.Max_difference", "%f", max_diff);
383+ set_meta(metadata, 0, "Overall.Max_difference", "%f", max_diff);
384384 if (s->measure_overall & MEASURE_MEAN_DIFFERENCE)
385− set_meta(metadata, 0, "Overall.Mean_difference", "%f", diff1_sum / (nb_samples - s->nb_channels));
385+ set_meta(metadata, 0, "Overall.Mean_difference", "%f", diff1_sum / (nb_samples - s->nb_channels));
386386 if (s->measure_overall & MEASURE_RMS_DIFFERENCE)
387− set_meta(metadata, 0, "Overall.RMS_difference", "%f", sqrt(diff1_sum_x2 / (nb_samples - s->nb_channels)));
387+ set_meta(metadata, 0, "Overall.RMS_difference", "%f", sqrt(diff1_sum_x2 / (nb_samples - s->nb_channels)));
388388 if (s->measure_overall & MEASURE_PEAK_LEVEL)
389− set_meta(metadata, 0, "Overall.Peak_level", "%f", LINEAR_TO_DB(FFMAX(-nmin, nmax)));
389+ set_meta(metadata, 0, "Overall.Peak_level", "%f", LINEAR_TO_DB(FFMAX(-nmin, nmax)));
390390 if (s->measure_overall & MEASURE_RMS_LEVEL)
391− set_meta(metadata, 0, "Overall.RMS_level", "%f", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
391+ set_meta(metadata, 0, "Overall.RMS_level", "%f", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
392392 if (s->measure_overall & MEASURE_RMS_PEAK)
393− set_meta(metadata, 0, "Overall.RMS_peak", "%f", LINEAR_TO_DB(sqrt(max_sigma_x2)));
393+ set_meta(metadata, 0, "Overall.RMS_peak", "%f", LINEAR_TO_DB(sqrt(max_sigma_x2)));
394394 if (s->measure_overall & MEASURE_RMS_TROUGH)
395− set_meta(metadata, 0, "Overall.RMS_trough", "%f", LINEAR_TO_DB(sqrt(min_sigma_x2)));
395+ set_meta(metadata, 0, "Overall.RMS_trough", "%f", LINEAR_TO_DB(sqrt(min_sigma_x2)));
396396 if (s->measure_overall & MEASURE_FLAT_FACTOR)
397− set_meta(metadata, 0, "Overall.Flat_factor", "%f", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
397+ set_meta(metadata, 0, "Overall.Flat_factor", "%f", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
398398 if (s->measure_overall & MEASURE_PEAK_COUNT)
399− set_meta(metadata, 0, "Overall.Peak_count", "%f", (float)(min_count + max_count) / (double)s->nb_channels);
399+ set_meta(metadata, 0, "Overall.Peak_count", "%f", (float)(min_count + max_count) / (double)s->nb_channels);
400400 if (s->measure_overall & MEASURE_BIT_DEPTH) {
401− bit_depth(s, mask, imask, &depth);
402− set_meta(metadata, 0, "Overall.Bit_depth", "%f", depth.num);
403− set_meta(metadata, 0, "Overall.Bit_depth2", "%f", depth.den);
401+ bit_depth(s, mask, imask, &depth);
402+ set_meta(metadata, 0, "Overall.Bit_depth", "%f", depth.num);
403+ set_meta(metadata, 0, "Overall.Bit_depth2", "%f", depth.den);
404404 }
405405 if (s->measure_overall & MEASURE_NUMBER_OF_SAMPLES)
406− set_meta(metadata, 0, "Overall.Number_of_samples", "%f", nb_samples / s->nb_channels);
406+ set_meta(metadata, 0, "Overall.Number_of_samples", "%f", nb_samples / s->nb_channels);
407407 }
408408
409409 static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
@@ -562,80 +562,80 @@ static void print_stats(AVFilterContext *ctx) · 152 unmodified lines
562562
563563 av_log(ctx, AV_LOG_INFO, "Channel: %d\n", c + 1);
564564 if (s->measure_perchannel & MEASURE_DC_OFFSET)
565− av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);
565+ av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);
566566 if (s->measure_perchannel & MEASURE_MIN_LEVEL)
567− av_log(ctx, AV_LOG_INFO, "Min level: %f\n", p->min);
567+ av_log(ctx, AV_LOG_INFO, "Min level: %f\n", p->min);
568568 if (s->measure_perchannel & MEASURE_MAX_LEVEL)
569− av_log(ctx, AV_LOG_INFO, "Max level: %f\n", p->max);
569+ av_log(ctx, AV_LOG_INFO, "Max level: %f\n", p->max);
570570 if (s->measure_perchannel & MEASURE_MIN_DIFFERENCE)
571− av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", p->min_diff);
571+ av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", p->min_diff);
572572 if (s->measure_perchannel & MEASURE_MAX_DIFFERENCE)
573− av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", p->max_diff);
573+ av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", p->max_diff);
574574 if (s->measure_perchannel & MEASURE_MEAN_DIFFERENCE)
575− av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", p->diff1_sum / (p->nb_samples - 1));
575+ av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", p->diff1_sum / (p->nb_samples - 1));
576576 if (s->measure_perchannel & MEASURE_RMS_DIFFERENCE)
577− av_log(ctx, AV_LOG_INFO, "RMS difference: %f\n", sqrt(p->diff1_sum_x2 / (p->nb_samples - 1)));
577+ av_log(ctx, AV_LOG_INFO, "RMS difference: %f\n", sqrt(p->diff1_sum_x2 / (p->nb_samples - 1)));
578578 if (s->measure_perchannel & MEASURE_PEAK_LEVEL)
579− av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-p->nmin, p->nmax)));
579+ av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-p->nmin, p->nmax)));
580580 if (s->measure_perchannel & MEASURE_RMS_LEVEL)
581− av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
581+ av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
582582 if (s->measure_perchannel & MEASURE_RMS_PEAK)
583− av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
583+ av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
584584 if (s->measure_perchannel & MEASURE_RMS_TROUGH)
585− if (p->min_sigma_x2 != 1)
586− av_log(ctx, AV_LOG_INFO, "RMS trough dB: %f\n",LINEAR_TO_DB(sqrt(p->min_sigma_x2)));
585+ if (p->min_sigma_x2 != 1)
586+ av_log(ctx, AV_LOG_INFO, "RMS trough dB: %f\n",LINEAR_TO_DB(sqrt(p->min_sigma_x2)));
587587 if (s->measure_perchannel & MEASURE_CREST_FACTOR)
588− av_log(ctx, AV_LOG_INFO, "Crest factor: %f\n", p->sigma_x2 ? FFMAX(-p->nmin, p->nmax) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
588+ av_log(ctx, AV_LOG_INFO, "Crest factor: %f\n", p->sigma_x2 ? FFMAX(-p->nmin, p->nmax) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
589589 if (s->measure_perchannel & MEASURE_FLAT_FACTOR)
590− av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
590+ av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
591591 if (s->measure_perchannel & MEASURE_PEAK_COUNT)
592− av_log(ctx, AV_LOG_INFO, "Peak count: %"PRId64"\n", p->min_count + p->max_count);
592+ av_log(ctx, AV_LOG_INFO, "Peak count: %"PRId64"\n", p->min_count + p->max_count);
593593 if (s->measure_perchannel & MEASURE_BIT_DEPTH) {
594− bit_depth(s, p->mask, p->imask, &depth);
595− av_log(ctx, AV_LOG_INFO, "Bit depth: %u/%u\n", depth.num, depth.den);
594+ bit_depth(s, p->mask, p->imask, &depth);
595+ av_log(ctx, AV_LOG_INFO, "Bit depth: %u/%u\n", depth.num, depth.den);
596596 }
597597 if (s->measure_perchannel & MEASURE_DYNAMIC_RANGE)
598− av_log(ctx, AV_LOG_INFO, "Dynamic range: %f\n", LINEAR_TO_DB(2 * FFMAX(FFABS(p->min), FFABS(p->max))/ p->min_non_zero));
598+ av_log(ctx, AV_LOG_INFO, "Dynamic range: %f\n", LINEAR_TO_DB(2 * FFMAX(FFABS(p->min), FFABS(p->max))/ p->min_non_zero));
599599 if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS)
600− av_log(ctx, AV_LOG_INFO, "Zero crossings: %"PRId64"\n", p->zero_runs);
600+ av_log(ctx, AV_LOG_INFO, "Zero crossings: %"PRId64"\n", p->zero_runs);
601601 if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS_RATE)
602− av_log(ctx, AV_LOG_INFO, "Zero crossings rate: %f\n", p->zero_runs/(double)p->nb_samples);
602+ av_log(ctx, AV_LOG_INFO, "Zero crossings rate: %f\n", p->zero_runs/(double)p->nb_samples);
603603 }
604604
605605 av_log(ctx, AV_LOG_INFO, "Overall\n");
606606 if (s->measure_overall & MEASURE_DC_OFFSET)
607− av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
607+ av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
608608 if (s->measure_overall & MEASURE_MIN_LEVEL)
609− av_log(ctx, AV_LOG_INFO, "Min level: %f\n", min);
609+ av_log(ctx, AV_LOG_INFO, "Min level: %f\n", min);
610610 if (s->measure_overall & MEASURE_MAX_LEVEL)
611− av_log(ctx, AV_LOG_INFO, "Max level: %f\n", max);
611+ av_log(ctx, AV_LOG_INFO, "Max level: %f\n", max);
612612 if (s->measure_overall & MEASURE_MIN_DIFFERENCE)
613− av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", min_diff);
613+ av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", min_diff);
614614 if (s->measure_overall & MEASURE_MAX_DIFFERENCE)
615− av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", max_diff);
615+ av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", max_diff);
616616 if (s->measure_overall & MEASURE_MEAN_DIFFERENCE)
617− av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", diff1_sum / (nb_samples - s->nb_channels));
617+ av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", diff1_sum / (nb_samples - s->nb_channels));
618618 if (s->measure_overall & MEASURE_RMS_DIFFERENCE)
619− av_log(ctx, AV_LOG_INFO, "RMS difference: %f\n", sqrt(diff1_sum_x2 / (nb_samples - s->nb_channels)));
619+ av_log(ctx, AV_LOG_INFO, "RMS difference: %f\n", sqrt(diff1_sum_x2 / (nb_samples - s->nb_channels)));
620620 if (s->measure_overall & MEASURE_PEAK_LEVEL)
621− av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-nmin, nmax)));
621+ av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-nmin, nmax)));
622622 if (s->measure_overall & MEASURE_RMS_LEVEL)
623− av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
623+ av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
624624 if (s->measure_overall & MEASURE_RMS_PEAK)
625− av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(max_sigma_x2)));
625+ av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(max_sigma_x2)));
626626 if (s->measure_overall & MEASURE_RMS_TROUGH)
627− if (min_sigma_x2 != 1)
628− av_log(ctx, AV_LOG_INFO, "RMS trough dB: %f\n", LINEAR_TO_DB(sqrt(min_sigma_x2)));
627+ if (min_sigma_x2 != 1)
628+ av_log(ctx, AV_LOG_INFO, "RMS trough dB: %f\n", LINEAR_TO_DB(sqrt(min_sigma_x2)));
629629 if (s->measure_overall & MEASURE_FLAT_FACTOR)
630− av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
630+ av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
631631 if (s->measure_overall & MEASURE_PEAK_COUNT)
632− av_log(ctx, AV_LOG_INFO, "Peak count: %f\n", (min_count + max_count) / (double)s->nb_channels);
632+ av_log(ctx, AV_LOG_INFO, "Peak count: %f\n", (min_count + max_count) / (double)s->nb_channels);
633633 if (s->measure_overall & MEASURE_BIT_DEPTH) {
634− bit_depth(s, mask, imask, &depth);
635− av_log(ctx, AV_LOG_INFO, "Bit depth: %u/%u\n", depth.num, depth.den);
634+ bit_depth(s, mask, imask, &depth);
635+ av_log(ctx, AV_LOG_INFO, "Bit depth: %u/%u\n", depth.num, depth.den);
636636 }
637637 if (s->measure_overall & MEASURE_NUMBER_OF_SAMPLES)
638− av_log(ctx, AV_LOG_INFO, "Number of samples: %"PRId64"\n", nb_samples / s->nb_channels);
638+ av_log(ctx, AV_LOG_INFO, "Number of samples: %"PRId64"\n", nb_samples / s->nb_channels);
639639 }
640640
641641 static av_cold void uninit(AVFilterContext *ctx)

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