Lines Matching defs:block
107 unsigned short block [NMS_BLOCK_SHORTS_32] ;
152 static void nms_adpcm_block_pack_16 (const int16_t codewords [], uint16_t block [], int16_t rms) ;
153 static void nms_adpcm_block_pack_24 (const int16_t codewords [], uint16_t block [], int16_t rms) ;
154 static void nms_adpcm_block_pack_32 (const int16_t codewords [], uint16_t block [], int16_t rms) ;
156 static void nms_adpcm_block_unpack_16 (const uint16_t block [], int16_t codewords [], int16_t *rms) ;
157 static void nms_adpcm_block_unpack_24 (const uint16_t block [], int16_t codewords [], int16_t *rms) ;
158 static void nms_adpcm_block_unpack_32 (const uint16_t block [], int16_t codewords [], int16_t *rms) ;
160 static int nms_adpcm_decode_block (SF_PRIVATE *psf, NMS_ADPCM_PRIVATE *pnms, uint16_t block [], int16_t samples []) ;
161 static int nms_adpcm_encode_block (SF_PRIVATE *psf, NMS_ADPCM_PRIVATE *pnms, int16_t samples [], uint16_t block []) ;
434 ** or 40 shorts. The last short represents the block's root-mean-square
436 ** detection processes can avoid decoding a block.
448 ** Reads 21 shorts from block, unpacks 160 codewords of 2-bits each, writing
450 ** read block rms is copied to its location.
453 nms_adpcm_block_unpack_16 (const uint16_t block [], int16_t codewords [], int16_t *rms)
463 w = *(block++) ;
473 ** Every block ends with a short representing a RMS-approximation for the
474 ** block.
477 *rms = *block ;
481 ** Reads 31 shorts from block, unpacks 160 codewords of 3-bits each, writing
483 ** read block rms is copied to its location.
486 nms_adpcm_block_unpack_24 (const uint16_t block [], int16_t codewords [], int16_t *rms)
496 { w = *(block++) ;
510 ** Every block ends with a short representing a RMS-approximation for the
511 ** block.
514 *rms = *block ;
518 ** Reads 41 shorts from block, unpacks 160 codewords of 4-bits each, writing
520 ** read block rms is copied to its location.
523 nms_adpcm_block_unpack_32 (const uint16_t block [], int16_t codewords [], int16_t *rms)
528 { w = *(block++) ;
535 ** Every block ends with a short representing a RMS-approximation for the
536 ** block.
539 *rms = *block ;
544 ** into 20 shorts of block, and writes the short rms for a total of 42 bytes.
547 nms_adpcm_block_pack_16 (const int16_t codewords [], uint16_t block [], int16_t rms)
561 *(block++) = w ;
564 /* Every block ends with a short representing the blocks RMS */
565 *block = rms ;
570 ** into 30 shorts of block, and writes the short rms for a total of 62 bytes.
573 nms_adpcm_block_pack_24 (const int16_t codewords [], uint16_t block [], int16_t rms)
606 *(block++) = w [0] ;
607 *(block++) = w [1] ;
608 *(block++) = w [2] ;
611 /* Every block ends with a short representing the blocks RMS */
612 *block = rms ;
617 ** into 40 shorts of block, and writes the short rms for a total of 82 bytes.
620 nms_adpcm_block_pack_32 (const int16_t codewords [], uint16_t block [], int16_t rms)
630 *(block++) = w ;
633 /* Every block ends with a short representing the blocks RMS */
634 *block = rms ;
638 nms_adpcm_decode_block (SF_PRIVATE *psf, NMS_ADPCM_PRIVATE *pnms, uint16_t block [], int16_t samples [])
643 nms_adpcm_block_unpack_16 (block, samples, NULL) ;
646 nms_adpcm_block_unpack_24 (block, samples, NULL) ;
649 nms_adpcm_block_unpack_32 (block, samples, NULL) ;
664 nms_adpcm_encode_block (SF_PRIVATE *psf, NMS_ADPCM_PRIVATE *pnms, int16_t samples [], uint16_t block [])
684 nms_adpcm_block_pack_16 (samples, block, rms) ;
687 nms_adpcm_block_pack_24 (samples, block, rms) ;
690 nms_adpcm_block_pack_32 (samples, block, rms) ;
705 if ((k = (int) psf_fread (pnms->block, sizeof (short), pnms->shortsperblock, psf)) != pnms->shortsperblock)
707 memset (pnms->block + (k * sizeof (short)), 0, (pnms->shortsperblock - k) * sizeof (short)) ;
711 endswap_short_array ((signed short *) pnms->block, pnms->shortsperblock) ;
713 nms_adpcm_decode_block (psf, pnms, pnms->block, pnms->samples) ;
872 nms_adpcm_encode_block (psf, pnms, pnms->samples, pnms->block) ;
875 endswap_short_array ((signed short *) pnms->block, pnms->shortsperblock) ;
877 /* Write the block to disk. */
878 if ((k = (int) psf_fwrite (pnms->block, sizeof (short), pnms->shortsperblock, psf)) != pnms->shortsperblock)
1108 ** If a block has been partially assembled, write it out as the final
1109 ** block.