help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fread and 24 bit precision


From: Alois Schloegl
Subject: fread and 24 bit precision
Date: Tue, 1 Jun 2004 05:39:17 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


I do have 24bit and 12bit integer data in a binary file and need to load this into Octave.
I'm aware that I could use a workaround like the following.
[s,c] = fread(fid,3*nr,'uint8');
s=reshape(s,3,nr);
s(3,s(3,:)>127)=s(3,s(3,:)>127)-256;
s=(2^[0,8,16])*reshape(s,3,nr);

The disadvantage of such a solution are:
(1) the octave code is not very clean, and
(2) degrades the performance

Therefore, I'm asking if somebody is working on a native support of 24bit data in fread?

cheers,
   Alois






-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]