Lines Matching refs:ptr

39 static unsigned little2u(unsigned char *ptr)  in little2u()  argument
41 return (ptr[1] << 8) + ptr[0]; in little2u()
44 static unsigned little4u(unsigned char *ptr) in little4u() argument
46 return (ptr[3] << 24) + (ptr[2] << 16) + (ptr[1] << 8) + ptr[0]; in little4u()
56 static void my_swab(short *ptr, size_t numToSwap) in my_swab() argument
59 *ptr = little2u((unsigned char *) ptr); in my_swab()
61 ++ptr; in my_swab()
289 static void write4u(unsigned char *ptr, unsigned u) in write4u() argument
291 ptr[0] = u; in write4u()
292 ptr[1] = u >> 8; in write4u()
293 ptr[2] = u >> 16; in write4u()
294 ptr[3] = u >> 24; in write4u()
419 sf_count_t sf_readf_short(SNDFILE *handle, short *ptr, sf_count_t desiredFrames) in sf_readf_short() argument
421 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_short()
437 actualBytes = fread(ptr, sizeof(char), desiredBytes, handle->stream); in sf_readf_short()
443 memcpy_to_i16_from_u8(ptr, (unsigned char *) ptr, actualFrames * handle->info.channels); in sf_readf_short()
447 my_swab(ptr, actualFrames * handle->info.channels); in sf_readf_short()
450 memcpy_to_i16_from_i32(ptr, (const int *) temp, actualFrames * handle->info.channels); in sf_readf_short()
454 memcpy_to_i16_from_float(ptr, (const float *) temp, actualFrames * handle->info.channels); in sf_readf_short()
458 memcpy_to_i16_from_p24(ptr, (const uint8_t *) temp, actualFrames * handle->info.channels); in sf_readf_short()
462 memset(ptr, 0, actualFrames * handle->info.channels * sizeof(short)); in sf_readf_short()
468 sf_count_t sf_readf_float(SNDFILE *handle, float *ptr, sf_count_t desiredFrames) in sf_readf_float() argument
470 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_float()
486 actualBytes = fread(ptr, sizeof(char), desiredBytes, handle->stream); in sf_readf_float()
492 memcpy_to_float_from_u8(ptr, (const unsigned char *) temp, in sf_readf_float()
497 memcpy_to_float_from_i16(ptr, (const short *) temp, actualFrames * handle->info.channels); in sf_readf_float()
501 memcpy_to_float_from_i32(ptr, (const int *) ptr, actualFrames * handle->info.channels); in sf_readf_float()
506 memcpy_to_float_from_p24(ptr, (const uint8_t *) temp, actualFrames * handle->info.channels); in sf_readf_float()
510 memset(ptr, 0, actualFrames * handle->info.channels * sizeof(float)); in sf_readf_float()
516 sf_count_t sf_readf_int(SNDFILE *handle, int *ptr, sf_count_t desiredFrames) in sf_readf_int() argument
518 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_int()
534 actualBytes = fread(ptr, sizeof(char), desiredBytes, handle->stream); in sf_readf_int()
540 memcpy_to_i32_from_u8(ptr, (const unsigned char *) temp, in sf_readf_int()
545 memcpy_to_i32_from_i16(ptr, (const short *) temp, actualFrames * handle->info.channels); in sf_readf_int()
551 memcpy_to_i32_from_float(ptr, (const float *) ptr, actualFrames * handle->info.channels); in sf_readf_int()
554 memcpy_to_i32_from_p24(ptr, (const uint8_t *) temp, actualFrames * handle->info.channels); in sf_readf_int()
558 memset(ptr, 0, actualFrames * handle->info.channels * sizeof(int)); in sf_readf_int()
564 sf_count_t sf_writef_short(SNDFILE *handle, const short *ptr, sf_count_t desiredFrames) in sf_writef_short() argument
566 if (handle == NULL || handle->mode != SFM_WRITE || ptr == NULL || desiredFrames <= 0) in sf_writef_short()
573 memcpy_to_u8_from_i16(handle->temp, ptr, desiredBytes); in sf_writef_short()
579 actualBytes = fwrite(ptr, sizeof(char), desiredBytes, handle->stream); in sf_writef_short()
582 memcpy(handle->temp, ptr, desiredBytes); in sf_writef_short()
589 memcpy_to_float_from_i16((float *) handle->temp, ptr, in sf_writef_short()
601 sf_count_t sf_writef_float(SNDFILE *handle, const float *ptr, sf_count_t desiredFrames) in sf_writef_float() argument
603 if (handle == NULL || handle->mode != SFM_WRITE || ptr == NULL || desiredFrames <= 0) in sf_writef_float()
609 actualBytes = fwrite(ptr, sizeof(char), desiredBytes, handle->stream); in sf_writef_float()
613 memcpy_to_i16_from_float((short *) handle->temp, ptr, in sf_writef_float()
626 sf_count_t sf_writef_int(SNDFILE *handle, const int *ptr, sf_count_t desiredFrames) in sf_writef_int() argument
628 if (handle == NULL || handle->mode != SFM_WRITE || ptr == NULL || desiredFrames <= 0) in sf_writef_int()
634 actualBytes = fwrite(ptr, sizeof(char), desiredBytes, handle->stream); in sf_writef_int()