From: Hans Verkuil <hverkuil@xs4all.nl>
To: Antti Palosaari <crope@iki.fi>
Cc: Andy Walls <awalls@md.metrocast.net>, linux-media@vger.kernel.org
Subject: Re: [PATCH RFC] libv4lconvert: SDR conversion from U8 to FLOAT
Date: Thu, 14 Nov 2013 14:50:53 +0100 [thread overview]
Message-ID: <5284D53D.9020603@xs4all.nl> (raw)
In-Reply-To: <5284D410.4010706@iki.fi>
On 11/14/13 14:45, Antti Palosaari wrote:
> On 11.11.2013 16:38, Hans Verkuil wrote:
>> On 11/11/2013 03:19 PM, Andy Walls wrote:
>>> On Sun, 2013-11-10 at 19:16 +0200, Antti Palosaari wrote:
>>>> Convert unsigned 8 to float 32 [-1 to +1], which is commonly
>>>> used format for baseband signals.
>>>
>>> Hi Annti,
>>>
>>> I don't think this a good idea. Floating point representations are
>>> inherently non-portable. Even though most everything now uses IEEE-754
>>> representation, things like denormaliazed numbers may be treated
>>> differently by different machines. If someone saves the data to a file,
>>> endianess issues aside, there are no guarantees that a different machine
>>> reading is going to interpret all the floating point data from that file
>>> properly.
>>>
>>> I really would recommend staying with scaled integer representations or
>>> explicit integer mantissa, exponent representations.
>>
>> For what it's worth: ALSA does support float format as well (both LE and BE).
>
> I want use existing data formats and that [-1 to +1] scaled 32-bit IEEE-754 floating point is de facto format for SDR application (actually pair of floats as a complex).
>
> Doing conversion inside libv4lconvert makes it very easy for write application. Currently I have implemented GNU Radio and SDRsharp plugins that feeds data from device via libv4l2 using mmap and conversion.
>
> Thanks to pointing endianess issue, I didn't though it all. I suspect those apps just relies to local endianess. So do I have to implement float format conversion with both endianess?
I would say that it should be written with endianness conversion in mind. It's not
likely to be used on a big-endian system, but it should be possible to support it
without too much work.
Regards,
Hans
next prev parent reply other threads:[~2013-11-14 13:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-10 17:16 [PATCH RFC] libv4lconvert: SDR conversion from U8 to FLOAT Antti Palosaari
2013-11-11 13:14 ` Hans Verkuil
2013-11-11 13:40 ` Antti Palosaari
2013-11-11 13:52 ` Hans Verkuil
2013-11-15 19:11 ` Antti Palosaari
2013-11-15 19:13 ` Devin Heitmueller
2013-11-15 19:17 ` Antti Palosaari
2013-11-16 14:11 ` Antti Palosaari
2013-11-16 17:28 ` Hans de Goede
2013-11-11 14:19 ` Andy Walls
2013-11-11 14:38 ` Hans Verkuil
2013-11-14 13:45 ` Antti Palosaari
2013-11-14 13:50 ` Hans Verkuil [this message]
2013-11-18 17:43 ` Antti Palosaari
2013-11-16 17:27 ` Hans de Goede
2013-11-16 17:34 ` Antti Palosaari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5284D53D.9020603@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=awalls@md.metrocast.net \
--cc=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox