コード例 #1
0
ファイル: MCLDPollUGens.cpp プロジェクト: Endut/sc3-plugins
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
0
ファイル: FeatureSave.cpp プロジェクト: Endut/sc3-plugins
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
0
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
0
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
0
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
0
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
0
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
0
ファイル: Membrane.cpp プロジェクト: Endut/sc3-plugins
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
0
camSharedMemError_t CCamSharedMemory::cacheInvalidate(camSharedMemChunkId_t chunkId)
{
    IN0("\n");
    OstTraceFiltStatic0(TRACE_FLOW, "Entry CCamSharedMemory::cacheInvalidate", (mTraceObject));
    if (state != CCamSharedMemory::CAM_SHARED_MEM_STATE_OPEN) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::cacheInvalidate (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_STATE);
        return CAM_SHARED_MEM_ERR_BAD_STATE;
    }
    if (chunkId >= CAM_SHARED_MEM_CHUNK_MAX) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::cacheInvalidate (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_PARAMETER);
        return CAM_SHARED_MEM_ERR_BAD_PARAMETER;
    }
    if (! abBusyChunks[chunkId]) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::cacheInvalidate (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_PRECONDITION);
        return CAM_SHARED_MEM_ERR_BAD_PRECONDITION;
    }
    // Flush the data that have been written by the ISP FW
    OMX_U32 aPhysAddr; // out
    OMX_ERRORTYPE e_ret = sharedBufferPoolId->CacheSync(MMHwBuffer::ESyncAfterWriteHwOperation,
            (OMX_U32) aChunks[chunkId].armLogicalAddress,
            aChunks[chunkId].size, aPhysAddr);
    if (e_ret != OMX_ErrorNone) {
        MSG1("Problem invalidating data cache (err=%d)\n", e_ret);
        OstTraceFiltStatic1(TRACE_DEBUG, "Problem invalidating data cache (err=%d)", (mTraceObject), e_ret);
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::cacheInvalidate (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_NO_RESOURCE);
        return CAM_SHARED_MEM_ERR_NO_RESOURCE;
    }
    OUT0("\n");
    OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::cacheInvalidate (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_NONE);
    return CAM_SHARED_MEM_ERR_NONE;
}
コード例 #10
0
camSharedMemError_t CCamSharedMemory::getChunk(camSharedMemChunk_t *pChunk, camSharedMemChunkId_t chunkId)
{
    IN0("\n");
    OstTraceFiltStatic0(TRACE_FLOW, "Entry CCamSharedMemory::getChunk", (mTraceObject));
    if (state != CCamSharedMemory::CAM_SHARED_MEM_STATE_OPEN) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::getChunk (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_STATE);
        return CAM_SHARED_MEM_ERR_BAD_STATE;
    }
    if (chunkId >= CAM_SHARED_MEM_CHUNK_MAX) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::getChunk (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_PARAMETER);
        return CAM_SHARED_MEM_ERR_BAD_PARAMETER;
    }
    if (abBusyChunks[chunkId]) {
        OUT0("\n");
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::getChunk (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_BAD_PRECONDITION);
        return CAM_SHARED_MEM_ERR_BAD_PRECONDITION;
    }
    abBusyChunks[chunkId] = true;
    *pChunk = aChunks[chunkId];
    OUT0("\n");
    OstTraceFiltStatic1(TRACE_FLOW, "Exit CCamSharedMemory::getChunk (%d)", (mTraceObject), CAM_SHARED_MEM_ERR_NONE);
    return CAM_SHARED_MEM_ERR_NONE;
}
コード例 #11
0
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;
}
コード例 #12
0
// 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);
}
コード例 #13
0
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;
}
コード例 #14
0
/*
 * 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;
}
コード例 #15
0
/*
 * 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;
}
コード例 #16
0
void openmax_processor::processEvent(void)
//*************************************************************************************************************
{// fsm.component.component.type interface posteven method processEvent
	IN0("\n");
	Component::processEvent();
	OUT0("\n");
}
コード例 #17
0
void openmax_processor::sendCommand(OMX_COMMANDTYPE cmd, t_uword param)
//*************************************************************************************************************
{ // fsm.component.component.type interface sendcommand method sendCommand
	IN0("\n");
	Component::sendCommand(cmd, param) ;
	OUT0("\n");
}
コード例 #18
0
void openmax_processor::setParam(t_sint32 portIndex, t_sint32 fifoSize, t_sint32 direction, t_sint32 buffSupplierType, t_sint32 correspondingPortIndex, t_sint32 width, t_sint32 height, t_sint32 colorFormat, t_sint32 stride)
//*************************************************************************************************************
{ //DEfault initialisation of the ports
	IN0("\n");
	MSG4("portIndex %ld, fifoSize %ld, direction %ld, buffSupplierType%ld\n", portIndex, fifoSize, direction, buffSupplierType);
	MSG4("correspondingPortIndex %ld, width %ld, height %ld, colorFormat %ld\n", correspondingPortIndex, width, height, colorFormat);
	MSG1("stride %ld\n", stride);
	if(portIndex >= (int)GetNbPorts()) // Sanity check
	{
		MSG0("ERROR in setParam OMX_ErrorBadParameter\n");
		OUTR(" Error", OMX_ErrorBadParameter);
		return;
	}

	portInformation*pInfo= GetPortInfo(portIndex);
	if (pInfo)
	{
		pInfo->fifoSize      = fifoSize;
		pInfo->width         = width;
		pInfo->height        = height;
		pInfo->colorFormat   = (OMX_COLOR_FORMATTYPE)colorFormat;
		pInfo->omxPortIndex  = portIndex;
		pInfo->stride        = stride;
		pInfo->direction     = (OMX_DIRTYPE) direction;
		pInfo->bufferSupplier= buffSupplierType;
		pInfo->omxPortIndex  = correspondingPortIndex;
	}
	OUT0("\n");
}
コード例 #19
0
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];
    }
}
コード例 #20
0
void AnnBasic_Ctor(AnnBasic* unit)
{
    unit->ann_i = -1;
    unit->inputs = 0;

    int ann_i = IN0( IN_ANN_NUM );
    unsigned int inc = sigInCount(unit);
    unsigned int outc = sigOutCount(unit);

    // init ANN input buffer

    fann_type* ann_ins = (fann_type*) RTAlloc( unit->mWorld, sizeof(fann_type) * inc);
    for(int i=0; i < inc; ++i) ann_ins[i] = 0.f;

    // set up the unit

    unit->ann_i = ann_i;
    unit->inputs = ann_ins;
    SETCALC( AnnBasic_next);

    // Calculate one sample of output

    AnnBasic_next( unit, 1 );
    //AnnBasic_idle( unit, 1 );
}
OMX_ERRORTYPE MPEG4Enc_ArmNmf_ProcessingComponent::codecConfigure()
{
	IN0("");

    OUT0("");
    return OMX_ErrorNone;
}
コード例 #22
0
/*
 * tuningloader_fileio write method
 */
