<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blosc Home Page  (Posts by Oscar Guiñón, Marta Iborra)</title><link>https://blosc.org/</link><description></description><atom:link href="https://blosc.org/authors/oscar-guinon-marta-iborra.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:blosc@blosc.org"&gt;The Blosc Developers&lt;/a&gt; </copyright><lastBuildDate>Sun, 19 Jul 2026 11:09:12 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title> Registering plugins in C-Blosc2</title><link>https://blosc.org/posts/registering-plugins/</link><dc:creator>Oscar Guiñón, Marta Iborra</dc:creator><description>&lt;p&gt;Blosc has traditionally supported different filters and codecs for compressing data,
and it was up to the user to choose one or another depending on her needs.
However, there will always be scenarios where a more richer variety of them could be useful.&lt;/p&gt;
&lt;p&gt;Blosc2 has now a new plugin register capability in place so that the info about the new filters and codecs can be persisted and transmitted to different machines.
In this way Blosc can figure out the info of persistent plugins, and use them so as to decompress the data without problems.&lt;/p&gt;
&lt;p&gt;Besides, the Blosc Development Team has implemented a centralized repository so that people can propose new plugins; and if these plugins fulfill a series of requirements, they will be officially accepted, and distributed &lt;em&gt;within&lt;/em&gt; the C-Blosc2 library.  This provides an easy path for extending C-Blosc2 and hence, better adapt to user needs.&lt;/p&gt;
&lt;p&gt;The plugins that can be registered in the repository can be either codecs or filters.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;codec&lt;/strong&gt; is a program able to compress and decompress a data stream with the objective of reducing its size and to enable a faster transmission of data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;filter&lt;/strong&gt; is a program that reorders the data without changing its size, so that the initial and final size are equal. A filter consists of encoder and decoder.
The filter encoder is applied before the codec compressor (or codec encoder) in order to make data easier to compress
and the filter decoder is used after codec decompressor (or codec decoder) to restore the original data arrangement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here it is an example on how the compression process goes:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code console"&gt;&lt;a id="rest_code_d614d69ed87e4f92a95103542ff24582-1" name="rest_code_d614d69ed87e4f92a95103542ff24582-1" href="https://blosc.org/posts/registering-plugins/#rest_code_d614d69ed87e4f92a95103542ff24582-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;--------------------   filter encoder  -------------------   codec encoder   -------&lt;/span&gt;
&lt;a id="rest_code_d614d69ed87e4f92a95103542ff24582-2" name="rest_code_d614d69ed87e4f92a95103542ff24582-2" href="https://blosc.org/posts/registering-plugins/#rest_code_d614d69ed87e4f92a95103542ff24582-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;|        src        |   -----------&amp;gt;  |        tmp        |   ----------&amp;gt;   | c_src |&lt;/span&gt;
&lt;a id="rest_code_d614d69ed87e4f92a95103542ff24582-3" name="rest_code_d614d69ed87e4f92a95103542ff24582-3" href="https://blosc.org/posts/registering-plugins/#rest_code_d614d69ed87e4f92a95103542ff24582-3"&gt;&lt;/a&gt;&lt;span class="go"&gt;--------------------                   -------------------                   -------&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And the decompression process:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code console"&gt;&lt;a id="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-1" name="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-1" href="https://blosc.org/posts/registering-plugins/#rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;--------   codec decoder    -------------------   filter decoder  -------------------&lt;/span&gt;
&lt;a id="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-2" name="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-2" href="https://blosc.org/posts/registering-plugins/#rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;| c_src |   -----------&amp;gt;   |        tmp        |   ----------&amp;gt;   |        src        |&lt;/span&gt;
&lt;a id="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-3" name="rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-3" href="https://blosc.org/posts/registering-plugins/#rest_code_c15c8c7ce3ac4fa2aef1e9944dbf7132-3"&gt;&lt;/a&gt;&lt;span class="go"&gt;--------                    -------------------                   -------------------&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;section id="register-for-user-plugins"&gt;
&lt;h2&gt;Register for user plugins&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;User registered plugins&lt;/strong&gt; are plugins that users register locally so that they can be used in the same way as Blosc official codecs and filters.
This option is perfect for users that want to try new filters or codecs on their own.&lt;/p&gt;
&lt;p&gt;The register process is quite simple.  You just use the &lt;code class="docutils literal"&gt;blosc2_register_filter()&lt;/code&gt; or &lt;code class="docutils literal"&gt;blosc2_register_codec()&lt;/code&gt; function and then the Blosc2 machinery
will store its info with the rest of plugins. After that you will be able to access your plugin through its ID by setting Blosc2 compression or decompression
params.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code console"&gt;&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-1" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-1" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                             filters pipeline&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-2" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-2" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-3" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-3" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-3"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_SHUFFLE     1 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-4" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-4" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-4"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-5" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-5" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-5"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_BITSHUFFLE  2 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-6" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-6" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-6"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-7" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-7" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-7"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_DELTA       3 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-8" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-8" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-8"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-9" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-9" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-9"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_TRUNC       4 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-10" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-10" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-10"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-11" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-11" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-11"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |         ...          |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-12" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-12" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-12"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-13" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-13" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-13"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_NDCELL     32 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-14" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-14" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-14"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-15" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-15" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-15"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  BLOSC_NDMEAN     33 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-16" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-16" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-16"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-17" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-17" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-17"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |         ...          |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-18" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-18" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-18"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-19" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-19" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-19"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |  urfilter1       160 |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-20" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-20" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-20"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-21" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-21" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-21"&gt;&lt;/a&gt;&lt;span class="go"&gt;blosc2_register_filter(urfilter2)  ---&amp;gt;  |  urfilter2       161 |  ---&amp;gt; cparams.filters[4] = 161; // can be used now&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-22" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-22" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-22"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-23" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-23" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-23"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                         |         ...          |&lt;/span&gt;
&lt;a id="rest_code_6325734f2e6544bbaa5204e72806a0eb-24" name="rest_code_6325734f2e6544bbaa5204e72806a0eb-24" href="https://blosc.org/posts/registering-plugins/#rest_code_6325734f2e6544bbaa5204e72806a0eb-24"&gt;&lt;/a&gt;&lt;span class="go"&gt;                                          ----------------------&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="global-register-for-blosc-plugins"&gt;
&lt;h2&gt;Global register for Blosc plugins&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Blosc global registered plugins&lt;/strong&gt; are Blosc plugins that have passed through a selection process and a review by the Blosc Development Team.
These plugins will be available for everybody using the C-Blosc2 library.&lt;/p&gt;
&lt;p&gt;You should consider this option if you think that your codec or filter could be useful for the community, or you just want being able to use
them with upstream C-Blosc2 library.  The steps for registering an official Blosc plugin can be seen at:
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/plugins/README.md"&gt;https://github.com/Blosc/c-blosc2/blob/main/plugins/README.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some well documented examples of these kind of plugins are the codec &lt;code class="docutils literal"&gt;ndlz&lt;/code&gt; and the filters &lt;code class="docutils literal"&gt;ndcell&lt;/code&gt; and &lt;code class="docutils literal"&gt;ndmean&lt;/code&gt; on the C-Blosc2 GitHub repository:
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/tree/main/plugins"&gt;https://github.com/Blosc/c-blosc2/tree/main/plugins&lt;/a&gt;&lt;/p&gt;
&lt;/section&gt;
&lt;section id="compiling-plugins-examples-using-blosc2-wheels"&gt;
&lt;h2&gt;Compiling plugins examples using Blosc2 wheels&lt;/h2&gt;
&lt;p&gt;So as to easy the use of the registered filters, full-fledged C-Blosc2 binary libraries including plugins functionality can be installed from
python-blosc2 (&amp;gt;= 0.1.8) wheels:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code console"&gt;&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-1" name="rest_code_cb769a9bd81e4825ad320ece2573a618-1" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-1"&gt;&lt;/a&gt;&lt;span class="gp"&gt;$ &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;blosc2
&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-2" name="rest_code_cb769a9bd81e4825ad320ece2573a618-2" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;Collecting blosc2&lt;/span&gt;
&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-3" name="rest_code_cb769a9bd81e4825ad320ece2573a618-3" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-3"&gt;&lt;/a&gt;&lt;span class="go"&gt;  Downloading blosc2-0.1.8-cp37-cp37m-manylinux2010_x86_64.whl (3.3 MB)&lt;/span&gt;
&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-4" name="rest_code_cb769a9bd81e4825ad320ece2573a618-4" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-4"&gt;&lt;/a&gt;&lt;span class="go"&gt;     |████████████████████████████████| 3.3 MB 4.7 MB/s&lt;/span&gt;
&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-5" name="rest_code_cb769a9bd81e4825ad320ece2573a618-5" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-5"&gt;&lt;/a&gt;&lt;span class="go"&gt;Installing collected packages: blosc2&lt;/span&gt;
&lt;a id="rest_code_cb769a9bd81e4825ad320ece2573a618-6" name="rest_code_cb769a9bd81e4825ad320ece2573a618-6" href="https://blosc.org/posts/registering-plugins/#rest_code_cb769a9bd81e4825ad320ece2573a618-6"&gt;&lt;/a&gt;&lt;span class="go"&gt;Successfully installed blosc2-0.1.8&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Once you have installed the C-Blosc2 libraries you can not only use the official Blosc filters and codecs, but you can also register and use them.
You can find directions on how to compile C files using the Blosc2 libraries inside these wheels at:
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/COMPILING_WITH_WHEELS.rst"&gt;https://github.com/Blosc/c-blosc2/blob/main/COMPILING_WITH_WHEELS.rst&lt;/a&gt;&lt;/p&gt;
&lt;section id="using-user-plugins"&gt;
&lt;h3&gt;Using user plugins&lt;/h3&gt;
&lt;p&gt;To use your own plugins with the Blosc machinery you first have to register them through the function &lt;code class="docutils literal"&gt;blosc2_register_codec()&lt;/code&gt; or &lt;code class="docutils literal"&gt;blosc2_register_filter()&lt;/code&gt;
with an ID between &lt;code class="docutils literal"&gt;BLOSC2_USER_DEFINED_FILTERS_START&lt;/code&gt; and &lt;code class="docutils literal"&gt;BLOSC2_USER_DEFINED_FILTERS_STOP&lt;/code&gt;. Then you can use this ID in the compression parameters (&lt;cite&gt;cparams.compcode&lt;/cite&gt;, &lt;cite&gt;cparams.filters&lt;/cite&gt;) and decompression parameters (&lt;cite&gt;dparams.compcode&lt;/cite&gt;, &lt;cite&gt;dparams.filters&lt;/cite&gt;).
For any doubts you can see the whole process in the examples &lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/examples/urcodecs.c"&gt;urcodecs.c&lt;/a&gt; and &lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/examples/urfilters.c"&gt;urfilters.c&lt;/a&gt;.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code C"&gt;&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-1" name="rest_code_d2b68ca547994810b33491523a4b79fd-1" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;blosc2_codec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;urcodec&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-2" name="rest_code_d2b68ca547994810b33491523a4b79fd-2" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-2"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compcode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;244&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-3" name="rest_code_d2b68ca547994810b33491523a4b79fd-3" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-3"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compver&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-4" name="rest_code_d2b68ca547994810b33491523a4b79fd-4" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-4"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;complib&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-5" name="rest_code_d2b68ca547994810b33491523a4b79fd-5" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-5"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compname&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"urcodec"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-6" name="rest_code_d2b68ca547994810b33491523a4b79fd-6" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-6"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encoder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;codec_encoder&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-7" name="rest_code_d2b68ca547994810b33491523a4b79fd-7" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-7"&gt;&lt;/a&gt;&lt;span class="n"&gt;udcodec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decoder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;codec_decoder&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-8" name="rest_code_d2b68ca547994810b33491523a4b79fd-8" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-8"&gt;&lt;/a&gt;&lt;span class="n"&gt;blosc2_register_codec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;urcodec&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-9" name="rest_code_d2b68ca547994810b33491523a4b79fd-9" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-10" name="rest_code_d2b68ca547994810b33491523a4b79fd-10" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-10"&gt;&lt;/a&gt;&lt;span class="n"&gt;blosc2_cparams&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cparams&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;BLOSC2_CPARAMS_DEFAULTS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_d2b68ca547994810b33491523a4b79fd-11" name="rest_code_d2b68ca547994810b33491523a4b79fd-11" href="https://blosc.org/posts/registering-plugins/#rest_code_d2b68ca547994810b33491523a4b79fd-11"&gt;&lt;/a&gt;&lt;span class="n"&gt;cparams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compcode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;244&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="using-blosc-official-plugins"&gt;
&lt;h3&gt;Using Blosc official plugins&lt;/h3&gt;
&lt;p&gt;To use the Blosc official plugins it is mandatory to add the next lines in order to activate the plugins mechanism:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;code class="docutils literal"&gt;#include &lt;span class="pre"&gt;"blosc2/codecs-registery.h"&lt;/span&gt;&lt;/code&gt; or &lt;code class="docutils literal"&gt;#include &lt;span class="pre"&gt;"blosc2/filters-registery.h"&lt;/span&gt;&lt;/code&gt; depending on the plugin type at the beginning of the file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code class="docutils literal"&gt;#include "blosc2/blosc2.h"&lt;/code&gt; at the beginning of the file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Call &lt;code class="docutils literal"&gt;blosc_init()&lt;/code&gt; at the beginning of main() function&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Call &lt;code class="docutils literal"&gt;blosc_destroy()&lt;/code&gt; at the end of main() function&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then you just have to use the ID of the plugin that you want to use in the compression parameters (&lt;code class="docutils literal"&gt;cparams.compcode&lt;/code&gt;).&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code C"&gt;&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-1" name="rest_code_655afc1850a44cc68571fff2d98066f7-1" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-1"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;"blosc2.h"&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-2" name="rest_code_655afc1850a44cc68571fff2d98066f7-2" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-2"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;"../codecs-registry.h"&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-3" name="rest_code_655afc1850a44cc68571fff2d98066f7-3" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-3"&gt;&lt;/a&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-4" name="rest_code_655afc1850a44cc68571fff2d98066f7-4" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;blosc_init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-5" name="rest_code_655afc1850a44cc68571fff2d98066f7-5" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-6" name="rest_code_655afc1850a44cc68571fff2d98066f7-6" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;blosc2_cparams&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cparams&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;BLOSC2_CPARAMS_DEFAULTS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-7" name="rest_code_655afc1850a44cc68571fff2d98066f7-7" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cparams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compcode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;BLOSC_CODEC_NDLZ&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-8" name="rest_code_655afc1850a44cc68571fff2d98066f7-8" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cparams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compcode_meta&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-9" name="rest_code_655afc1850a44cc68571fff2d98066f7-9" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-9"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-10" name="rest_code_655afc1850a44cc68571fff2d98066f7-10" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;blosc_destroy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a id="rest_code_655afc1850a44cc68571fff2d98066f7-11" name="rest_code_655afc1850a44cc68571fff2d98066f7-11" href="https://blosc.org/posts/registering-plugins/#rest_code_655afc1850a44cc68571fff2d98066f7-11"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In case of doubts, you can see how the whole process works in working tests like:
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/plugins/codecs/ndlz/test_ndlz.c"&gt;test_ndlz.c&lt;/a&gt;,
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/plugins/filters/ndcell/test_ndcell.c"&gt;test_ndcell.c&lt;/a&gt;,
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/plugins/filters/ndmean/test_ndmean_mean.c"&gt;test_ndmean_mean.c&lt;/a&gt; and
&lt;a class="reference external" href="https://github.com/Blosc/c-blosc2/blob/main/plugins/filters/ndmean/test_ndmean_repart.c"&gt;test_ndmean_repart.c&lt;/a&gt;.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="final-remarks"&gt;
&lt;h2&gt;Final remarks&lt;/h2&gt;
&lt;p&gt;The plugin register functionality let use new codecs and filters within Blosc in an easy and quick way. To enhance the plugin experience, we
have implemented a centralized plugin repository, so that users can propose their own plugins to be in the standard C-Blosc2 library for
the benefit of all the Blosc community.&lt;/p&gt;
&lt;p&gt;The Blosc Development Team kindly invites you to test the different plugins we already offer, but also to try with your own one.  Besides, if you are willing to contribute it to the community, then apply to register it. This way everyone will be able to enjoy a variety of different and unique plugins.  Hope you will enjoy this new and exciting feature!&lt;/p&gt;
&lt;p&gt;Last but not least, a big thank you to the NumFOCUS foundation for providing a grant for implementing the register functionality.&lt;/p&gt;
&lt;/section&gt;</description><category>blosc plugins codecs filters</category><guid>https://blosc.org/posts/registering-plugins/</guid><pubDate>Mon, 28 Jun 2021 10:32:20 GMT</pubDate></item></channel></rss>