Lines Matching refs:channels
67 int channels; member
150 int opus_encoder_get_size(int channels) in opus_encoder_get_size() argument
154 if (channels<1 || channels > 2) in opus_encoder_get_size()
160 celtEncSizeBytes = celt_encoder_get_size(channels); in opus_encoder_get_size()
164 int opus_encoder_init(OpusEncoder* st, opus_int32 Fs, int channels, int application) in opus_encoder_init() argument
171 if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2)|| in opus_encoder_init()
176 OPUS_CLEAR((char*)st, opus_encoder_get_size(channels)); in opus_encoder_init()
187 st->stream_channels = st->channels = channels; in opus_encoder_init()
197 st->silk_mode.nChannelsAPI = channels; in opus_encoder_init()
198 st->silk_mode.nChannelsInternal = channels; in opus_encoder_init()
214 err = celt_encoder_init(celt_enc, Fs, channels, st->arch); in opus_encoder_init()
224 st->bitrate_bps = 3000+Fs*channels; in opus_encoder_init()
254 static unsigned char gen_toc(int mode, int framerate, int bandwidth, int channels) in gen_toc() argument
282 toc |= (channels==2)<<2; in gen_toc()
326 …n, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs) in hp_cutoff() argument
349 silk_biquad_alt( in, B_Q28, A_Q28, hp_mem, out, len, channels ); in hp_cutoff()
350 if( channels == 2 ) { in hp_cutoff()
351 silk_biquad_alt( in+1, B_Q28, A_Q28, hp_mem+2, out+1, len, channels ); in hp_cutoff()
354 silk_biquad_float( in, B_Q28, A_Q28, hp_mem, out, len, channels ); in hp_cutoff()
355 if( channels == 2 ) { in hp_cutoff()
356 silk_biquad_float( in+1, B_Q28, A_Q28, hp_mem+2, out+1, len, channels ); in hp_cutoff()
362 …n, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs) in dc_reject() argument
369 for (c=0;c<channels;c++) in dc_reject()
374 x = SHL32(EXTEND32(in[channels*i+c]), 15); in dc_reject()
381 out[channels*i+c] = EXTRACT16(SATURATE(PSHR32(y, 15), 32767)); in dc_reject()
387 …n, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs) in dc_reject() argument
393 for (c=0;c<channels;c++) in dc_reject()
398 x = in[channels*i+c]; in dc_reject()
405 out[channels*i+c] = y; in dc_reject()
412 int overlap48, int frame_size, int channels, const opus_val16 *window, opus_int32 Fs) in stereo_fade() argument
428 diff = EXTRACT16(HALF32((opus_val32)in[i*channels] - (opus_val32)in[i*channels+1])); in stereo_fade()
430 out[i*channels] = out[i*channels] - diff; in stereo_fade()
431 out[i*channels+1] = out[i*channels+1] + diff; in stereo_fade()
436 diff = EXTRACT16(HALF32((opus_val32)in[i*channels] - (opus_val32)in[i*channels+1])); in stereo_fade()
438 out[i*channels] = out[i*channels] - diff; in stereo_fade()
439 out[i*channels+1] = out[i*channels+1] + diff; in stereo_fade()
444 int overlap48, int frame_size, int channels, const opus_val16 *window, opus_int32 Fs) in gain_fade() argument
452 if (channels==1) in gain_fade()
476 out[i*channels+c] = MULT16_16_Q15(g2, in[i*channels+c]); in gain_fade()
479 while (++c<channels); in gain_fade()
482 OpusEncoder *opus_encoder_create(opus_int32 Fs, int channels, int application, int *error) in opus_encoder_create() argument
486 if((Fs!=48000&&Fs!=24000&&Fs!=16000&&Fs!=12000&&Fs!=8000)||(channels!=1&&channels!=2)|| in opus_encoder_create()
494 st = (OpusEncoder *)opus_alloc(opus_encoder_get_size(channels)); in opus_encoder_create()
501 ret = opus_encoder_init(st, Fs, channels, application); in opus_encoder_create()
516 return 60*st->Fs/frame_size + st->Fs*st->channels; in user_bitrate_to_bitrate()
1044 if (st->channels==2 && st->force_channels!=1) in opus_encode_native()
1094 equiv_rate = st->bitrate_bps - (40*st->channels+20)*(st->Fs/frame_size - 50); in opus_encode_native()
1111 if (st->force_channels!=OPUS_AUTO && st->channels == 2) in opus_encode_native()
1117 if (st->channels == 2 && (rand()&0x1F)==0) in opus_encode_native()
1121 if (st->channels == 2) in opus_encode_native()
1131 st->stream_channels = st->channels; in opus_encode_native()
1271 if (st->channels==2 && st->force_channels!=1) in opus_encode_native()
1406 tmp_len = opus_encode_native(st, pcm+i*(st->channels*st->Fs/50), st->Fs/50, in opus_encode_native()
1454 ALLOC(pcm_buf, (total_buffer+frame_size)*st->channels, opus_val16); in opus_encode_native()
1455 …buf, &st->delay_buffer[(st->encoder_buffer-total_buffer)*st->channels], total_buffer*st->channels); in opus_encode_native()
1470 …hp_cutoff(pcm, cutoff_Hz, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channel… in opus_encode_native()
1472 …dc_reject(pcm, 3, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channels, st->F… in opus_encode_native()
1478 …elt_inner_prod(&pcm_buf[total_buffer*st->channels], &pcm_buf[total_buffer*st->channels], frame_siz… in opus_encode_native()
1483 OPUS_CLEAR(&pcm_buf[total_buffer*st->channels], frame_size*st->channels); in opus_encode_native()
1499 ALLOC(pcm_silk, st->channels*frame_size, opus_int16); in opus_encode_native()
1550 for (c=0;c<st->channels;c++) in opus_encode_native()
1563 masking_depth = mask_sum / end*st->channels; in opus_encode_native()
1576 st->silk_mode.nChannelsAPI = st->channels; in opus_encode_native()
1639 prefill_offset = st->channels*(st->encoder_buffer-st->delay_compensation-st->Fs/400); in opus_encode_native()
1641 … 0, Q15ONE, celt_mode->overlap, st->Fs/400, st->channels, celt_mode->window, st->Fs); in opus_encode_native()
1646 for (i=0;i<st->encoder_buffer*st->channels;i++) in opus_encode_native()
1653 pcm_silk = pcm_buf+total_buffer*st->channels; in opus_encode_native()
1655 for (i=0;i<frame_size*st->channels;i++) in opus_encode_native()
1656 pcm_silk[i] = FLOAT2INT16(pcm_buf[total_buffer*st->channels + i]); in opus_encode_native()
1766 ALLOC(tmp_prefill, st->channels*st->Fs/400, opus_val16); in opus_encode_native()
1769 …t->delay_buffer[(st->encoder_buffer-total_buffer-st->Fs/400)*st->channels], st->channels*st->Fs/40… in opus_encode_native()
1772 if (st->channels*(st->encoder_buffer-(frame_size+total_buffer)) > 0) in opus_encode_native()
1774 …OPUS_MOVE(st->delay_buffer, &st->delay_buffer[st->channels*frame_size], st->channels*(st->encoder_… in opus_encode_native()
1775 OPUS_COPY(&st->delay_buffer[st->channels*(st->encoder_buffer-frame_size-total_buffer)], in opus_encode_native()
1777 (frame_size+total_buffer)*st->channels); in opus_encode_native()
1779 …m_buf[(frame_size+total_buffer-st->encoder_buffer)*st->channels], st->encoder_buffer*st->channels); in opus_encode_native()
1785 …st->prev_HB_gain, HB_gain, celt_mode->overlap, frame_size, st->channels, celt_mode->window, st->Fs… in opus_encode_native()
1790 if( !st->energy_masking && st->channels == 2 ) { in opus_encode_native()
1804 frame_size, st->channels, celt_mode->window, st->Fs); in opus_encode_native()
1910 celt_encode_with_ec(celt_enc, pcm_buf+st->channels*(frame_size-N2-N4), N4, dummy, 2, NULL); in opus_encode_native()
1912 …err = celt_encode_with_ec(celt_enc, pcm_buf+st->channels*(frame_size-N2), N2, data+nb_compr_bytes,… in opus_encode_native()
1993 st->variable_duration, st->channels, st->Fs, st->bitrate_bps, in opus_encode_float()
1996 ALLOC(in, frame_size*st->channels, opus_int16); in opus_encode_float()
1998 for (i=0;i<frame_size*st->channels;i++) in opus_encode_float()
2001 pcm, analysis_frame_size, 0, -2, st->channels, downmix_float, 1); in opus_encode_float()
2017 st->variable_duration, st->channels, st->Fs, st->bitrate_bps, in opus_encode()
2024 pcm, analysis_frame_size, 0, -2, st->channels, downmix_int, 0); in opus_encode()
2042 st->variable_duration, st->channels, st->Fs, st->bitrate_bps, in opus_encode()
2045 ALLOC(in, frame_size*st->channels, float); in opus_encode()
2047 for (i=0;i<frame_size*st->channels;i++) in opus_encode()
2050 pcm, analysis_frame_size, 0, -2, st->channels, downmix_int, 0); in opus_encode()
2064 st->variable_duration, st->channels, st->Fs, st->bitrate_bps, in opus_encode_float()
2067 pcm, analysis_frame_size, 0, -2, st->channels, downmix_float, 1); in opus_encode_float()
2117 else if (value > (opus_int32)300000*st->channels) in opus_encoder_ctl()
2118 value = (opus_int32)300000*st->channels; in opus_encoder_ctl()
2136 if((value<1 || value>st->channels) && value != OPUS_AUTO) in opus_encoder_ctl()
2477 st->stream_channels = st->channels; in opus_encoder_ctl()