t_fileio_error tuningloader_fileio::write(const void* pSrcBuffer, int aNumBytes)
{
    IN0("\n");
    size_t iNumBytesWritten = 0;

    // Sanity check
    if( pSrcBuffer == NULL || aNumBytes == 0)
    {
        // Bad parameter
        MSG2("Bad parameter: pSrcBuffer=%p aNumBytes=%d\n", pSrcBuffer, aNumBytes);
        OUTR(" ", FILEIO_BAD_ARGUMENT);
        return FILEIO_BAD_ARGUMENT;
    }
    if( pFile == NULL)
    {
        // File is not open
        MSG0("File not open\n");
        OUTR(" ", FILEIO_FILE_NOT_OPEN);
        return FILEIO_FILE_NOT_OPEN;
    }

    // Write to file
    iNumBytesWritten = fwrite( pSrcBuffer, 1, (size_t)aNumBytes, pFile);
    if( iNumBytesWritten != (size_t)aNumBytes )
    {
        // Could not write into file
        MSG0("Write failed, closing file\n");
        OUTR(" ", FILEIO_WRITE_FAILED);
        return FILEIO_WRITE_FAILED;
    }

    // Sucessfully wrote to file
    OUTR(" ",FILEIO_OK);
    return FILEIO_OK;
}
コード例 #23
0
/*
 * This function sets the sharpening damper
 */
t_damper_error_code CSharpeningDamperLR::SetDamper( const t_sharpening_damper_lr_id aDamperId,
                                                    const float*                    pValues,
                                                    const int                       aNumRows,
                                                    const int                       aNumCols)
{
   IN0("\n");
   OstTraceFiltStatic0(TRACE_FLOW, "Entry CSharpeningDamperLR::SetDamper", (mTraceObject));
   t_damper_error_code err = DAMPER_OK;
   if(aDamperId<0 || aDamperId>=SHARPENING_DAMPERS_LR_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 CSharpeningDamperLR::SetDamper (%d)", (mTraceObject), DAMPER_INVALID_ARGUMENT);
      return DAMPER_INVALID_ARGUMENT;
   }
   MSG3("[%s] NumRows=%d, NumCols=%d\n", SHARPENING_DAMPER_LR_NAME(aDamperId), aNumRows, aNumCols);
   OstTraceFiltStatic3(TRACE_DEBUG, "SHARPENING_DAMPER_LR_NAME(%d) 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", SHARPENING_DAMPER_LR_NAME(aDamperId), err);
      OstTraceFiltStatic2(TRACE_ERROR, "SHARPENING_DAMPER_LR_NAME(%d) failed to set damper: err=%d", (mTraceObject), aDamperId, err);
      OUTR(" ",err);
      OstTraceFiltStatic1(TRACE_FLOW, "Exit CSharpeningDamperLR::SetDamper (%d)", (mTraceObject), err);
      return err;
   }
   OUTR(" ",DAMPER_OK);
   OstTraceFiltStatic1(TRACE_FLOW, "Exit CSharpeningDamperLR::SetDamper (%d)", (mTraceObject), DAMPER_OK);
   return DAMPER_OK;
}
コード例 #24
0
cam_flash_err_e CFlashSequencer::startSeq(sequenceID_t sequence, CFlashController *pController, flashSeqClbk_t pClbk, flashSeqClbkCtxtHnd_t ctxtHnd) {
    IN0("\n");
    if (pController == NULL) {      // Error: a valid controller handle must be passed.
        OUT0("\n");
        return CAM_FLASH_ERR_BAD_PARAMETER;
    }
    if (curSeq != NONE_SEQ) {   // A running sequence cannot be interrupted
        OUT0("\n");
        return CAM_FLASH_ERR_BAD_PRECONDITION; 
    }
    curSeq = sequence;
    switch (sequence) {
        case NONE_SEQ:
            i32_remSteps = 0;
            break;
        case RED_EYE_REMOVAL_SEQ:
            i32_remSteps = sizeof(a_RER_sequence) / sizeof(cam_flashSeq_atom_t);
            break;
        case PRIVACY_SEQ:
            i32_remSteps = sizeof(a_PI_sequence) / sizeof(cam_flashSeq_atom_t);
            break;
    }
    mController = pController;
    mpClbk = pClbk;
    mctxtHnd = ctxtHnd;
    sigTimer(); // To be called after delay by the chosen timing service.
    OUT0("\n");
    return CAM_FLASH_ERR_NONE;
}
コード例 #25
0
/*
 * This function launches the loading of the flash tuning data
 */
