[tim-janik/beast] Resampler cleanups (#125)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list

I cleaned up the resampling code:

  • the C API was removed
  • the implementation no longer relies on blockutils, but does its own SSE/FPU handling
  • Resampler2::create() got an additional argument: true means SSE should be used if available; false means the FPU version should always be used
  • FPU/SSE resampling is now under test again, I adapted some of the tests

Plugins (LadderFilter) for now can use Resampler2::create (..., false) to force using FPU resampling. As soon as the engine guarantees SSE-alignment of input/output blocks, this can be removed.

The old Makefile.am had more "testresampler" style tests, these could be added.


You can view, comment on, or merge this pull request online at:

  https://github.com/tim-janik/beast/pull/125

Commit Summary

  • BSE: Resampler: remove C API
  • TESTS: resamplehandle: remove Resampler C API test
  • BSE: no longer rely on block utils to create Resampler2 implementation
  • TESTS: no longer rely on block utils to create Resampler2 implementation
  • BSE: Resampler2: properly support SSE again
  • TESTS: testresamplerq: re-enable SSE tests (and still do FPU tests)
  • TESTS: resamplehandle: test both: SSE/FPU version for delay compensation
  • TESTS: testresampler: re-enable tests for both: SSE and FPU Resampler

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XQ45OYZONLOUDKDJQLQJE3JFA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKZONVA", "url": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XQ45OYZONLOUDKDJQLQJE3JFA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKZONVA", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list

@swesterfeld pushed 1 commit.

  • bee9d0c TOOLS: bsewavetool: remove unused resampler include


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125/files/35a300d859f7ab864ff21d51ac0df55c38288239..bee9d0ccd3e6047231d6076c306007d2f44c136d?email_source=notifications\u0026email_token=AIVS7XUI5C3OND7YEVOC3ITQJIX7NA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZDMMZSGA4TGNQ", "url": "https://github.com/tim-janik/beast/pull/125/files/35a300d859f7ab864ff21d51ac0df55c38288239..bee9d0ccd3e6047231d6076c306007d2f44c136d?email_source=notifications\u0026email_token=AIVS7XUI5C3OND7YEVOC3ITQJIX7NA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZDMMZSGA4TGNQ", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

@swesterfeld pushed 23 commits.

  • 1c10aad BSE: Resampler: remove C API
  • 8980aaa TESTS: resamplehandle: remove Resampler C API test
  • a9962f8 BSE: no longer rely on block utils to create Resampler2 implementation
  • 4bc68a8 TESTS: no longer rely on block utils to create Resampler2 implementation
  • 3d79f91 BSE: Resampler2: properly support SSE again
  • 0bd208d TESTS: testresamplerq: re-enable SSE tests (and still do FPU tests)
  • d6f3998 TESTS: resamplehandle: test both: SSE/FPU version for delay compensation
  • ae609d9 TESTS: testresampler: re-enable tests for both: SSE and FPU Resampler
  • 15d4730 TOOLS: bsewavetool: remove unused resampler include
  • fa5aac0 BSE: Resampler2: small performance optimization for downsampler
  • 5bdd943 BSE: Resampler2: improve C++ API to get rid of Resampler2::create
  • 7032bf4 TESTS: get rid of Resampler2::create
  • b8dc3ea BSE: Resampler2: remove Resampler2::create
  • 1bb9b83 TESTS: testresampler: avoid including bse/bseresamplerimpl.hh
  • 6eb9fe6 BSE: Resampler2: merge bseresamplerimpl.hh into bseresampler.cc
  • 20b7364 BSE: Resampler2: namespace/enum cleanups
  • 6428ae2 TESTS: adapt Resampler2 tests (namespace, enums)
  • 4f0c9ea TESTS: testresampler: use AlignedArray instead of F4Vector for alignment
  • e53b1b5 TESTS: testresampler: re-enable standalone tests via suite1
  • 0fec4b7 TESTS: testresampler: make perf test more reliable for small block sizes
  • f9f28da TESTS: testresampler: improve accuracy test coverage as slow test
  • 4f8e916 BSE: Resampler2: mark impl classes as final
  • 55e5fe3 config-uname.mk: fix x86_64 specific build flags


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125/files/bee9d0ccd3e6047231d6076c306007d2f44c136d..55e5fe36fce9a874e5a9a262433eeef24c5cebba?email_source=notifications\u0026email_token=AIVS7XVFCVHSJP3GXUDQZMTQJZO7PA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZTKOBWGQYDSMA", "url": "https://github.com/tim-janik/beast/pull/125/files/bee9d0ccd3e6047231d6076c306007d2f44c136d..55e5fe36fce9a874e5a9a262433eeef24c5cebba?email_source=notifications\u0026email_token=AIVS7XVFCVHSJP3GXUDQZMTQJZO7PA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZTKOBWGQYDSMA", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

Since this PR wasn't merged yet, I simply force pushed an updated version. Since we have no more C API, I could modernize the C++ API. It should be used like this:

  float input[128];
  float output[256];
  Resampler2 resampler (Resampler2::UP, Resampler2::PREC_96DB);
  resampler.process_block (input, 128, output);

Note that process_block() still needs a virtual function call (like it used to be), but I did some benchmarking before refactoring the API. The performance difference between virtual function call and inlined resampler code is minimal. Like this, I could move all implementation bits back into bseresampler.cc, so bseresampler.hh is really clean and doesn't contain any actual resampling code, and bseresamplerimpl.hh could be removed.

I also re-added the old testresampler tests from the Makefile.am, these are added using TEST_SLOW, so out/tests/suite1 --slow is needed to run the tests. I also re-enabled the standalone testcode, passing args to the standalone main() from suite1 main()

$ testresampler perf # OLD
$ out/tests/suite1 --resampler perf # NEW

Btw, if you are interested in the impact of the block size on performance, here is upsampling with different block sizes (times in ns/sample) upsampling, PREC48_DB.

4 5.1589
8 3.52419
16 3.80419
32 3.079
64 2.48795
128 2.25006
256 2.09908
512 2.019

I recommend merging this PR first, then I can update the LadderFilter PR (#122) to use the new resampling API, then merge the LadderFilter.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XSZ2AQ3WWREQJ7YMMTQJZR3DA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XURSI#issuecomment-531581129", "url": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XSZ2AQ3WWREQJ7YMMTQJZR3DA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XURSI#issuecomment-531581129", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

@swesterfeld pushed 1 commit.

  • 0e14df1 BSE: Resampler2: fix compilation with clang


You are receiving this because you are subscribed to this thread.
View it on GitHub or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125/files/55e5fe36fce9a874e5a9a262433eeef24c5cebba..0e14df11e638c164177b98d00ef34a7d1a08f02f?email_source=notifications\u0026email_token=AIVS7XXUMXMYMK53D6PHT5LQJ2B3JA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZTMMJQGAZDGMY", "url": "https://github.com/tim-janik/beast/pull/125/files/55e5fe36fce9a874e5a9a262433eeef24c5cebba..0e14df11e638c164177b98d00ef34a7d1a08f02f?email_source=notifications\u0026email_token=AIVS7XXUMXMYMK53D6PHT5LQJ2B3JA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFXNIHK3DMKJSXC5LFON2FA5LTNBHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZF5KB2WY3BDGMYTMNJYGEZDON2QOVZWQIZUGAZTMMJQGAZDGMY", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

@tim-janik commented on this pull request.


In tests/suite1-main.cc:

> @@ -188,6 +188,12 @@ main (int argc, char *argv[])
       bench_aida();
       return 0;
     }
+  if (argc >= 2 && argv[1] && std::string ("--resampler") == argv[1])
+    {
+      Bse::init_async (&argc, argv, argv[0], args);
+      extern int test_resampler (int, char **);

NEVER inline prototypes, ALWAYS use a header file!
Without any exception.
I've once spent days debugging misbehaviour due to mismatching prototype, never again!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XQRDBAZR7SF6FJWCC3QJ7FS7A5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE3PWSI#pullrequestreview-288815945", "url": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XQRDBAZR7SF6FJWCC3QJ7FS7A5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE3PWSI#pullrequestreview-288815945", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

Your branch is merged, but the --resampler options needs fixing.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XRYTP75VTVN4SVYKCDQJ7FYNA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62CG7Y#issuecomment-531899263", "url": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XRYTP75VTVN4SVYKCDQJ7FYNA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62CG7Y#issuecomment-531899263", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Resampler cleanups (#125)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

@swesterfeld commented on this pull request.


In tests/suite1-main.cc:

> @@ -188,6 +188,12 @@ main (int argc, char *argv[])
       bench_aida();
       return 0;
     }
+  if (argc >= 2 && argv[1] && std::string ("--resampler") == argv[1])
+    {
+      Bse::init_async (&argc, argv, argv[0], args);
+      extern int test_resampler (int, char **);

OK, should be fixed once you merge #126


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XWFYFB5OX6E44WB2O3QKCQJPA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE557DY#discussion_r325072198", "url": "https://github.com/tim-janik/beast/pull/125?email_source=notifications\u0026email_token=AIVS7XWFYFB5OX6E44WB2O3QKCQJPA5CNFSM4IVXPCKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCE557DY#discussion_r325072198", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast