本文整理汇总了C++中IN0函数的典型用法代码示例。如果您正苦于以下问题:C++ IN0函数的具体用法?C++ IN0怎么用?C++ IN0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IN0函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextVU_Ctor
void TextVU_Ctor(TextVU* unit)
{
SETCALC(TextVU_next_kk);
unit->m_trig = IN0(0);
unit->m_id = IN0(4); // number of chars in the id string
unit->m_id_string = (char*)RTAlloc(unit->mWorld, ((int)unit->m_id + 1) * sizeof(char));
Print("TextVU: string length %g\n", unit->m_id);
for(int i = 0; i < (int)unit->m_id; i++){
unit->m_id_string[i] = (char)IN0(5+i);
};
unit->m_id_string[(int)unit->m_id] = '\0';
size_t width = (size_t)std::max(IN0(2), 2.f);
unit->m_width = width;
// Now we want to initialise the set of cutoffs, where the first is -60dB and last is 0dB.
unit->m_cutoffs = (float*)RTAlloc(unit->mWorld, width * sizeof(float));
unit->m_vustring = (char*)RTAlloc(unit->mWorld, (width+1) * sizeof(char));
unit->m_vustring[width] = 0;
float cutstep = 60.f / (float)(width-1);
float db = -60.f;
for(size_t i=0; i<width; ++i){
// calc cutoffs in amplitude from the db vals
unit->m_cutoffs[i] = sc_dbamp(db);
//Print("cutoff %i: %g\n", i, unit->m_cutoffs[i]);
db += cutstep;
}
unit->m_maxinepoch = 0.f;
unit->m_maxever = 0;
unit->m_mayprint = unit->mWorld->mVerbosity >= 0;
TextVU_next_kk(unit, 1);
}
示例2: FeatureSave_next
void FeatureSave_next(FeatureSave *unit, int inNumSamples) {
float trig = IN0(1); //trigger input
//if trigger and file open
//printf("%f %d %d %d \n",trig, unit->fileready_, unit->numfeatures_, trig>(-0.01f));
//printf("FeatureSave:next sanity check: unit pointer %p \n",unit->mUnitDef);
if((trig>(-0.01f)) && (unit->fileready_==1)) {
//printf("%f %d \n",trig, unit->fileready_);
//write to file
for (int i=0; i<unit->numfeatures_; ++i) {
float featureval = IN0(i+2);
//printf("%d %f trig %f \n",i, featureval, trig);
//printf("featureval %f %d \n",featureval, unit->fileready_);
fwrite(&featureval, sizeof(float),1, unit->fp);
}
++unit->frameswritten_;
}
}
示例3: MatchingP_Ctor
void MatchingP_Ctor(MatchingP* unit)
{
SETCALC(MatchingP_next);
// [trigger, residual, activ0, activ1,...] = MatchingP.ar(dict, in, dictsize, ntofind, hop=1, method=0)
CTOR_GET_BUF
// initialize the unit generator state variables.
unit->m_dictsize = IN0(2);
if(unit->m_dictsize != buf->channels){
printf("ERROR: (unit->m_dictsize != bufChannels)\n");
SETCALC(ClearUnitOutputs);
return;
}
unit->m_hopspls = static_cast<int>(sc_max(0.f, sc_min(1.f, IN0(4))) * buf->frames);
unit->m_shuntspls = buf->frames - unit->m_hopspls;
const int ntofind = (const int)IN0(3);
// UNUSED: unit->mMethod = IN0(5);
unit->m_audiowritepos = unit->m_hopspls;
unit->m_audioplaybackpos = 0;
// audiobuf size is bufFrames + hopspls -- playback happens in first bufFrames, input is written in last hopspls, analysis is in last bufFrames
unit->m_audiobuf = (float* )RTAlloc(unit->mWorld, sizeof(float) * (buf->frames + unit->m_hopspls));
Clear(buf->frames + unit->m_hopspls, unit->m_audiobuf);
// "activations" will contain [index0, activ0, index1, activ1, ... ]
unit->m_activations = (float* )RTAlloc(unit->mWorld, sizeof(float) * 2 * ntofind);
// calculate one sample of output.
unit->m_fbufnum = -9.9e9; // set it to something that will force the buffer info to be updated when _next runs
MatchingP_next(unit, 1);
}
示例4: Dpoll_Ctor
void Dpoll_Ctor(Dpoll *unit)
{
SETCALC(Dpoll_next);
unit->m_id = IN0(3); // number of chars in the id string
unit->m_id_string = (char*)RTAlloc(unit->mWorld, ((int)unit->m_id + 1) * sizeof(char));
for(int i = 0; i < (int)unit->m_id; i++) {
unit->m_id_string[i] = (char)IN0(4+i);
}
unit->m_id_string[(int)unit->m_id] = '\0';
unit->m_mayprint = unit->mWorld->mVerbosity >= 0;
OUT0(0) = 0.f;
}
示例5: DbufTag_Ctor
void DbufTag_Ctor(DbufTag *unit)
{
SETCALC(DbufTag_next);
unit->m_fbufnum = -1e9f;
unit->m_axiom_size = (int) IN0(dtag_axiom_size);
unit->m_numRules = (int) IN0(dtag_num_rules);
DbufTag_initInputs(unit, dtag_argoffset + unit->m_axiom_size, unit->m_numRules);
DbufTag_reset(unit, 0, 1);
OUT0(0) = 0.f;
}
示例6: Dtag_Ctor
void Dtag_Ctor(Dtag *unit)
{
SETCALC(Dtag_next);
unit->m_axiom_size = (int) IN0(dtag_axiom_size);
unit->m_numRules = (int) IN0(dtag_num_rules);
// initialise and reset
Dtag_initInputs(unit, dtag_argoffset + unit->m_axiom_size, unit->m_numRules);
Dtag_reset(unit, 0, 1);
OUT0(0) = 0.f;
}
示例7: Dpoll_next
void Dpoll_next(Dpoll *unit, int inNumSamples)
{
if (inNumSamples) {
float x = DEMANDINPUT_A(0, inNumSamples);
float run = DEMANDINPUT_A(2, inNumSamples) > 0.f;
if(unit->m_mayprint && run) {
Print("%s: %g block offset: %d\n", unit->m_id_string, x, inNumSamples - 1);
}
if(IN0(1) >= 0.0) SendTrigger(&unit->mParent->mNode, (int)IN0(1), x);
OUT0(0) = x;
} else {
RESETINPUT(0);
}
}
示例8: Membrane_next_a
void Membrane_next_a(Membrane *unit, int inNumSamples) {
// get the pointer to the output buffer
float *out = OUT(0);
int input_n = 0;
// get the control rate input
#ifdef AUDIO_INPUT
float *in = IN(input_n++);
#else
float trigger = IN0(input_n++);
#endif
float tension = IN0(input_n++);
float loss = IN0(input_n++);
if (tension == 0) {
// default tension
tension = 0.0001;
}
unit->yj = 2.f * DELTA * DELTA / (tension * tension * GAMMA * GAMMA);
float yj_r = 1.0f / unit->yj;
if (loss >= 1) {
loss = 0.99999;
}
unit->loss = loss;
#ifndef AUDIO_INPUT
if (trigger >= 0.5 && (! unit->triggered)) {
unit->triggered = 1;
unit->excite = TRIGGER_DURATION;
}
else if (trigger < 0.5 && unit->triggered) {
unit->triggered = 0;
}
#endif
for (int k=0; k < inNumSamples; ++k) {
float input = 0.0;
#ifdef AUDIO_INPUT
input = in[k];
#else
if (unit->excite > 0) {
input = (0.01 - (((float) rand() / RAND_MAX) * 0.02));
unit->excite--;
}
#endif
out[k] = cycle(unit, input, yj_r);
}
}
示例9: IN0
OMX_ERRORTYPE IFM_NmfProcessingComp::doBufferDeAllocation(OMX_U32 nPortIndex,OMX_U32 nBufferIndex, void * pBufferMetaData){
IN0("\n");
OMX_ERRORTYPE error = OMX_ErrorNone;
OMX_PARAM_PORTDEFINITIONTYPE portdef;
OMX_VERSIONTYPE version = {{0, 0, 0, 0}};
getOmxIlSpecVersion(&version);
portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portdef.nVersion = version;
ENS_Port * port = mENSComponent.getPort(nPortIndex);
port->getParameter(OMX_IndexParamPortDefinition, &portdef);
if ((portdef.eDomain == OMX_PortDomainVideo)&&(nBufferIndex == 0)) {
ENS_Port *port = mENSComponent.getPort(nPortIndex);
MMHwBuffer *sharedChunk = port->getSharedChunk();
error = MMHwBuffer::Destroy(sharedChunk);
if (error != OMX_ErrorNone) {
OUTR(" ",error);
return error;
}
}
else if (portdef.eDomain != OMX_PortDomainVideo)
{
delete [] (char *) pBufferMetaData;
}
OUTR(" ",OMX_ErrorNone);
return OMX_ErrorNone;
}
示例10: PhaseInIrm_Ctor
// Ctor is called to initialize the unit generator.
// It only executes once.
void PhaseInIrm_Ctor(PhaseInIrm* unit)
{
if (INRATE(0) == calc_FullRate) {
SETCALC(PhaseInIrm_next_k);
} else {
SETCALC(PhaseInIrm_next_k);
}
unit->curstate = 0;
unit->timeCallRest = 0;
unit->timeInhibited = 0;
unit->callTrig = 0;
unit->changeState = true;
unit->timeInhibitedBeforeCall = 0;
unit->avgScore = 0;
unit->restTime = IN0(_restPeriod);
unit->lastRestPeriod = unit->restTime;
for (int i = 0; i < NUMSCORES; i++) {
unit->scores[i] = 1;
};
unit->scoreIndex = 0;
unit->score = 1;
PhaseInIrm_next_k(unit, 1);
}
示例11: IN0
TuningLoaderMgrError_t CTuningLoaderManager::saveNvmTuningData(const t_camera_info* pCamInfo,unsigned char* pNvm, t_uint32 aSize)
{
IN0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Entry CTuningLoaderManager::saveNvmTuningData", (mTraceObject));
// Check if constructed
if(iNmfInstance == NULL) {
MSG0("Instance not constructed\n");
OstTraceFiltStatic0(TRACE_ERROR, "Instance not constructed", (mTraceObject));
OUTR(" ",TUNING_LOADER_MGR_NOT_CONSTRUCTED);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadNvmTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_NOT_CONSTRUCTED);
return TUNING_LOADER_MGR_NOT_CONSTRUCTED;
}
// Aguments sanity check
if( (pCamInfo == NULL) || (pNvm ==NULL) || (aSize == 0))
{
MSG1("Bad argument: pCamInfo=%x, pNvm=0x%x, aSize=%x\n", (unsigned int)pCamInfo,(unsigned int)pNvm,(unsigned int)aSize);
OstTraceFiltStatic3(TRACE_ERROR, "Bad argument: pCamInfo=0x%x pNvm=0x%x, aSize=%d", (mTraceObject), (t_uint32)pCamInfo,(t_uint32)pNvm,aSize);
OUTR(" ",TUNING_LOADER_MGR_BAD_ARGUMENT);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadNvmTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_BAD_ARGUMENT);
return TUNING_LOADER_MGR_BAD_ARGUMENT;
}
// Send command to NMF
MSG0("Send 'SaveNvmTuning' command to NMF\n");
OstTraceFiltStatic0(TRACE_DEBUG, "Send 'loadNvmTuning' command to NMF", (mTraceObject));
iNmfQueryIntf.saveNvmTuning(*pCamInfo,(t_uint32)pNvm,aSize);
OUTR(" ",TUNING_LOADER_MGR_OK);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadNvmTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_OK);
return TUNING_LOADER_MGR_OK;
}
示例12: IN0
/*
* This function sets the DefCor dampers
*/
t_damper_error_code CDefCorDamper::SetDamper( const t_defcor_damper_id aDamperId,
const float* pValues,
const int aNumRows,
const int aNumCols)
{
IN0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Entry CDefCorDamper::SetDamper", (mTraceObject));
t_damper_error_code err = DAMPER_OK;
if(aDamperId<0 || aDamperId>=DEFCOR_DAMPERS_NUM)
{
DBGT_ERROR("Invalid damper Id: %d\n", aDamperId);
OstTraceFiltStatic1(TRACE_ERROR, "Invalid damper Id: %d", (mTraceObject), aDamperId);
OUTR(" ",DAMPER_INVALID_ARGUMENT);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CDefCorDamper::SetDamper (%d)", (mTraceObject), DAMPER_INVALID_ARGUMENT);
return DAMPER_INVALID_ARGUMENT;
}
MSG3("[%s] NumRows=%d, NumCols=%d\n", KDefCorDamperInfo[aDamperId].name, aNumRows, aNumCols);
OstTraceFiltStatic3(TRACE_DEBUG, "[KDefCorDamperInfo[%d].name] NumRows=%d, NumCols=%d", (mTraceObject), aDamperId, aNumRows, aNumCols);
err = DoSetDamper( aDamperId, pValues, aNumRows, aNumCols);
if(err!=DAMPER_OK)
{
DBGT_ERROR("[%s] failed to set damper: err=%d\n", KDefCorDamperInfo[aDamperId].name, err);
OstTraceFiltStatic2(TRACE_ERROR, "[KDefCorDamperInfo[%d].name] failed to set damper: err=%d", (mTraceObject), aDamperId, err);
OUTR(" ",err);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CDefCorDamper::SetDamper (%d)", (mTraceObject), err);
return err;
}
OUTR(" ",DAMPER_OK);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CDefCorDamper::SetDamper (%d)", (mTraceObject), DAMPER_OK);
return DAMPER_OK;
}
示例13: IN0
/*
* This function computes the dampers and queues the Page Elements
*/
t_damper_error_code CNoiseFilterDamper::ComputeAndQueuePEs( CIspctlCom* pIspctlCom,
const t_damper_base_values* pBaseValues)
{
IN0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Entry CNoiseFilterDamper::ComputeAndQueuePEs", (mTraceObject));
float pDampedValues[1] = { 0.0 };
t_damper_error_code err = DAMPER_OK;
// Evaluate Noise Filter dampers
err = DoEvaluate( pBaseValues, pDampedValues);
if(err!=DAMPER_OK)
{
DBGT_ERROR("Failed to evaluate damper: err=%d\n", err);
OstTraceFiltStatic1(TRACE_ERROR, "Failed to evaluate damper: err=%d", (mTraceObject), err);
OUTR(" ",err);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CNoiseFilterDamper::ComputeAndQueuePEs (%d)", (mTraceObject), err);
return err;
}
// Queue the Page Elements
float fGaussianWeightDamped = pDampedValues[0];
MSG2("%s = %f\n", CIspctlCom::pIspctlSensor->GetPeName(DusterControl_u8_GaussianWeight_Byte0), fGaussianWeightDamped);
OstTraceFiltStatic1(TRACE_DEBUG, "DusterControl_u8_GaussianWeight = %f", (mTraceObject), fGaussianWeightDamped);
pIspctlCom->queuePE( DusterControl_u8_GaussianWeight_Byte0, (t_uint32)fGaussianWeightDamped);
// Done
OUTR(" ",DAMPER_OK);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CNoiseFilterDamper::ComputeAndQueuePEs (%d)", (mTraceObject), DAMPER_OK);
return DAMPER_OK;
}
示例14: IN0
void openmax_processor::processEvent(void)
//*************************************************************************************************************
{// fsm.component.component.type interface posteven method processEvent
IN0("\n");
Component::processEvent();
OUT0("\n");
}
示例15: AnnBasic_next
void AnnBasic_next(AnnBasic *unit, int numSamples)
{
unsigned int in_c = sigInCount(unit);
unsigned int out_c = sigOutCount(unit);
AnnDef *def = Ann_GetAnnDef<true>( unit->ann_i, sigInCount(unit), sigOutCount(unit) );
if(!def) {
SETCALC( AnnBasic_idle );
AnnBasic_idle(unit, numSamples);
return;
}
struct fann *ann = def->_ann;
float *in = unit->inputs;
for( int i = 0; i < in_c; ++i )
{
in[i] = IN0(IN_SIG + i);
}
fann_type *out = fann_run( ann, in );
for( int i = 0; i < out_c; ++i )
{
OUT0(i) = out[i];
}
}