TuningLoaderMgrError_t CTuningLoaderManager::loadFlashTuningData(const t_flash_info* pFlashInfo)
{
    IN0("\n");
    OstTraceFiltStatic0(TRACE_FLOW, "Entry CTuningLoaderManager::loadFlashTuningData", (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::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_NOT_CONSTRUCTED);
        return TUNING_LOADER_MGR_NOT_CONSTRUCTED;
    }

    // Aguments sanity check
    if( pFlashInfo == NULL)
    {
        MSG1("Bad argument: pFlashInfo=%p\n", pFlashInfo);
        OstTraceFiltStatic1(TRACE_ERROR, "Bad argument: pFlashInfo=0x%x", (mTraceObject), (t_uint32)pFlashInfo);
        OUTR(" ",TUNING_LOADER_MGR_BAD_ARGUMENT);
        OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_BAD_ARGUMENT);
        return TUNING_LOADER_MGR_BAD_ARGUMENT;
    }

    // Send command to NMF
    MSG0("Send 'loadFlashTuning' command to NMF\n");
    OstTraceFiltStatic0(TRACE_DEBUG, "Send 'loadFlashTuning' command to NMF", (mTraceObject));
    iNmfQueryIntf.loadFlashTuning(*pFlashInfo);

    OUTR(" ",TUNING_LOADER_MGR_OK);
    OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_OK);
    return TUNING_LOADER_MGR_OK;
}
コード例 #26
0
void CFlashSequencer::sigTimer() {
    IN0("\n");
    cam_flashSeq_atom_t const *pSeq = NULL;
    if (i32_remSteps > 0) { // Some flash action still to be done
        switch (curSeq) {
            default:
            case NONE_SEQ:
                DBGT_ERROR("CFlashSequencer::sigTimer - Error: NONE_SEQ cannot be ticked.\n");
                OstTraceFiltStatic0(TRACE_ERROR, "CFlashSequencer::sigTimer - Error: NONE_SEQ cannot be ticked.", (mTraceObject));
                break;
            case RED_EYE_REMOVAL_SEQ:
                pSeq = &a_RER_sequence[sizeof(a_RER_sequence) / sizeof(cam_flashSeq_atom_t) - i32_remSteps];
                break;
            case PRIVACY_SEQ:
                pSeq = &a_PI_sequence[sizeof(a_PI_sequence) / sizeof(cam_flashSeq_atom_t) - i32_remSteps];
                break; 
        }
        if (NULL != pSeq) {
            doAtom(pSeq);
        }
        i32_remSteps--;
    } else {            // End of sequence: call the user back if requested, and clean the request.
        MSG1("CFlashSequencer::sigTimer - Sequence %d completed.\n", curSeq);
        curSeq = NONE_SEQ;
        if (mpClbk != NULL) {
            mpClbk(mctxtHnd);
            mpClbk = NULL;
            mctxtHnd = NULL;
        }
    }
    OUT0("\n");
}
コード例 #27
0
/*
 * This function computes the dampers and queues the Page Elements
 */
t_damper_error_code CDefCorDamper::ComputeAndQueuePEs( CIspctlCom*                 pIspctlCom,
                                                       const t_damper_base_values* pBaseValues)
{
   IN0("\n");
   OstTraceFiltStatic0(TRACE_FLOW, "Entry CDefCorDamper::ComputeAndQueuePEs", (mTraceObject));
   float pDamperValues[DEFCOR_DAMPERS_NUM] = {0.0, 0.0};
   t_damper_error_code err = DAMPER_OK;

   // Evaluate DefCor dampers
   err = DoEvaluate( pBaseValues, pDamperValues);
   if(err!=DAMPER_OK)
   {
      DBGT_ERROR("Evaluation failed: err=%d\n", err);
      OstTraceFiltStatic1(TRACE_ERROR, "Evaluation failed: err=%d", (mTraceObject), err);
      OUTR(" ",err);
      OstTraceFiltStatic1(TRACE_FLOW, "Exit CDefCorDamper::ComputeAndQueuePEs (%d)", (mTraceObject), err);
      return err;
   }

   // Queue the Page Elements
   for(int i=0; i<DEFCOR_DAMPERS_NUM; i++)
   {
      MSG2("%s = %f\n", CIspctlCom::pIspctlSensor->GetPeName(KDefCorDamperInfo[i].addr), pDamperValues[i]);
      //OstTraceFiltStatic2(TRACE_DEBUG, "%s = %f", (mTraceObject), CXp70::GetPeName(KDefCorDamperInfo[i].addr), pDamperValues[i]);
      pIspctlCom->queuePE( KDefCorDamperInfo[i].addr, (t_uint32)pDamperValues[i]);
   }

   // Done
   OUTR(" ",DAMPER_OK);
   OstTraceFiltStatic1(TRACE_FLOW, "Exit CDefCorDamper::ComputeAndQueuePEs (%d)", (mTraceObject), DAMPER_OK);
   return DAMPER_OK;
}
コード例 #28
0
/*
 * This function computes the dampers and queues the Page Elements
 */
