History

avfilter/avf_showfreqs: add group delay data mode

Paul B Mahol committed 5 years ago

Commit a01b0371 parent f3891432 files · +13 −1Browse files

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

Unified · Split

libavfilter/avf_showfreqs.c+12−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
36#include "internal.h"36#include "internal.h"
37#include "window_func.h"37#include "window_func.h"
38 38
39enum DataMode { MAGNITUDE, PHASE, NB_DATA };39enum DataMode { MAGNITUDE, PHASE, DELAY, NB_DATA };
40enum DisplayMode { LINE, BAR, DOT, NB_MODES };40enum DisplayMode { LINE, BAR, DOT, NB_MODES };
41enum ChannelMode { COMBINED, SEPARATE, NB_CMODES };41enum ChannelMode { COMBINED, SEPARATE, NB_CMODES };
42enum FrequencyScale { FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES };42enum FrequencyScale { FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES };
@@ -120,6 +120,7 @@ static const AVOption showfreqs_options[] = { · 77 unmodified lines
120 { "data", "set data mode", OFFSET(data_mode), AV_OPT_TYPE_INT, {.i64=MAGNITUDE}, 0, NB_DATA-1, FLAGS, "data" },120 { "data", "set data mode", OFFSET(data_mode), AV_OPT_TYPE_INT, {.i64=MAGNITUDE}, 0, NB_DATA-1, FLAGS, "data" },
121 { "magnitude", "show magnitude", 0, AV_OPT_TYPE_CONST, {.i64=MAGNITUDE}, 0, 0, FLAGS, "data" },121 { "magnitude", "show magnitude", 0, AV_OPT_TYPE_CONST, {.i64=MAGNITUDE}, 0, 0, FLAGS, "data" },
122 { "phase", "show phase", 0, AV_OPT_TYPE_CONST, {.i64=PHASE}, 0, 0, FLAGS, "data" },122 { "phase", "show phase", 0, AV_OPT_TYPE_CONST, {.i64=PHASE}, 0, 0, FLAGS, "data" },
123 { "delay", "show group delay",0, AV_OPT_TYPE_CONST, {.i64=DELAY}, 0, 0, FLAGS, "data" },
123 { NULL }124 { NULL }
124};125};
125 126
@@ -440,6 +441,16 @@ static int plot_freqs(AVFilterLink *inlink, AVFrame *in) · 314 unmodified lines
440 plot_freq(s, ch, a, f, fg, &prev_y, out, outlink);441 plot_freq(s, ch, a, f, fg, &prev_y, out, outlink);
441 }442 }
442 break;443 break;
444 case DELAY:
445 plot_freq(s, ch, 0, 0, fg, &prev_y, out, outlink);
446
447 for (f = 1; f < s->nb_freq; f++) {
448 a = av_clipd((M_PI - P(IM(f, ch) * RE(f-1, ch) - IM(f-1, ch) * RE(f, ch),
449 RE(f, ch) * RE(f-1, ch) + IM(f, ch) * IM(f-1, ch))) / (2. * M_PI), 0, 1);
450
451 plot_freq(s, ch, a, f, fg, &prev_y, out, outlink);
452 }
453 break;
443 }454 }
444 }455 }
445 456

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