Lines Matching defs:adpcm
325 snd_pcm_adpcm_t *adpcm = pcm->private_data;
332 if (adpcm->sformat == SND_PCM_FORMAT_IMA_ADPCM) {
352 snd_pcm_adpcm_t *adpcm = pcm->private_data;
357 _snd_pcm_hw_params_set_format(sparams, adpcm->sformat);
410 snd_pcm_adpcm_t *adpcm = pcm->private_data;
425 if (adpcm->sformat == SND_PCM_FORMAT_IMA_ADPCM) {
426 adpcm->getput_idx = snd_pcm_linear_get_index(format, SND_PCM_FORMAT_S16);
427 adpcm->func = snd_pcm_adpcm_encode;
429 adpcm->getput_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, adpcm->sformat);
430 adpcm->func = snd_pcm_adpcm_decode;
433 if (adpcm->sformat == SND_PCM_FORMAT_IMA_ADPCM) {
434 adpcm->getput_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, format);
435 adpcm->func = snd_pcm_adpcm_decode;
437 adpcm->getput_idx = snd_pcm_linear_get_index(adpcm->sformat, SND_PCM_FORMAT_S16);
438 adpcm->func = snd_pcm_adpcm_encode;
441 assert(!adpcm->states);
442 adpcm->states = malloc(adpcm->plug.gen.slave->channels * sizeof(*adpcm->states));
443 if (adpcm->states == NULL)
450 snd_pcm_adpcm_t *adpcm = pcm->private_data;
451 free(adpcm->states);
452 adpcm->states = NULL;
453 return snd_pcm_hw_free(adpcm->plug.gen.slave);
458 snd_pcm_adpcm_t *adpcm = pcm->private_data;
461 adpcm->states[k].pred_val = 0;
462 adpcm->states[k].step_idx = 0;
476 snd_pcm_adpcm_t *adpcm = pcm->private_data;
479 adpcm->func(slave_areas, slave_offset,
482 adpcm->getput_idx, adpcm->states);
496 snd_pcm_adpcm_t *adpcm = pcm->private_data;
499 adpcm->func(areas, offset,
502 adpcm->getput_idx, adpcm->states);
509 snd_pcm_adpcm_t *adpcm = pcm->private_data;
511 snd_pcm_format_name(adpcm->sformat));
517 snd_pcm_dump(adpcm->plug.gen.slave, out);
553 snd_pcm_adpcm_t *adpcm;
559 adpcm = calloc(1, sizeof(snd_pcm_adpcm_t));
560 if (!adpcm) {
563 adpcm->sformat = sformat;
564 snd_pcm_plugin_init(&adpcm->plug);
565 adpcm->plug.read = snd_pcm_adpcm_read_areas;
566 adpcm->plug.write = snd_pcm_adpcm_write_areas;
567 adpcm->plug.init = snd_pcm_adpcm_init;
568 adpcm->plug.gen.slave = slave;
569 adpcm->plug.gen.close_slave = close_slave;
573 free(adpcm);
578 pcm->private_data = adpcm;
582 snd_pcm_set_hw_ptr(pcm, &adpcm->plug.hw_ptr, -1, 0);
583 snd_pcm_set_appl_ptr(pcm, &adpcm->plug.appl_ptr, -1, 0);
599 type adpcm # Ima-ADPCM conversion PCM