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

Method myTick

src/core/windowProcessor.cpp:167–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165*/
166
167eTickResult cWindowProcessor::myTick(long long t)
168{
169 SMILE_IDBG(4,"tick # %i, running window processor",t);
170 if ((isEOI())&&(noPostEOIprocessing)) return TICK_INACTIVE;
171
172 int ret = 1;
173
174 if (!(writer_->checkWrite(blocksizeW_))) return TICK_DEST_NO_SPACE;
175
176 // get next block from dataMemory
177 cMatrix *mat = reader_->getNextMatrix();
178 // TODO: if blocksize< order!! also check if we need to increase the read counter!
179 if (mat != NULL) {
180
181 int i,j,toSet=0;
182 if (matnew == NULL) {
183 matnew = new cMatrix(mat->N*multiplier, mat->nT-winsize);
184// printf("XXXaa matnew N = %i, mult = %i, matN = %i, matNt %i, ws %i\n",matnew->N,multiplier,mat->N,mat->nT,winsize);
185 }
186
187 // TODO: support multiplier for N output rows for each input row!
188 if (rowsout == NULL) rowsout = new cMatrix(multiplier, mat->nT-winsize);
189 if (multiplier > 1 && rowout == NULL) rowout = new cMatrix(1, mat->nT-winsize);
190 if (row == NULL) row = new cMatrix(1,mat->nT);
191 for (i=0; i<mat->N; i++) {
192 // get matrix row...
193 cMatrix *rowr = mat->getRow(i,row);
194 if (rowr==NULL) COMP_ERR("cWindowProcessor::myTick : Error getting row %i from matrix! (return obj = NULL!)",i);
195 if (row->data != NULL) row->data += pre;
196 row->nT -= winsize;
197 toSet = processBuffer(row, rowsout, pre, post);
198 if (toSet == 0) toSet = processBuffer(row, rowsout, pre, post, i);
199 if (!toSet) ret=0;
200 // copy row back into new matrix... ( NO overlap!)
201 if (toSet==1) {
202 if (multiplier > 1) {
203 for (j=0; j<multiplier; j++) {
204 rowsout->getRow(j,rowout);
205 matnew->setRow(i*multiplier+j,rowout);
206 }
207 } else {
208 matnew->setRow(i,rowsout);
209 }
210 }
211 if (row->data != NULL) row->data -= pre;
212 row->nT += winsize;
213 }
214 // set next matrix...
215 if (toSet==1) {
216 mat->tmeta += pre; // TODO::: skip "order" elements of tmeta array ..ok?
217 matnew->setTimeMeta(mat->tmeta);
218 mat->tmeta -= pre;
219 writer_->setNextMatrix(matnew);
220 }
221 } else {
222// printf("WINPROC '%s' mat==NULL tickNr=%i EOI=%i\n",getInstName(),t,isEOI());
223 return TICK_SOURCE_NOT_AVAIL;
224 }

Callers

nothing calls this directly

Calls 6

getNextMatrixMethod · 0.80
getRowMethod · 0.80
setRowMethod · 0.80
setTimeMetaMethod · 0.80
setNextMatrixMethod · 0.80
checkWriteMethod · 0.45

Tested by

no test coverage detected