Home | History | Annotate | Download | only in lib

Lines Matching defs:this

5  * you may not use this file except in compliance with the License.
78 #define PICOPAM_NA 22 /*PAM has not to deal with this item*/
389 static pico_status_t pam_initialize(register picodata_ProcessingUnit this, picoos_int32 resetMode);
390 static pico_status_t pam_terminate(register picodata_ProcessingUnit this);
393 static pico_status_t pam_subobj_deallocate(register picodata_ProcessingUnit this,
398 static picodata_step_result_t pam_step(register picodata_ProcessingUnit this,
402 static picoos_uint8 pam_get_vowel_name(register picodata_ProcessingUnit this,
404 static picoos_uint8 pam_get_pause_id(register picodata_ProcessingUnit this);
412 static pico_status_t pam_reset_processors(register picodata_ProcessingUnit this);
414 register picodata_ProcessingUnit this);
415 static pico_status_t pam_create_syllable(register picodata_ProcessingUnit this,
420 register picodata_ProcessingUnit this, picoos_uint8 nFeat,
422 static pico_status_t pam_process_event(register picodata_ProcessingUnit this,
425 register picodata_ProcessingUnit this, picoos_uint8 *itemBase);
427 register picodata_ProcessingUnit this);
428 static pico_status_t pam_do_pause(register picodata_ProcessingUnit this);
429 static pico_status_t pam_adapter_do_pauses(register picodata_ProcessingUnit this);
431 static pico_status_t pam_expand_vector(register picodata_ProcessingUnit this);
432 static picoos_uint8 pam_do_tree(register picodata_ProcessingUnit this,
435 static pico_status_t pam_get_f0(register picodata_ProcessingUnit this,
437 static pico_status_t pam_get_duration(register picodata_ProcessingUnit this,
440 static pico_status_t pam_update_vector(register picodata_ProcessingUnit this);
442 static pico_status_t pam_put_item(register picodata_ProcessingUnit this,
553 * @param this : handle to a PU struct
559 static pico_status_t pam_initialize(register picodata_ProcessingUnit this, picoos_int32 resetMode)
564 if (NULL == this || NULL == this->subObj) {
567 pam = (pam_subobj_t *) this->subObj;
598 pam_reset_processors(this);
635 pam->dtdur = picokdt_getDtPAM(this->voice->kbArray[PICOKNOW_KBID_DT_DUR]);
637 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING, NULL,
644 this->voice->kbArray[PICOKNOW_KBID_DT_LFZ1]);
646 this->voice->kbArray[PICOKNOW_KBID_DT_LFZ2]);
648 this->voice->kbArray[PICOKNOW_KBID_DT_LFZ3]);
650 this->voice->kbArray[PICOKNOW_KBID_DT_LFZ4]);
652 this->voice->kbArray[PICOKNOW_KBID_DT_LFZ5]);
655 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING,
663 this->voice->kbArray[PICOKNOW_KBID_DT_MGC1]);
665 this->voice->kbArray[PICOKNOW_KBID_DT_MGC2]);
667 this->voice->kbArray[PICOKNOW_KBID_DT_MGC3]);
669 this->voice->kbArray[PICOKNOW_KBID_DT_MGC4]);
671 this->voice->kbArray[PICOKNOW_KBID_DT_MGC5]);
674 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING,
682 this->voice->kbArray[PICOKNOW_KBID_PDF_DUR]);
684 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING, NULL,
691 this->voice->kbArray[PICOKNOW_KBID_PDF_LFZ]);
693 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING, NULL,
700 this->voice->kbArray[PICOKNOW_KBID_TAB_PHONES]);
702 picoos_emRaiseException(this->common->em, PICO_EXC_KB_MISSING, NULL,
712 * @param this : handle to a pam PU struct
717 static pico_status_t pam_terminate(register picodata_ProcessingUnit this)
722 if (NULL == this || NULL == this->subObj) {
725 pam = (pam_subobj_t *) this->subObj;
732 * @param this : handle to a pam PU struct
738 static pico_status_t pam_subobj_deallocate(register picodata_ProcessingUnit this,
744 if (NULL != this) {
745 pam = (pam_subobj_t *) this->subObj;
746 mm = mm; /* avoid warning "var not used in this function"*/
751 picoos_deallocate(this->common->mm, (void *) &pam->sSyllFeats);
754 picoos_deallocate(this->common->mm, (void *) &pam->sPhIds);
757 picoos_deallocate(this->common->mm, (void *) &pam->sPhFeats);
760 picoos_deallocate(this->common->mm, (void *) &pam->sSyllItems);
763 picoos_deallocate(this->common->mm, (void *) &pam->sSyllItemOffs);
765 picoos_deallocate(this->common->mm, (void *) &this->subObj);
778 * @return this : pam PU handle if success
790 picodata_ProcessingUnit this = picodata_newProcessingUnit(mm, common, cbIn,
792 if (this == NULL) {
795 this->initialize = pam_initialize;
797 PICODBG_DEBUG(("picotok_newPamUnit -- set this->step to pam_step"));
799 this->step = pam_step;
800 this->terminate = pam_terminate;
801 this->subDeallocate = pam_subobj_deallocate;
802 this->subObj = picoos_allocate(mm, sizeof(pam_subobj_t));
803 if (this->subObj == NULL) {
805 picoos_deallocate(mm, (void*) &this);
812 pam = (pam_subobj_t *) this->subObj;
815 picoos_deallocate(mm, (void *) &this->subObj);
816 picoos_deallocate(mm, (void *) &this);
821 * Initialize memory for PAM (this may be re-used elsewhere, e.g.Reset)
823 if (PICO_OK != pam_initialize(this, PICO_RESET_FULL)) {
826 return this;
838 * @remarks so far initializes to 0 both values; this will leave the values given by tree prediction
918 * @param this : pointer to current PU struct
927 register picodata_ProcessingUnit this, const picoos_uint8 *item)
932 if (NULL == this || NULL == this->subObj) {
935 pam = (pam_subobj_t *) this->subObj;
984 * @param this : pointer to current PU struct
992 static pico_status_t pam_check_immediate(register picodata_ProcessingUnit this,
996 if (NULL == this || NULL == this->subObj) {
999 pam = (pam_subobj_t *) this->subObj;
1017 * @param this : pointer to current PU struct
1025 static pico_status_t pam_hastobe_queued(register picodata_ProcessingUnit this,
1030 if (NULL == this || NULL == this->subObj) {
1033 pam = (pam_subobj_t *) this->subObj;
1061 * @param this : pointer to current PU struct
1069 static pico_status_t pam_queue(register picodata_ProcessingUnit this,
1076 if (NULL == this || NULL == this->subObj) {
1079 pam = (pam_subobj_t *) this->subObj;
1154 * @param this : Pam object pointer
1161 static picoos_uint8 pamHasToProcess(register picodata_ProcessingUnit this)
1166 if (NULL == this || NULL == this->subObj) {
1169 pam = (pam_subobj_t *) this->subObj;
1184 * @param this : Pam object pointer
1190 static pico_status_t pamUpdateProcess(register picodata_ProcessingUnit this)
1194 if (NULL == this || NULL == this->subObj) {
1197 pam = (pam_subobj_t *) this->subObj;
1200 /*this to be able to manage sudden PU cleanup after FLUSH CMD*/
1209 /*this helps in identifyng the end of syllable condition in PamHasToProcess*/
1212 /*previous syllable phonemes are complete: test if any items are tied to this syllable*/
1214 /*there are items tied to this syllable*/
1246 * @param this : Pam object pointer
1252 static picoos_uint8 pamHasToPop(register picodata_ProcessingUnit this)
1256 if (NULL == this || NULL == this->subObj) {
1259 pam = (pam_subobj_t *) this->subObj;
1284 * @param this : Pam object pointer
1290 static picoos_uint8 *pamPopItem(register picodata_ProcessingUnit this)
1294 if (NULL == this || NULL == this->subObj) {
1297 pam = (pam_subobj_t *) this->subObj;
1325 * @param this : Pam object pointer
1334 static picoos_uint8 *pamPopAttachedSy0(register picodata_ProcessingUnit this)
1338 if (NULL == this || NULL == this->subObj) {
1341 pam = (pam_subobj_t *) this->subObj;
1366 * @param this : Pam object pointer
1377 static pico_status_t pam_get_duration(register picodata_ProcessingUnit this,
1386 pam = (pam_subobj_t *) this->subObj;
1387 if (NULL == this || NULL == this->subObj) {
1428 * @param this : Pam object pointer
1439 static pico_status_t pam_get_f0(register picodata_ProcessingUnit this,
1447 pam = (pam_subobj_t *) this->subObj;
1448 if (NULL == this || NULL == this->subObj) {
1511 * @param this : Pam object pointer
1518 static pico_status_t pam_update_vector(register picodata_ProcessingUnit this)
1525 pam = (pam_subobj_t *) this->subObj;
1526 if (NULL == this || NULL == this->subObj) {
1598 * @param this : Pam object pointer
1605 static pico_status_t pam_expand_vector(register picodata_ProcessingUnit this)
1610 pam = (pam_subobj_t *) this->subObj;
1611 if (NULL == this || NULL == this->subObj) {
1670 * @param this : Pam object pointer
1677 static pico_status_t pamCompressVector(register picodata_ProcessingUnit this)
1681 pam = (pam_subobj_t *) this->subObj;
1682 if (NULL == this || NULL == this->subObj) {
1714 * @param this : Pam object pointer
1721 static pico_status_t pamReorgVector(register picodata_ProcessingUnit this)
1725 pam = (pam_subobj_t *) this->subObj;
1726 if (NULL == this || NULL == this->subObj) {
1887 * @param this : Pam object pointer
1896 static pico_status_t pam_put_item(register picodata_ProcessingUnit this,
1904 pam = (pam_subobj_t *) this->subObj;
1905 if (NULL == this || NULL == this->subObj) {
2056 * @param this : Pam item subobject
2064 static pico_status_t pamDoCommand(register picodata_ProcessingUnit this,
2071 pam = (pam_subobj_t *) this->subObj;
2072 if (NULL == this || NULL == this->subObj) {
2079 pam_reset_processors(this);
2180 * @param this : Pam item subobject pointer
2187 static pico_status_t pamPhoneProcess(register picodata_ProcessingUnit this)
2194 pam = (pam_subobj_t *) this->subObj;
2195 if (NULL == this || NULL == this->subObj) {
2199 sResult = pam_expand_vector(this);
2200 sResult = pamCompressVector(this);
2201 sResult = pamReorgVector(this);
2204 if (!pam_do_tree(this, pam->dtdur, &(pam->sPhFeats[0]), PICOPAM_INVEC_SIZE,
2210 sResult = pam_get_duration(this, pam->durIndex, &(pam->phonDur),
2215 if (!pam_do_tree(this, pam->dtlfz[nI], &(pam->sPhFeats[0]),
2225 sResult = pam_get_f0(this, &(pam->lf0Index[0]), nI, &(pam->phonF0[0]));
2229 sResult = pam_update_vector(this);
2233 if (!pam_do_tree(this, pam->dtmgc[nI], &(pam->sPhFeats[0]),
2241 sResult = pam_put_item(this, pam->outBuf, pam->outWritePos, &bWr);
2251 * @param this : Pam item subobject pointer
2253 * @return PICOPAM_GOTO_FEED : go to feed state after this
2259 static pico_status_t pamDoPreSyll(register picodata_ProcessingUnit this)
2266 pam = (pam_subobj_t *) this->subObj;
2267 if (NULL == this || NULL == this->subObj) {
2271 if (((qItem = pamPopAttachedSy0(this)) != NULL) && !((qItem[0]
2281 nRc = pamDoCommand(this, qItem); /*popped item is a PAM command : do it NOW!!*/
2306 * @param this : Pam item subobject pointer
2315 static picodata_step_result_t pam_step(register picodata_ProcessingUnit this,
2332 if (NULL == this || NULL == this->subObj) {
2335 pam = (pam_subobj_t *) this->subObj;
2336 mode = mode; /* avoid warning "var not used in this function"*/
2349 sResult = picodata_cbGetItem(this->cbIn,
2405 if (pam_check_immediate(this, &(pam->inBuf[pam->inReadPos]))) {
2410 if (pamCheckResourceLimits(this, &(pam->inBuf[pam->inReadPos]))) {
2423 if (pam_hastobe_queued(this, &(pam->inBuf[pam->inReadPos]))) {
2425 pam_queue(this, &(pam->inBuf[pam->inReadPos]));
2444 furthermore this item should be in the set {BOUND,SYLL}.
2446 sResult = pam_adapter_forward_step(this,
2448 /*decide if this item has to be queued for later re-synchronization
2449 normally this is only done for SEND/TERM items*/
2450 if (pam_hastobe_queued(this, &(pam->inBuf[pam->inReadPos]))) {
2452 pam_queue(this, &(pam->inBuf[pam->inReadPos]));
2466 sResult = pam_adapter_backward_step(this);
2472 pam_reset_processors(this);
2504 /*this item has not been stored in internal buffers:
2505 assign this item to the management of
2520 sResult = pam_adapter_forward_step(this, &(bForcedItem[0]));
2523 pam_queue(this, &(bForcedItem[0]));
2525 sResult = pam_adapter_backward_step(this);
2531 pam_reset_processors(this);
2543 pam_reset_processors(this);
2563 sResult = pamDoPreSyll(this);
2605 if (pamHasToProcess(this)) {
2606 if (pamPhoneProcess(this) == PICO_OK) {
2607 sResult = pamUpdateProcess(this);
2616 if (pamHasToPop(this) != FALSE) {
2617 if ((qItem = pamPopItem(this)) == NULL) {
2637 sResult = pamDoCommand(this, qItem); /*popped item is a PAM command : do it NOW!!*/
2648 sResult = pamUpdateProcess(this); /*both "doCommand" or "put" : update PAM status*/
2691 sResult = picodata_cbPutItem(this->cbOut,
2697 PICODATA_INFO_ITEM(this->voice->kbArray[PICOKNOW_KBID_DBG],
2726 if ((pamHasToProcess(this)) || (pamHasToPop(this))) {
2730 pam_reset_processors(this);
2771 * @param this : Pam item subobject pointer
2780 static picoos_uint8 pam_do_tree(register picodata_ProcessingUnit this,
2791 picoos_emRaiseWarning(this->common->em, PICO_WARN_INVECTOR, NULL, NULL);
2798 picoos_emRaiseWarning(this->common->em, PICO_WARN_CLASSIFICATION, NULL,
2806 picoos_emRaiseWarning(this->common->em, PICO_WARN_OUTVECTOR, NULL, NULL);
2817 * @param this : Pam item subobject pointer
2824 static picoos_uint8 pam_get_vowel_name(register picodata_ProcessingUnit this,
2829 if (NULL == this || NULL == this->subObj) {
2832 pam = (pam_subobj_t *) this->subObj;
2851 * @param this : Pam sub object pointer
2857 static picoos_uint8 pam_get_pause_id(register picodata_ProcessingUnit this)
2862 if (NULL == this || NULL == this->subObj) {
2865 pam = (pam_subobj_t *) this->subObj;
2893 iteminfo1 = iteminfo1; /* avoid warning "var not used in this function"*/
2952 * @param this : pointer to PAM PU sub object pointer
2958 static pico_status_t pam_reset_processors(register picodata_ProcessingUnit this)
2961 if (NULL == this || NULL == this->subObj) {
2964 pam = (pam_subobj_t *) this->subObj;
3006 * @param this : pointer to PAM PU sub object pointer
3013 register picodata_ProcessingUnit this)
3016 if (NULL == this || NULL == this->subObj) {
3019 pam = (pam_subobj_t *) this->subObj;
3091 * @param this : pointer to PAM PU sub object pointer
3101 register picodata_ProcessingUnit this, picoos_uint8 nFeat,
3107 if (NULL == this || NULL == this->subObj) {
3110 pam = (pam_subobj_t *) this->subObj;
4170 * @param this : pointer to PAM PU sub object pointer
4178 static pico_status_t pam_process_event(register picodata_ProcessingUnit this,
4185 if (NULL == this || NULL == this->subObj) {
4188 pam = (pam_subobj_t *) this->subObj;
4202 nResult = pam_process_event_feature(this, nFeat, event_type, direction);
4211 * @param this : pointer to PAM PU sub object pointer
4223 static pico_status_t pam_create_syllable(register picodata_ProcessingUnit this,
4234 if (NULL == this || NULL == this->subObj) {
4237 pam = (pam_subobj_t *) this->subObj;
4309 pam->sSyllFeats[pam->nCurrSyllable].phoneV[P1] = 1; /*this means the syllable contains a pause-silence*/
4331 pam->sPhIds[pam->nCurrPhoneme] = pam_get_pause_id(this);
4366 pam->sSyllFeats[pam->nCurrSyllable].phoneV[B16] = pam_get_vowel_name(this,
4391 * @param this : pointer to PAM PU sub object pointer
4400 register picodata_ProcessingUnit this, picoos_uint8 *itemBase)
4407 if (NULL == this || NULL == this->subObj) {
4410 pam = (pam_subobj_t *) this->subObj;
4436 pam_reset_processors(this); /*reset all processor variables*/
4441 sResult = pam_create_syllable(this, PICOPAM_SYLL_PAUSE, NULL,
4446 sResult = pam_process_event(this, PICOPAM_EVENT_P_BOUND,
4462 sResult = pam_create_syllable(this, PICOPAM_SYLL_PAUSE, NULL,
4467 sResult = pam_process_event(this, PICOPAM_EVENT_P_BOUND,
4480 sResult = pam_process_event(this, PICOPAM_EVENT_S_BOUND,
4494 sResult = pam_process_event(this, PICOPAM_EVENT_W_BOUND,
4505 sResult = pam_create_syllable(this, PICOPAM_SYLL_PAUSE, NULL,
4510 sResult = pam_process_event(this, PICOPAM_EVENT_P_BOUND,
4524 sResult = pam_create_syllable(this, PICOPAM_SYLL_PAUSE, NULL,
4529 sResult = pam_process_event(this, PICOPAM_EVENT_P_BOUND,
4548 this may happen after a term has been issued to make room in local storage.
4551 pam_reset_processors(this);
4553 sResult = pam_create_syllable(this, PICOPAM_SYLL_PAUSE, NULL,
4558 sResult = pam_process_event(this, PICOPAM_EVENT_P_BOUND,
4564 sResult = pam_create_syllable(this, PICOPAM_SYLL_SYLL, itemBase,
4568 sResult = pam_process_event(this, PICOPAM_EVENT_SYLL,
4584 * @param this : pointer to PAM PU sub object pointer
4592 register picodata_ProcessingUnit this)
4598 if (NULL == this || NULL == this->subObj) {
4601 pam = (pam_subobj_t *) this->subObj;
4604 pam_reset_processors_back(this);
4611 pam_process_event(this, PICOPAM_EVENT_P_BOUND, PICOPAM_DIR_BACK);
4618 pam_process_event(this, PICOPAM_EVENT_S_BOUND, PICOPAM_DIR_BACK);
4619 pam_process_event(this, PICOPAM_EVENT_SYLL, PICOPAM_DIR_BACK);
4626 pam_process_event(this, PICOPAM_EVENT_W_BOUND, PICOPAM_DIR_BACK);
4627 pam_process_event(this, PICOPAM_EVENT_SYLL, PICOPAM_DIR_BACK);
4633 pam_process_event(this, PICOPAM_EVENT_SYLL, PICOPAM_DIR_BACK);
4641 pam_adapter_do_pauses(this);
4650 * @param this : pointer to PAM PU sub object pointer : processes a pause (silence) syllable after backward processing
4654 * @remarks this function should be called after backward processing
4655 * @remarks this function corresponds to initializing silence phonemes with
4660 static pico_status_t pam_do_pause(register picodata_ProcessingUnit this)
4664 if (NULL == this || NULL == this->subObj) {
4667 pam = (pam_subobj_t *) this->subObj;
4776 * @param this : pointer to PAM PU sub object pointer : processes a pause (silence) syllable after backward processing
4782 static pico_status_t pam_adapter_do_pauses(register picodata_ProcessingUnit this)
4787 if (NULL == this || NULL == this->subObj) {
4790 pam = (pam_subobj_t *) this->subObj;
4797 pam_do_pause(this);