• Home
  • Raw
  • Download

Lines Matching refs:ppaf24

339 static int paf24_read_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) ;
340 static int paf24_write_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) ;
346 { PAF24_PRIVATE *ppaf24 ; in paf24_init() local
361 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_init()
363 ppaf24->channels = psf->sf.channels ; in paf24_init()
364 ppaf24->samples = ppaf24->data ; in paf24_init()
365 ppaf24->block = ppaf24->data + PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; in paf24_init()
367 ppaf24->blocksize = PAF24_BLOCK_SIZE * ppaf24->channels ; in paf24_init()
370 { paf24_read_block (psf, ppaf24) ; /* Read first block. */ in paf24_init()
394 ppaf24->max_blocks = psf->datalength / ppaf24->blocksize + 1 ; in paf24_init()
397 ppaf24->max_blocks = psf->datalength / ppaf24->blocksize ; in paf24_init()
399 ppaf24->read_block = 0 ; in paf24_init()
401 ppaf24->write_block = ppaf24->max_blocks ; in paf24_init()
403 ppaf24->write_block = 0 ; in paf24_init()
405 psf->sf.frames = PAF24_SAMPLES_PER_BLOCK * ppaf24->max_blocks ; in paf24_init()
406 ppaf24->sample_count = psf->sf.frames ; in paf24_init()
413 { PAF24_PRIVATE *ppaf24 ; in paf24_seek() local
421 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_seek()
423 if (mode == SFM_READ && ppaf24->write_count > 0) in paf24_seek()
424 paf24_write_block (psf, ppaf24) ; in paf24_seek()
431 if (psf->last_op == SFM_WRITE && ppaf24->write_count) in paf24_seek()
432 paf24_write_block (psf, ppaf24) ; in paf24_seek()
434 psf_fseek (psf, psf->dataoffset + newblock * ppaf24->blocksize, SEEK_SET) ; in paf24_seek()
435 ppaf24->read_block = newblock ; in paf24_seek()
436 paf24_read_block (psf, ppaf24) ; in paf24_seek()
437 ppaf24->read_count = newsample ; in paf24_seek()
441 if (offset > ppaf24->sample_count) in paf24_seek()
446 if (psf->last_op == SFM_WRITE && ppaf24->write_count) in paf24_seek()
447 paf24_write_block (psf, ppaf24) ; in paf24_seek()
449 psf_fseek (psf, psf->dataoffset + newblock * ppaf24->blocksize, SEEK_SET) ; in paf24_seek()
450 ppaf24->write_block = newblock ; in paf24_seek()
451 paf24_read_block (psf, ppaf24) ; in paf24_seek()
452 ppaf24->write_count = newsample ; in paf24_seek()
465 { PAF24_PRIVATE *ppaf24 ; in paf24_close() local
470 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_close()
473 { if (ppaf24->write_count > 0) in paf24_close()
474 paf24_write_block (psf, ppaf24) ; in paf24_close()
483 paf24_read_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) in paf24_read_block() argument
487 ppaf24->read_block ++ ; in paf24_read_block()
488 ppaf24->read_count = 0 ; in paf24_read_block()
490 if (ppaf24->read_block * PAF24_SAMPLES_PER_BLOCK > ppaf24->sample_count) in paf24_read_block()
491 { memset (ppaf24->samples, 0, PAF24_SAMPLES_PER_BLOCK * ppaf24->channels) ; in paf24_read_block()
496 if ((k = (int) psf_fread (ppaf24->block, 1, ppaf24->blocksize, psf)) != ppaf24->blocksize) in paf24_read_block()
497 psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, ppaf24->blocksize) ; in paf24_read_block()
501 endswap_int_array (ppaf24->block, 8 * ppaf24->channels) ; in paf24_read_block()
504 for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) in paf24_read_block()
505 { channel = k % ppaf24->channels ; in paf24_read_block()
506 …cptr = ((unsigned char *) ppaf24->block) + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels)… in paf24_read_block()
507 ppaf24->samples [k] = (cptr [0] << 8) | (cptr [1] << 16) | (((unsigned) cptr [2]) << 24) ; in paf24_read_block()
514 paf24_read (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24, int *ptr, int len) in paf24_read() argument
518 { if (ppaf24->read_block * PAF24_SAMPLES_PER_BLOCK >= ppaf24->sample_count) in paf24_read()
523 if (ppaf24->read_count >= PAF24_SAMPLES_PER_BLOCK) in paf24_read()
524 paf24_read_block (psf, ppaf24) ; in paf24_read()
526 count = (PAF24_SAMPLES_PER_BLOCK - ppaf24->read_count) * ppaf24->channels ; in paf24_read()
529 …memcpy (&(ptr [total]), &(ppaf24->samples [ppaf24->read_count * ppaf24->channels]), count * sizeof… in paf24_read()
531 ppaf24->read_count += count / ppaf24->channels ; in paf24_read()
540 PAF24_PRIVATE *ppaf24 ; in paf24_read_s() local
547 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_read_s()
553 count = paf24_read (psf, ppaf24, iptr, readcount) ; in paf24_read_s()
564 { PAF24_PRIVATE *ppaf24 ; in paf24_read_i() local
569 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_read_i()
571 total = paf24_read (psf, ppaf24, ptr, len) ; in paf24_read_i()
579 PAF24_PRIVATE *ppaf24 ; in paf24_read_f() local
587 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_read_f()
595 count = paf24_read (psf, ppaf24, iptr, readcount) ; in paf24_read_f()
607 PAF24_PRIVATE *ppaf24 ; in paf24_read_d() local
615 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_read_d()
623 count = paf24_read (psf, ppaf24, iptr, readcount) ; in paf24_read_d()
636 paf24_write_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) in paf24_write_block() argument
643 { for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) in paf24_write_block()
644 { channel = k % ppaf24->channels ; in paf24_write_block()
645 …cptr = ((unsigned char *) ppaf24->block) + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels)… in paf24_write_block()
646 nextsample = ppaf24->samples [k] >> 8 ; in paf24_write_block()
654 endswap_int_array (ppaf24->block, 8 * ppaf24->channels) ; in paf24_write_block()
658 for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) in paf24_write_block()
659 { channel = k % ppaf24->channels ; in paf24_write_block()
660 …cptr = ((unsigned char *) ppaf24->block) + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels)… in paf24_write_block()
661 nextsample = ppaf24->samples [k] >> 8 ; in paf24_write_block()
667 endswap_int_array (ppaf24->block, 8 * ppaf24->channels) ; in paf24_write_block()
671 if ((k = (int) psf_fwrite (ppaf24->block, 1, ppaf24->blocksize, psf)) != ppaf24->blocksize) in paf24_write_block()
672 psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, ppaf24->blocksize) ; in paf24_write_block()
674 if (ppaf24->sample_count < ppaf24->write_block * PAF24_SAMPLES_PER_BLOCK + ppaf24->write_count) in paf24_write_block()
675 ppaf24->sample_count = ppaf24->write_block * PAF24_SAMPLES_PER_BLOCK + ppaf24->write_count ; in paf24_write_block()
677 if (ppaf24->write_count == PAF24_SAMPLES_PER_BLOCK) in paf24_write_block()
678 { ppaf24->write_block ++ ; in paf24_write_block()
679 ppaf24->write_count = 0 ; in paf24_write_block()
686 paf24_write (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24, const int *ptr, int len) in paf24_write() argument
690 { count = (PAF24_SAMPLES_PER_BLOCK - ppaf24->write_count) * ppaf24->channels ; in paf24_write()
695 …memcpy (&(ppaf24->samples [ppaf24->write_count * ppaf24->channels]), &(ptr [total]), count * sizeo… in paf24_write()
697 ppaf24->write_count += count / ppaf24->channels ; in paf24_write()
699 if (ppaf24->write_count >= PAF24_SAMPLES_PER_BLOCK) in paf24_write()
700 paf24_write_block (psf, ppaf24) ; in paf24_write()
709 PAF24_PRIVATE *ppaf24 ; in paf24_write_s() local
716 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_write_s()
724 count = paf24_write (psf, ppaf24, iptr, writecount) ; in paf24_write_s()
735 { PAF24_PRIVATE *ppaf24 ; in paf24_write_i() local
741 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_write_i()
746 count = paf24_write (psf, ppaf24, ptr, writecount) ; in paf24_write_i()
760 PAF24_PRIVATE *ppaf24 ; in paf24_write_f() local
768 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_write_f()
778 count = paf24_write (psf, ppaf24, iptr, writecount) ; in paf24_write_f()
791 PAF24_PRIVATE *ppaf24 ; in paf24_write_d() local
799 ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; in paf24_write_d()
809 count = paf24_write (psf, ppaf24, iptr, writecount) ; in paf24_write_d()