MCPcopy Create free account
hub / github.com/audeering/opensmile / myTick

Method myTick

src/core/vectorProcessor.cpp:290–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290eTickResult cVectorProcessor::myTick(long long t)
291{
292 SMILE_IDBG(4,"tick # %i, running vector processor",t);
293
294 if (!(writer_->checkWrite(1))) return TICK_DEST_NO_SPACE;
295 // printf("'%s' checkwrite ok\n",getInstName());
296
297 // get next frame from dataMemory
298 cVector *vec = reader_->getNextFrame();
299 int i;
300 int iO = 0;
301 int toSet = 1;
302 int ret = 1;
303 int res;
304
305 if (vecO == NULL)
306 vecO = new cVector(No);
307 if (customVecProcess(vec, vecO)) {
308 if (vec != NULL) vecO->setTimeMeta(vec->tmeta);
309 // save the output to dataMemory
310 writer_->setNextFrame(vecO);
311 return TICK_SUCCESS;
312 }
313
314 // NOTE: this might break upsamling components if they rely on flush??
315 if (vec == NULL && !isEOI())
316 return TICK_SOURCE_NOT_AVAIL;
317
318 FLOAT_DMEM *dFi = NULL;
319 if (vec != NULL) {
320 dFi = vec->data;
321 }
322 FLOAT_DMEM *dFo = vecO->data;
323 if (processArrayFields == 2) {
324 if (Nfo != Nfi) {
325 SMILE_IERR(1, "Number of input fields (%i) != Number of output fields (%i) - "
326 "not yet supported in mode processArrayFields=2 (transposed).", Nfi, Nfo);
327 COMP_ERR("aborting");
328 }
329 for (i = 0; i < fieldLength_; i++) {
330 if (vec != NULL) {
331 // assemble bufTransposedInput from dFi buffer (vec->data)
332 for (int j = 0; j < Nfi; j++) {
333 bufTransposeInput_[j] = dFi[j * fieldLength_ + i];
334 }
335 res = processVector(bufTransposeInput_, bufTransposeOutput_,
336 Nfi, Nfo, i);
337 } else {
338 res = flushVector(bufTransposeOutput_, Nfi, Nfo, i);
339 }
340 if (res == 0)
341 ret = 0;
342 else
343 if (res < 0)
344 toSet = 0;
345 // save bufTransposedOutput to dFo buffer (vecO->data)
346 for (int j = 0; j < Nfo; j++) {
347 dFo[j * fieldLength_ + i] = bufTransposeOutput_[j];

Callers

nothing calls this directly

Calls 4

getNextFrameMethod · 0.80
setTimeMetaMethod · 0.80
setNextFrameMethod · 0.80
checkWriteMethod · 0.45

Tested by

no test coverage detected