[hamradio-commits] [soapyrtlsdr] 01/02: Add implement-big-endian-build patch

Andreas E. Bombe aeb at moszumanska.debian.org
Tue Aug 16 20:21:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

aeb pushed a commit to branch master
in repository soapyrtlsdr.

commit 02bb9db436391c6f371eeaf49c905fccd4b94b0a
Author: Andreas Bombe <aeb at debian.org>
Date:   Tue Aug 16 19:30:37 2016 +0200

    Add implement-big-endian-build patch
---
 debian/changelog                          |  6 ++++
 debian/patches/implement-big-endian-build | 55 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 62 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3b9e605..7e6d58f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+soapyrtlsdr (0.2.1-2) UNRELEASED; urgency=medium
+
+  * Add implement-big-endian-build patch
+
+ -- Andreas Bombe <aeb at debian.org>  Tue, 16 Aug 2016 19:32:20 +0200
+
 soapyrtlsdr (0.2.1-1) unstable; urgency=medium
 
   * Initial release (Closes: #834378)
diff --git a/debian/patches/implement-big-endian-build b/debian/patches/implement-big-endian-build
new file mode 100644
index 0000000..b21ad9f
--- /dev/null
+++ b/debian/patches/implement-big-endian-build
@@ -0,0 +1,55 @@
+Description: Implement building for big endian
+ A few lookup tables are created to convert 8 bit integer I/Q data to
+ the format SoapySDR expects. The lookups index the table with the 16
+ bit I/Q combination from the hardware and the big endian part was not
+ implemented. This patch reorganizes the code a bit to make a clean
+ little and big endian implementation.
+Author: Andreas Bombe <aeb at debian.org>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Streaming.cpp
++++ b/Streaming.cpp
+@@ -174,10 +174,17 @@
+         for (unsigned int i = 0; i <= 0xffff; i++)
+         {
+ # if (__BYTE_ORDER == __LITTLE_ENDIAN)
++	    float re = ((i & 0xff) - 127.4f) * (1.0f / 128.0f);
++	    float im = ((i >> 8) - 127.4f) * (1.0f / 128.0f);
++#else
++	    float re = ((i >> 8) - 127.4f) * (1.0f / 128.0f);
++	    float im = ((i & 0xff) - 127.4f) * (1.0f / 128.0f);
++#endif
++
+             std::complex<float> v32f, vs32f;
+ 
+-            v32f.real((float(i & 0xff) - 127.4f) * (1.0f / 128.0f));
+-            v32f.imag((float(i >> 8) - 127.4f) * (1.0f / 128.0f));
++            v32f.real(re);
++            v32f.imag(im);
+             _lut_32f.push_back(v32f);
+ 
+             vs32f.real(v32f.imag());
+@@ -186,21 +193,13 @@
+ 
+             std::complex<int16_t> v16i, vs16i;
+ 
+-            v16i.real(int16_t((float(SHRT_MAX) * ((float(i & 0xff) - 127.4f) * (1.0f / 128.0f)))));
+-            v16i.imag(int16_t((float(SHRT_MAX) * ((float(i >> 8) - 127.4f) * (1.0f / 128.0f)))));
++            v16i.real(int16_t((float(SHRT_MAX) * re)));
++            v16i.imag(int16_t((float(SHRT_MAX) * im)));
+             _lut_16i.push_back(v16i);
+ 
+             vs16i.real(vs16i.imag());
+             vs16i.imag(vs16i.real());
+             _lut_swap_16i.push_back(vs16i);
+-
+-#else // BIG_ENDIAN
+-#error  TODO
+-            //        tmp_swap.imag = tmp.real = (float(i >> 8) - 127.4f) * (1.0f/128.0f);
+-            //        tmp_swap.real = tmp.imag = (float(i & 0xff) - 127.4f) * (1.0f/128.0f);
+-            //        _lut.push_back(tmp);
+-            //        _lut_swap.push_back(tmp_swap);
+-#endif
+         }
+     }
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9986e1e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+implement-big-endian-build

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/soapyrtlsdr.git



More information about the pkg-hamradio-commits mailing list