t_damper_error_code CScorpioDamper::ComputeAndQueuePEs( CIspctlCom*                 pIspctlCom,
                                                        const t_damper_base_values* pBaseValues)
{
   IN0("\n");
   OstTraceFiltStatic0(TRACE_FLOW, "Entry CScorpioDamper::ComputeAndQueuePEs", (mTraceObject));
   float pDampedValues[1] = { 0.0 };
   float fCoringLevel = 0.0;
   t_damper_error_code err = DAMPER_OK;

   // Evaluate Scorpio dampers
   err = DoEvaluate( pBaseValues, pDampedValues);
   if(err!=DAMPER_OK)
   {
      DBGT_ERROR("Evaluation failed: err=%d\n", err);
      OstTraceFiltStatic1(TRACE_ERROR, "Evaluation failed: err=%d", (mTraceObject), err);
      OUTR(" ",err);
      OstTraceFiltStatic1(TRACE_FLOW, "Exit CScorpioDamper::ComputeAndQueuePEs (%d)", (mTraceObject), err);
      return err;
   }

   // Queue the Page Elements list
   fCoringLevel = pDampedValues[0];
   MSG2("%s = %f\n", CIspctlCom::pIspctlSensor->GetPeName(Scorpio_Ctrl_u8_CoringLevel_Ctrl_Byte0), fCoringLevel);
   OstTraceFiltStatic1(TRACE_DEBUG, "Scorpio_Ctrl_u8_CoringLevel_Ctrl = %f", (mTraceObject), fCoringLevel);
   pIspctlCom->queuePE( Scorpio_Ctrl_u8_CoringLevel_Ctrl_Byte0, (t_uint32)fCoringLevel);

   // Done
   OUTR(" ",DAMPER_OK);
   OstTraceFiltStatic1(TRACE_FLOW, "Exit CScorpioDamper::ComputeAndQueuePEs (%d)", (mTraceObject), DAMPER_OK);
   return DAMPER_OK;
}
コード例 #29
0
int openmax_processor::ReportError(int error, const char *format, ...)
//*************************************************************************************************************
{
	IN0("\n");
	if (error == eError_NoError)
		return(0);
	if (m_LastError ==eError_NoError)
		m_LastError=error;  //Memorize the error
	va_list list;
	va_start(list, format);

#ifndef __SYMBIAN32__
	fprintf (stderr, "\n<Error-%s: %d=0x%X> ", m_pName, error, error);
	vfprintf(stderr, format, list);
#else
	static char ErrorString[1024];
	vsprintf(ErrorString, format, list);
	RDebug::Printf("\n<Error-%s: %d=0x%X: %s>", m_pName, error, error, ErrorString);
#endif
	va_end(list);
	//::ReportError(error, format); // Call global

	OUT0("\n");
	return(0);
}
コード例 #30
0
void OpenMax_Component_ConfigCB::setConfig(t_sint32 index, void * opaque_ptr)
//*************************************************************************************************************
{
	IN0("\n");
	mOMXProxy->setConfigFromProcessing((OMX_INDEXTYPE)index, (OMX_PTR)opaque_ptr);
	OUT0("\n");
}