convertir un mot de 16 bits en un mot de 12 bits

convertir un mot de 16 bits en un mot de 12 bits

Post by messmer.luci » Thu, 14 Jun 2001 01:27:31



bonjour,
Connaissez-vous un moyen de convertir un mot de 16 bits en un mot de 12 bits
 j'ai besoin de cette methode pour effectuer un programme de compression en ADA 95
Par avance merci.
 
 
 

convertir un mot de 16 bits en un mot de 12 bits

Post by Phil Carmod » Thu, 14 Jun 2001 02:26:15



> bonjour,
> Connaissez-vous un moyen de convertir un mot de 16 bits en un mot de 12 bits
>  j'ai besoin de cette methode pour effectuer un programme de compression en ADA 95
> Par avance merci.

Let's see if I understand the question first. I may be a bit rusty, here
goes...

~~~
Hi,
Do (any of) you grok a method to convert a 16-bit word into a 12-bit
word.
I need this method in order to implement a compression program in ADA
95.
Thanks in advance.
~~~

Firstly you need to know the full set of possible values the 16-bit word
may have.
If it can only take <2^12 values, then use a simple lookup table, or
equivalent, to
map the possible values onto an index 0..<2^12.

If the number of values is greated than 2^12, then you need to start
looking at losing some of that data.
If you divide all the values by 16 (2^4), then they'll all fit, for
example, but you'll lose the low order bits.
If you've got audio data, then you probably want to look at dividing the
2^12 range into equal width slices, and the 2^16 range into the same
number of exponentially increasing width slices, and linearly map each
slice independently.
Do a search for A-Law or mu-law or the international standard ITU G.711.

Phil