History

avfilter/af_asoftclip: add erf soft clip type

Paul B Mahol committed 6 years ago

Commit ee686231 parent 67d4ab52 files · +13 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +1 −0
  2. libavfilter/af_asoftclip.c +12 −0
doc/filters.texi+1−0
@@ -2323,6 +2323,7 @@ It accepts the following values: · 2322 unmodified lines
23232323 @item alg
23242324 @item quintic
23252325 @item sin
2326+@item erf
23262327 @end table
23272328
23282329 @item param
libavfilter/af_asoftclip.c+12−0
@@ -32,6 +32,7 @@ enum ASoftClipTypes { · 31 unmodified lines
3232 ASC_ALG,
3333 ASC_QUINTIC,
3434 ASC_SIN,
35+ ASC_ERF,
3536 NB_TYPES,
3637 };
3738
@@ -57,6 +58,7 @@ static const AVOption asoftclip_options[] = { · 19 unmodified lines
5758 { "alg", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ALG}, 0, 0, A, "types" },
5859 { "quintic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_QUINTIC},0, 0, A, "types" },
5960 { "sin", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_SIN}, 0, 0, A, "types" },
61+ { "erf", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ERF}, 0, 0, A, "types" },
6062 { "param", "set softclip parameter", OFFSET(param), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 3, A },
6163 { NULL }
6264 };
@@ -148,6 +150,11 @@ static void filter_flt(ASoftClipContext *s, · 85 unmodified lines
148150 dst[n] = sinf(src[n]);
149151 }
150152 break;
153+ case ASC_ERF:
154+ for (int n = 0; n < nb_samples; n++) {
155+ dst[n] = erff(src[n]);
156+ }
157+ break;
151158 }
152159 }
153160 }
@@ -205,6 +212,11 @@ static void filter_dbl(ASoftClipContext *s, · 51 unmodified lines
205212 dst[n] = sin(src[n]);
206213 }
207214 break;
215+ case ASC_ERF:
216+ for (int n = 0; n < nb_samples; n++) {
217+ dst[n] = erf(src[n]);
218+ }
219+ break;
208220 }
209221 }
210222 }

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