Csound Csound-dev Csound-tekno Search About

A new opcode almost completed

Date2017-03-09 20:03
FromGleb
SubjectA new opcode almost completed
Hello, guys!

I have just finished a new opcode with working title ftsaveb. The last b
stands for bit. The opcode writes formats ftable data and writes it to file. 

Syntax:
ftsaveb ihandle, ifn,kBitNum,kSize 

ihandle is a file handle returned from fiopen
ifn - an ftable which contains a frame of data
kBitNum - an array which contains number of bits per each field
kSize - an array which contains number of elements per each field

In case of
kBitNum[] fillarray 3,5,2
kSize[] fillarray 2,2,3

first two elements of ifn will be bitshifted to 3 most significant bits,
next two elements - to 5 most significant bits, and last 3 elements - to 2
most significant bits. After it, the coded frame will be padded and recorded
to file in a format
AAAA AABB BBBB BBBB CCCC CC00,
where AAAAAA - six bits of the first bit field, B...B - 10 bits of the
second bit field, C..C - 6 bits of the third bit field, 00 - padding to byte
alignment.

The realised procedure of formatting is A MUST for any coding algorithm. So
I believe this is a first step to use Csound for some coding related
processing, i.e. digital audio watermarking, perceptual coding and other
funny things. 

The next thing is a mirror opcode with working title ftloadb. It will load a
coded frame and turn it into a series of decoded samples.


PLEASE, if somebody has suggestions of any kind - I'll be glad to read it.
Maybe I can add some extra features. 

Thank you!  



-----
Gleb Rogozinsky, PhD
Associated Professor
Interactive Arts Department
Saint-Petersburg University of Film and Television

Deputy Director of Medialab
Saint-Petersburg University of Telecommunications
--
View this message in context: http://csound.1045644.n5.nabble.com/Csnd-A-new-opcode-almost-completed-tp5755006.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here