Lines Matching refs:ssrmod

79 static struct ssr_module ssrmod = {  variable
163 ssrmod.real_coeffs[i] = (Word16 *)calloc(FILT_SIZE, sizeof(Word16)); in ssr_read_coeffs_from_file()
166 ssrmod.imag_coeffs[i] = (Word16 *)calloc(FILT_SIZE, sizeof(Word16)); in ssr_read_coeffs_from_file()
170 if (NULL != ssrmod.real_coeffs[0]) { in ssr_read_coeffs_from_file()
171 fread(ssrmod.real_coeffs[0], sizeof(int16), FILT_SIZE, flt1r); in ssr_read_coeffs_from_file()
173 if (NULL != ssrmod.real_coeffs[0]) { in ssr_read_coeffs_from_file()
174 fread(ssrmod.real_coeffs[1], sizeof(int16), FILT_SIZE, flt2r); in ssr_read_coeffs_from_file()
176 if (NULL != ssrmod.real_coeffs[0]) { in ssr_read_coeffs_from_file()
177 fread(ssrmod.real_coeffs[2], sizeof(int16), FILT_SIZE, flt3r); in ssr_read_coeffs_from_file()
179 if (NULL != ssrmod.real_coeffs[0]) { in ssr_read_coeffs_from_file()
180 fread(ssrmod.real_coeffs[3], sizeof(int16), FILT_SIZE, flt4r); in ssr_read_coeffs_from_file()
184 if (NULL != ssrmod.imag_coeffs[0]) { in ssr_read_coeffs_from_file()
185 fread(ssrmod.imag_coeffs[0], sizeof(int16), FILT_SIZE, flt1i); in ssr_read_coeffs_from_file()
187 if (NULL != ssrmod.imag_coeffs[0]) { in ssr_read_coeffs_from_file()
188 fread(ssrmod.imag_coeffs[1], sizeof(int16), FILT_SIZE, flt2i); in ssr_read_coeffs_from_file()
190 if (NULL != ssrmod.imag_coeffs[0]) { in ssr_read_coeffs_from_file()
191 fread(ssrmod.imag_coeffs[2], sizeof(int16), FILT_SIZE, flt3i); in ssr_read_coeffs_from_file()
193 if (NULL != ssrmod.imag_coeffs[0]) { in ssr_read_coeffs_from_file()
194 fread(ssrmod.imag_coeffs[3], sizeof(int16), FILT_SIZE, flt4i); in ssr_read_coeffs_from_file()
222 if ( ssrmod.surround_obj ) { in ssr_init_surround_sound_lib()
228 ssrmod.surround_raw_buffer = (Word16 *) calloc(buffersize, in ssr_init_surround_sound_lib()
230 if ( !ssrmod.surround_raw_buffer ) { in ssr_init_surround_sound_lib()
237 ssrmod.real_coeffs = (Word16 **) calloc(COEFF_ARRAY_SIZE, sizeof(Word16 *)); in ssr_init_surround_sound_lib()
238 if ( !ssrmod.real_coeffs ) { in ssr_init_surround_sound_lib()
244 ssrmod.imag_coeffs = (Word16 **) calloc(COEFF_ARRAY_SIZE, sizeof(Word16 *)); in ssr_init_surround_sound_lib()
245 if ( !ssrmod.imag_coeffs ) { in ssr_init_surround_sound_lib()
256 ssrmod.surround_filters_handle = dlopen(LIB_SURROUND_PROC, RTLD_NOW); in ssr_init_surround_sound_lib()
257 if (ssrmod.surround_filters_handle == NULL) { in ssr_init_surround_sound_lib()
261 ssrmod.surround_filters_init = (surround_filters_init_t) in ssr_init_surround_sound_lib()
262 dlsym(ssrmod.surround_filters_handle, "surround_filters_init"); in ssr_init_surround_sound_lib()
264 ssrmod.surround_filters_release = (surround_filters_release_t) in ssr_init_surround_sound_lib()
265 dlsym(ssrmod.surround_filters_handle, "surround_filters_release"); in ssr_init_surround_sound_lib()
267 ssrmod.surround_filters_set_channel_map = (surround_filters_set_channel_map_t) in ssr_init_surround_sound_lib()
268 dlsym(ssrmod.surround_filters_handle, "surround_filters_set_channel_map"); in ssr_init_surround_sound_lib()
270 ssrmod.surround_filters_intl_process = (surround_filters_intl_process_t) in ssr_init_surround_sound_lib()
271 dlsym(ssrmod.surround_filters_handle, "surround_filters_intl_process"); in ssr_init_surround_sound_lib()
273 if (!ssrmod.surround_filters_init || in ssr_init_surround_sound_lib()
274 !ssrmod.surround_filters_release || in ssr_init_surround_sound_lib()
275 !ssrmod.surround_filters_set_channel_map || in ssr_init_surround_sound_lib()
276 !ssrmod.surround_filters_intl_process){ in ssr_init_surround_sound_lib()
284 ret = ssrmod.surround_filters_init(NULL, in ssr_init_surround_sound_lib()
287 ssrmod.real_coeffs, // Coeffs hardcoded in header in ssr_init_surround_sound_lib()
288 ssrmod.imag_coeffs, // Coeffs hardcoded in header in ssr_init_surround_sound_lib()
296 ssrmod.surround_obj = (void *)malloc(ret); in ssr_init_surround_sound_lib()
297 if (NULL != ssrmod.surround_obj) { in ssr_init_surround_sound_lib()
298 memset(ssrmod.surround_obj,0,ret); in ssr_init_surround_sound_lib()
300 ret = ssrmod.surround_filters_init(ssrmod.surround_obj, in ssr_init_surround_sound_lib()
303 ssrmod.real_coeffs, in ssr_init_surround_sound_lib()
304 ssrmod.imag_coeffs, in ssr_init_surround_sound_lib()
311 ssrmod.surround_filters_release(ssrmod.surround_obj); in ssr_init_surround_sound_lib()
324 (void) ssrmod.surround_filters_set_channel_map(ssrmod.surround_obj, chan_map); in ssr_init_surround_sound_lib()
329 if (ssrmod.surround_obj) { in ssr_init_surround_sound_lib()
330 free(ssrmod.surround_obj); in ssr_init_surround_sound_lib()
331 ssrmod.surround_obj = NULL; in ssr_init_surround_sound_lib()
333 if (ssrmod.surround_raw_buffer) { in ssr_init_surround_sound_lib()
334 free(ssrmod.surround_raw_buffer); in ssr_init_surround_sound_lib()
335 ssrmod.surround_raw_buffer = NULL; in ssr_init_surround_sound_lib()
337 if (ssrmod.real_coeffs){ in ssr_init_surround_sound_lib()
339 if (ssrmod.real_coeffs[i]) { in ssr_init_surround_sound_lib()
340 free(ssrmod.real_coeffs[i]); in ssr_init_surround_sound_lib()
341 ssrmod.real_coeffs[i] = NULL; in ssr_init_surround_sound_lib()
344 free(ssrmod.real_coeffs); in ssr_init_surround_sound_lib()
345 ssrmod.real_coeffs = NULL; in ssr_init_surround_sound_lib()
347 if (ssrmod.imag_coeffs){ in ssr_init_surround_sound_lib()
349 if (ssrmod.imag_coeffs[i]) { in ssr_init_surround_sound_lib()
350 free(ssrmod.imag_coeffs[i]); in ssr_init_surround_sound_lib()
351 ssrmod.imag_coeffs[i] = NULL; in ssr_init_surround_sound_lib()
354 free(ssrmod.imag_coeffs); in ssr_init_surround_sound_lib()
355 ssrmod.imag_coeffs = NULL; in ssr_init_surround_sound_lib()
368 ssrmod.is_ssr_enabled = true; in audio_extn_ssr_update_enabled()
371 ssrmod.is_ssr_enabled = false; in audio_extn_ssr_update_enabled()
377 ALOGV("%s: is_ssr_enabled:%d", __func__, ssrmod.is_ssr_enabled); in audio_extn_ssr_get_enabled()
378 return (ssrmod.is_ssr_enabled ? true: false); in audio_extn_ssr_get_enabled()
407 if ( !ssrmod.fp_4ch) in audio_extn_ssr_init()
408 ssrmod.fp_4ch = fopen("/data/4ch.pcm", "wb"); in audio_extn_ssr_init()
409 if ( !ssrmod.fp_6ch) in audio_extn_ssr_init()
410 ssrmod.fp_6ch = fopen("/data/6ch.pcm", "wb"); in audio_extn_ssr_init()
411 if ((!ssrmod.fp_4ch) || (!ssrmod.fp_6ch)) in audio_extn_ssr_init()
413 __func__, ssrmod.fp_4ch, ssrmod.fp_6ch); in audio_extn_ssr_init()
423 if (ssrmod.surround_obj) { in audio_extn_ssr_deinit()
425 ssrmod.surround_filters_release(ssrmod.surround_obj); in audio_extn_ssr_deinit()
426 if (ssrmod.surround_obj) in audio_extn_ssr_deinit()
427 free(ssrmod.surround_obj); in audio_extn_ssr_deinit()
428 ssrmod.surround_obj = NULL; in audio_extn_ssr_deinit()
429 if (ssrmod.real_coeffs){ in audio_extn_ssr_deinit()
431 if (ssrmod.real_coeffs[i]) { in audio_extn_ssr_deinit()
432 free(ssrmod.real_coeffs[i]); in audio_extn_ssr_deinit()
433 ssrmod.real_coeffs[i] = NULL; in audio_extn_ssr_deinit()
436 free(ssrmod.real_coeffs); in audio_extn_ssr_deinit()
437 ssrmod.real_coeffs = NULL; in audio_extn_ssr_deinit()
439 if (ssrmod.imag_coeffs){ in audio_extn_ssr_deinit()
441 if (ssrmod.imag_coeffs[i]) { in audio_extn_ssr_deinit()
442 free(ssrmod.imag_coeffs[i]); in audio_extn_ssr_deinit()
443 ssrmod.imag_coeffs[i] = NULL; in audio_extn_ssr_deinit()
446 free(ssrmod.imag_coeffs); in audio_extn_ssr_deinit()
447 ssrmod.imag_coeffs = NULL; in audio_extn_ssr_deinit()
449 if (ssrmod.surround_raw_buffer) { in audio_extn_ssr_deinit()
450 free(ssrmod.surround_raw_buffer); in audio_extn_ssr_deinit()
451 ssrmod.surround_raw_buffer = NULL; in audio_extn_ssr_deinit()
453 if (ssrmod.fp_4ch) in audio_extn_ssr_deinit()
454 fclose(ssrmod.fp_4ch); in audio_extn_ssr_deinit()
455 if (ssrmod.fp_6ch) in audio_extn_ssr_deinit()
456 fclose(ssrmod.fp_6ch); in audio_extn_ssr_deinit()
459 if(ssrmod.surround_filters_handle) { in audio_extn_ssr_deinit()
460 dlclose(ssrmod.surround_filters_handle); in audio_extn_ssr_deinit()
461 ssrmod.surround_filters_handle = NULL; in audio_extn_ssr_deinit()
479 if (!ssrmod.surround_obj) { in audio_extn_ssr_read()
484 ret = pcm_read(in->pcm, ssrmod.surround_raw_buffer, peroid_bytes); in audio_extn_ssr_read()
491 ssrmod.surround_filters_intl_process(ssrmod.surround_obj, in audio_extn_ssr_read()
492 buffer, ssrmod.surround_raw_buffer); in audio_extn_ssr_read()
495 if (ssrmod.fp_4ch) in audio_extn_ssr_read()
496 fwrite(ssrmod.surround_raw_buffer, 1, peroid_bytes, ssrmod.fp_4ch); in audio_extn_ssr_read()
497 if (ssrmod.fp_6ch) in audio_extn_ssr_read()
498 fwrite(buffer, 1, bytes, ssrmod.fp_6ch); in audio_extn_ssr_read()