[med-svn] [Git][med-team/libslow5lib][master] Use streamvbyte properly (hopefully)

Andreas Tille (@tille) gitlab at salsa.debian.org
Thu Jun 30 10:19:30 BST 2022



Andreas Tille pushed to branch master at Debian Med / libslow5lib


Commits:
c6c6c747 by Andreas Tille at 2022-06-30T11:19:01+02:00
Use streamvbyte properly (hopefully)

- - - - -


1 changed file:

- debian/patches/use_debian_packaged_streamvbyte.patch


Changes:

=====================================
debian/patches/use_debian_packaged_streamvbyte.patch
=====================================
@@ -40,3 +40,50 @@ Description: Use Debian packaged streamvbyte library
  ifeq ($(zstd),1)
  CFLAGS		+= -DSLOW5_USE_ZSTD
  LDFLAGS		+= -lzstd
+--- a/src/slow5_press.c
++++ b/src/slow5_press.c
+@@ -1034,7 +1034,7 @@ static ssize_t fwrite_compress_zlib(stru
+ static uint8_t *ptr_compress_svb(const uint32_t *ptr, size_t count, size_t *n) {
+     uint32_t length = count / sizeof *ptr;
+ 
+-    size_t max_n = __slow5_streamvbyte_max_compressedbytes(length);
++    size_t max_n = streamvbyte_max_compressedbytes(length);
+     uint8_t *out = (uint8_t *) malloc(max_n + sizeof length);
+     if (!out) {
+         SLOW5_MALLOC_ERROR();
+@@ -1042,7 +1042,7 @@ static uint8_t *ptr_compress_svb(const u
+         return NULL;
+     }
+ 
+-    *n = __slow5_streamvbyte_encode(ptr, length, out + sizeof length);
++    *n = streamvbyte_encode(ptr, length, out + sizeof length);
+     memcpy(out, &length, sizeof length); /* copy original length of ptr (needed for depress) */
+     *n = *n + sizeof length;
+     SLOW5_LOG_DEBUG("max svb bytes=%zu\nsvb bytes=%zu\n",
+@@ -1070,7 +1070,7 @@ static uint8_t *ptr_compress_svb_zd(cons
+         slow5_errno = SLOW5_ERR_MEM;
+         return NULL;
+     }
+-    __slow5_zigzag_delta_encode(in, diff, length, 0);
++    zigzag_delta_encode(in, diff, length, 0);
+ 
+ 
+     SLOW5_LOG_DEBUG("orig bytes=%zu\n", count); /* TESTING */
+@@ -1094,7 +1094,7 @@ static uint32_t *ptr_depress_svb(const u
+     }
+ 
+     size_t bytes_read;
+-    if ((bytes_read = __slow5_streamvbyte_decode(ptr + sizeof length, out, length)) != count - sizeof length) {
++    if ((bytes_read = streamvbyte_decode(ptr + sizeof length, out, length)) != count - sizeof length) {
+         SLOW5_ERROR("Expected streamvbyte_decode to read '%zu' bytes, instead read '%zu' bytes.",
+                 count - sizeof length, bytes_read);
+         slow5_errno = SLOW5_ERR_PRESS;
+@@ -1122,7 +1122,7 @@ static int16_t *ptr_depress_svb_zd(const
+         slow5_errno = SLOW5_ERR_MEM;
+         return NULL;
+     }
+-    __slow5_zigzag_delta_decode(diff, orig, length, 0);
++    zigzag_delta_decode(diff, orig, length, 0);
+ 
+     // int16_t *orig = (int16_t *) malloc(length * sizeof *orig);
+     // for (int64_t i = 0; i < length; ++ i) {



View it on GitLab: https://salsa.debian.org/med-team/libslow5lib/-/commit/c6c6c74778729681834008c2603a7524ec232cee

-- 
View it on GitLab: https://salsa.debian.org/med-team/libslow5lib/-/commit/c6c6c74778729681834008c2603a7524ec232cee
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220630/15f09cbf/attachment-0001.htm>


More information about the debian-med-commit mailing list