Skip to content

Commit

Permalink
Implemented axis_apply_lin1 function.
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Sep 23, 2023
1 parent 23e5a90 commit 502df8b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

=== 1.0.17 ===
* Implemented sqr1, sqr2, ssqr1 and ssqr2 functions.
* Implemented axis_apply_lin1 function.

=== 1.0.16 ===
* Fixed improper AVX-512 detection which causes crash for several functions.
Expand Down
10 changes: 10 additions & 0 deletions include/lsp-plug.in/dsp/common/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ typedef struct LSP_DSP_LIB_TYPE(hsla_light_eff_t)

LSP_DSP_LIB_END_NAMESPACE

/** Do linear vector apply for 1D-schema:
* x[i] = x[i] + norm_x * (v[i] + zero)
*
* @param x destination vector for X coordinate
* @param v delta vector to apply
* @param zero graphics zero point shift
* @param norm_x X norming factor
*/
LSP_DSP_LIB_SYMBOL(void, axis_apply_lin1, float *x, const float *v, float zero, float norm_x, size_t count);

/** Do logarithmic vector apply for 1D-schema:
* x[i] = x[i] + norm_x * logf(absf(v[i]*zero))
*
Expand Down
9 changes: 9 additions & 0 deletions include/private/dsp/arch/generic/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ namespace lsp
{
namespace generic
{
void axis_apply_lin1(float *x, const float *v, float zero, float norm_x, size_t count)
{
for (size_t i=0; i<count; ++i)
{
float vec = v[i];
x[i] += norm_x * (vec + zero);
}
}

void axis_apply_log2(float *x, float *y, const float *v, float zero, float norm_x, float norm_y, size_t count)
{
for (size_t i=0; i<count; ++i)
Expand Down
1 change: 1 addition & 0 deletions src/main/generic/generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ namespace lsp
EXPORT1(matched_transform_x4);
EXPORT1(matched_transform_x8);

EXPORT1(axis_apply_lin1);
EXPORT1(axis_apply_log1);
EXPORT1(axis_apply_log2);
EXPORT1(rgba32_to_bgra32);
Expand Down

0 comments on commit 502df8b

Please sign in to comment.