c_pck32 - Pack 10-bit data into a 32-bit format

SYNTAX

FUNCTION c_pck32(inbuf, outbuf, nwords)

     short   *inbuf;      
     unsigned char *outbuf;
     long    *nwords;

PARAMETERS

inbuf (short *, input)

A series of 10-bit words, each stored right justified in a 16-bit word.

outbuf (unsigned char *, output)

A pointer to the series of packed 32-bit words. Each set of 3 10-bit words is packed right-justified into a 32-bit word with 2 bits unused on the left.

nwords (long *, input)

The number of input 10-bit words to pack.

DESCRIPTION

The c_pck32() routine is used to pack 10-bit words into 3 words per 32-bit word. The input 10-bit words are packed in groups of three into 32-bit words in the following manner:

     Format of input buffer:
     +--------------------+
     !000000    Word 1    !  1st 16-bit word
     +--------------------+
     !000000    Word_2    !  2nd 16-bit word
     +--------------------+
     !000000    Word_3    !  3rd 16-bit word
     +--------------------+
     !000000    Word_4    !  4th 16-bit word
     +--------------------+
     !000000    Word_5    !  5th 16-bit word
     +--------------------+
     !000000    Word_6    !  6th 16-bit word
     +--------------------+
     etc.

     Format of output buffer:
     +-----------------------------------------------+
     |00     Word 1    :    Word 2    :    Word 3    |  1st 32-bit word
     +-----------------------------------------------+
     |00     Word 4    :    Word 5    :    Word 6    |  2nd 32-bit word
     +-----------------------------------------------+
     etc.
If nwords is not a multiple of three, unused 10-bit words are stored left-justified in the 32-bit output word.

     Example:
     +-----------------------------------------------+
     |00:    Word_7    :    Word_8    : blank 10 bits|
     +-----------------------------------------------+
     or
     +-----------------------------------------------+
     |00:    Word_7    : blank 10 bits: blank 10 bits|
     +-----------------------------------------------+
On VMS systems the resulting 32-bit buffer is byte-swapped four bytes at a time, so the resulting buffer looks like:

     +--------+--------+--------+--------+
     |33333333|22222233|11112222|00111111|
     +--------+--------+--------+--------+

RETURN VALUE

c_pck32() has no return value.