Lines Matching defs:psf

27 static sf_count_t alaw_read_alaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ;
28 static sf_count_t alaw_read_alaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ;
29 static sf_count_t alaw_read_alaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ;
30 static sf_count_t alaw_read_alaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ;
32 static sf_count_t alaw_write_s2alaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ;
33 static sf_count_t alaw_write_i2alaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ;
34 static sf_count_t alaw_write_f2alaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ;
35 static sf_count_t alaw_write_d2alaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ;
49 alaw_init (SF_PRIVATE *psf)
51 if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR)
52 { psf->read_short = alaw_read_alaw2s ;
53 psf->read_int = alaw_read_alaw2i ;
54 psf->read_float = alaw_read_alaw2f ;
55 psf->read_double = alaw_read_alaw2d ;
58 if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR)
59 { psf->write_short = alaw_write_s2alaw ;
60 psf->write_int = alaw_write_i2alaw ;
61 psf->write_float = alaw_write_f2alaw ;
62 psf->write_double = alaw_write_d2alaw ;
65 psf->bytewidth = 1 ;
66 psf->blockwidth = psf->sf.channels ;
68 if (psf->filelength > psf->dataoffset)
69 psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : psf->filelength - psf->dataoffset ;
71 psf->datalength = 0 ;
73 psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ;
365 alaw_read_alaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len)
375 readcount = (int) psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ;
387 alaw_read_alaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len)
397 readcount = (int) psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ;
409 alaw_read_alaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len)
415 normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ;
422 readcount = (int) psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ;
434 alaw_read_alaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len)
440 normfact = (psf->norm_double) ? 1.0 / ((double) 0x8000) : 1.0 ;
446 readcount = (int) psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ;
461 alaw_write_s2alaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len)
472 writecount = (int) psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ;
483 alaw_write_i2alaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len)
494 writecount = (int) psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ;
505 alaw_write_f2alaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len)
511 normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) / 16.0 : 1.0 / 16 ;
519 writecount = (int) psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ;
530 alaw_write_d2alaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len)
536 normfact = (psf->norm_double) ? (1.0 * 0x7FFF) / 16.0 : 1.0 / 16.0 ;
544 writecount = (int) psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ;