示例#1
0
void af_resample_set_SampsNumRatio(af_resampe_ctl_t *paf_resampe_ctl)
{  
    int resample_type=af_get_resample_type();
	int default_DELTA_NUMSAMPS=RESAMPLE_DELTA_NUMSAMPS;
	if (am_getconfig_bool("media.libplayer.wfd"))
	{
       default_DELTA_NUMSAMPS=2;
	}
	audiodsp_set_pcm_resample_delta(default_DELTA_NUMSAMPS);
	paf_resampe_ctl->LastResamType=resample_type;
	adec_print("ReSample Coef Init: type/%d DELTA_NUMSAMPS/%d ",resample_type,default_DELTA_NUMSAMPS);
    //memset(paf_resampe_ctl,0,sizeof(af_resampe_ctl_t));
    if(resample_type==RESAMPLE_TYPE_NONE){
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH;
    }
    else if(resample_type==RESAMPLE_TYPE_DOWN)
    {
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH + default_DELTA_NUMSAMPS;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH ;
    }
    else if(resample_type==RESAMPLE_TYPE_UP)
    {
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH - default_DELTA_NUMSAMPS;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH;
    }
    af_resample_linear_coef_get(paf_resampe_ctl);
    paf_resampe_ctl->ResevedSampsValid=0;
    paf_resampe_ctl->OutSampReserveLen=0;
    paf_resampe_ctl->InitFlag=1;

}
示例#2
0
void af_resample_set_SampsNumRatio(af_resampe_ctl_t *paf_resampe_ctl)
{  
    int resample_type=af_get_resample_type();
    adec_print("resample_type=%d\n",resample_type);
    memset(paf_resampe_ctl,0,sizeof(af_resampe_ctl_t));
    if(resample_type==RESAMPLE_TYPE_NONE){
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH;
    }
    else if(resample_type==RESAMPLE_TYPE_DOWN)
    {
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH + RESAMPLE_DELTA_NUMSAMPS;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH ;
    }
    else if(resample_type==RESAMPLE_TYPE_UP)
    {
         paf_resampe_ctl->SampNumIn=DEFALT_NUMSAMPS_PERCH - RESAMPLE_DELTA_NUMSAMPS;
         paf_resampe_ctl->SampNumOut=DEFALT_NUMSAMPS_PERCH;
    }
    af_resample_linear_coef_get(paf_resampe_ctl);
    paf_resampe_ctl->ResevedSampsValid=0;
    paf_resampe_ctl->OutSampReserveLen=0;
    paf_resampe_ctl->InitFlag=1;

}