From: Keiichiro O. <ur...@us...> - 2015-12-25 06:24:10
|
Update of /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21368/bin/vc/hts_engine_API Modified Files: COPYING HTS_engine.h HTS_hidden.h HTS_pstream.c HTS_sstream.c Log Message: update hts_engine API to latest version Index: HTS_engine.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API/HTS_engine.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HTS_engine.h 14 Dec 2015 05:45:40 -0000 1.5 --- HTS_engine.h 25 Dec 2015 06:24:07 -0000 1.6 *************** *** 76,80 **** /* copyright ------------------------------------------------------- */ ! #define HTS_COPYRIGHT "The HMM-Based Speech Synthesis Engine \"hts_engine API\"\nVersion 1.09 (http://hts-engine.sourceforge.net/)\nCopyright (C) 2001-2014 Nagoya Institute of Technology\n 2001-2008 Tokyo Institute of Technology\nAll rights reserved.\n" /* audio ----------------------------------------------------------- */ --- 76,80 ---- /* copyright ------------------------------------------------------- */ ! #define HTS_COPYRIGHT "The HMM-Based Speech Synthesis Engine \"hts_engine API\"\nVersion 1.10 (http://hts-engine.sourceforge.net/)\nCopyright (C) 2001-2015 Nagoya Institute of Technology\n 2001-2008 Tokyo Institute of Technology\nAll rights reserved.\n" /* audio ----------------------------------------------------------- */ Index: HTS_pstream.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API/HTS_pstream.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HTS_pstream.c 14 Dec 2015 05:45:40 -0000 1.5 --- HTS_pstream.c 25 Dec 2015 06:24:07 -0000 1.6 *************** *** 237,242 **** step *= STEPINC; } ! for (t = 0; t < pst->length; t++) ! pst->par[t][m] += step * pst->sm.g[t]; prev = obj; } --- 237,244 ---- step *= STEPINC; } ! for (t = 0; t < pst->length; t++) { ! if (pst->gv_switch[t]) ! pst->par[t][m] += step * pst->sm.g[t]; ! } prev = obj; } *************** *** 293,297 **** for (i = 0; i < pss->nstream; i++) { pst = &pss->pstream[i]; ! if (HTS_SStreamSet_is_msd(sss, i)) { /* for MSD */ pst->length = 0; for (state = 0; state < HTS_SStreamSet_get_total_state(sss); state++) --- 295,299 ---- for (i = 0; i < pss->nstream; i++) { pst = &pss->pstream[i]; ! if (HTS_SStreamSet_is_msd(sss, i) == TRUE) { /* for MSD */ pst->length = 0; for (state = 0; state < HTS_SStreamSet_get_total_state(sss); state++) *************** *** 299,312 **** pst->length += HTS_SStreamSet_get_duration(sss, state); pst->msd_flag = (HTS_Boolean *) HTS_calloc(pss->total_frame, sizeof(HTS_Boolean)); ! for (state = 0, frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) ! if (HTS_SStreamSet_get_msd(sss, i, state) > msd_threshold[i]) for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { pst->msd_flag[frame] = TRUE; frame++; ! } else for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { pst->msd_flag[frame] = FALSE; frame++; } } else { /* for non MSD */ pst->length = pss->total_frame; --- 301,317 ---- pst->length += HTS_SStreamSet_get_duration(sss, state); pst->msd_flag = (HTS_Boolean *) HTS_calloc(pss->total_frame, sizeof(HTS_Boolean)); ! for (state = 0, frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) { ! if (HTS_SStreamSet_get_msd(sss, i, state) > msd_threshold[i]) { for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { pst->msd_flag[frame] = TRUE; frame++; ! } ! } else { for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { pst->msd_flag[frame] = FALSE; frame++; } + } + } } else { /* for non MSD */ pst->length = pss->total_frame; *************** *** 350,357 **** } pst->gv_switch = (HTS_Boolean *) HTS_calloc(pst->length, sizeof(HTS_Boolean)); ! if (HTS_SStreamSet_is_msd(sss, i)) { /* for MSD */ for (state = 0, frame = 0, msd_frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++, frame++) ! if (pst->msd_flag[frame]) pst->gv_switch[msd_frame++] = HTS_SStreamSet_get_gv_switch(sss, i, state); } else { /* for non MSD */ --- 355,362 ---- } pst->gv_switch = (HTS_Boolean *) HTS_calloc(pst->length, sizeof(HTS_Boolean)); ! if (HTS_SStreamSet_is_msd(sss, i) == TRUE) { /* for MSD */ for (state = 0, frame = 0, msd_frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++, frame++) ! if (pst->msd_flag[frame] == TRUE) pst->gv_switch[msd_frame++] = HTS_SStreamSet_get_gv_switch(sss, i, state); } else { /* for non MSD */ *************** *** 370,382 **** } /* copy pdfs */ ! if (HTS_SStreamSet_is_msd(sss, i)) { /* for MSD */ for (state = 0, frame = 0, msd_frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) { for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { ! if (pst->msd_flag[frame]) { /* check current frame is MSD boundary or not */ for (k = 0; k < pst->win_size; k++) { not_bound = TRUE; for (shift = pst->win_l_width[k]; shift <= pst->win_r_width[k]; shift++) ! if ((int) frame + shift < 0 || (int) pss->total_frame <= (int) frame + shift || !pst->msd_flag[frame + shift]) { not_bound = FALSE; break; --- 375,387 ---- } /* copy pdfs */ ! if (HTS_SStreamSet_is_msd(sss, i) == TRUE) { /* for MSD */ for (state = 0, frame = 0, msd_frame = 0; state < HTS_SStreamSet_get_total_state(sss); state++) { for (j = 0; j < HTS_SStreamSet_get_duration(sss, state); j++) { ! if (pst->msd_flag[frame] == TRUE) { /* check current frame is MSD boundary or not */ for (k = 0; k < pst->win_size; k++) { not_bound = TRUE; for (shift = pst->win_l_width[k]; shift <= pst->win_r_width[k]; shift++) ! if ((int) frame + shift < 0 || (int) pss->total_frame <= (int) frame + shift || pst->msd_flag[frame + shift] != TRUE) { not_bound = FALSE; break; Index: HTS_hidden.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API/HTS_hidden.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HTS_hidden.h 14 Dec 2015 05:45:40 -0000 1.5 --- HTS_hidden.h 25 Dec 2015 06:24:07 -0000 1.6 *************** *** 236,245 **** /* HTS_ModelSet_get_parameter: get parameter using interpolation weight */ ! void HTS_ModelSet_get_parameter(HTS_ModelSet * ms, size_t stream_index, size_t state_index, const char *string, const double *iw, double *mean, double *vari, double *msd); void HTS_ModelSet_get_gv_index(HTS_ModelSet * ms, size_t voice_index, size_t stream_index, const char *string, size_t * tree_index, size_t * pdf_index); /* HTS_ModelSet_get_gv: get GV using interpolation weight */ ! void HTS_ModelSet_get_gv(HTS_ModelSet * ms, size_t stream_index, const char *string, const double *iw, double *mean, double *vari); /* HTS_ModelSet_clear: free model set */ --- 236,245 ---- /* HTS_ModelSet_get_parameter: get parameter using interpolation weight */ ! void HTS_ModelSet_get_parameter(HTS_ModelSet * ms, size_t stream_index, size_t state_index, const char *string, const double *const *iw, double *mean, double *vari, double *msd); void HTS_ModelSet_get_gv_index(HTS_ModelSet * ms, size_t voice_index, size_t stream_index, const char *string, size_t * tree_index, size_t * pdf_index); /* HTS_ModelSet_get_gv: get GV using interpolation weight */ ! void HTS_ModelSet_get_gv(HTS_ModelSet * ms, size_t stream_index, const char *string, const double *const *iw, double *mean, double *vari); /* HTS_ModelSet_clear: free model set */ Index: HTS_sstream.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API/HTS_sstream.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HTS_sstream.c 14 Dec 2015 05:45:40 -0000 1.6 --- HTS_sstream.c 25 Dec 2015 06:24:07 -0000 1.7 *************** *** 229,232 **** --- 229,235 ---- size_t next_state; + if (HTS_Label_get_size(label) == 0) + return FALSE; + /* check interpolation weights */ for (i = 0, temp = 0.0; i < HTS_ModelSet_get_nvoices(ms); i++) *************** *** 242,262 **** for (i = 0; i < HTS_ModelSet_get_nstream(ms); i++) { for (j = 0, temp = 0.0; j < HTS_ModelSet_get_nvoices(ms); j++) ! temp += parameter_iw[i][j]; if (temp == 0.0) { return FALSE; } else if (temp != 1.0) { for (j = 0; j < HTS_ModelSet_get_nvoices(ms); j++) ! if (parameter_iw[i][j] != 0.0) ! parameter_iw[i][j] /= temp; } if (HTS_ModelSet_use_gv(ms, i)) { for (j = 0, temp = 0.0; j < HTS_ModelSet_get_nvoices(ms); j++) ! temp += gv_iw[i][j]; if (temp == 0.0) return FALSE; else if (temp != 1.0) for (j = 0; j < HTS_ModelSet_get_nvoices(ms); j++) ! if (gv_iw[i][j] != 0.0) ! gv_iw[i][j] /= temp; } } --- 245,265 ---- for (i = 0; i < HTS_ModelSet_get_nstream(ms); i++) { for (j = 0, temp = 0.0; j < HTS_ModelSet_get_nvoices(ms); j++) ! temp += parameter_iw[j][i]; if (temp == 0.0) { return FALSE; } else if (temp != 1.0) { for (j = 0; j < HTS_ModelSet_get_nvoices(ms); j++) ! if (parameter_iw[j][i] != 0.0) ! parameter_iw[j][i] /= temp; } if (HTS_ModelSet_use_gv(ms, i)) { for (j = 0, temp = 0.0; j < HTS_ModelSet_get_nvoices(ms); j++) ! temp += gv_iw[j][i]; if (temp == 0.0) return FALSE; else if (temp != 1.0) for (j = 0; j < HTS_ModelSet_get_nvoices(ms); j++) ! if (gv_iw[j][i] != 0.0) ! gv_iw[j][i] /= temp; } } *************** *** 335,341 **** sst = &sss->sstream[k]; if (sst->msd) ! HTS_ModelSet_get_parameter(ms, k, j, HTS_Label_get_string(label, i), parameter_iw[k], sst->mean[state], sst->vari[state], &sst->msd[state]); else ! HTS_ModelSet_get_parameter(ms, k, j, HTS_Label_get_string(label, i), parameter_iw[k], sst->mean[state], sst->vari[state], NULL); } state++; --- 338,344 ---- sst = &sss->sstream[k]; if (sst->msd) ! HTS_ModelSet_get_parameter(ms, k, j, HTS_Label_get_string(label, i), (const double *const *) parameter_iw, sst->mean[state], sst->vari[state], &sst->msd[state]); else ! HTS_ModelSet_get_parameter(ms, k, j, HTS_Label_get_string(label, i), (const double *const *) parameter_iw, sst->mean[state], sst->vari[state], NULL); } state++; *************** *** 370,374 **** sst->gv_mean = (double *) HTS_calloc(sst->vector_length, sizeof(double)); sst->gv_vari = (double *) HTS_calloc(sst->vector_length, sizeof(double)); ! HTS_ModelSet_get_gv(ms, i, HTS_Label_get_string(label, 0), gv_iw[i], sst->gv_mean, sst->gv_vari); } else { sst->gv_mean = NULL; --- 373,377 ---- sst->gv_mean = (double *) HTS_calloc(sst->vector_length, sizeof(double)); sst->gv_vari = (double *) HTS_calloc(sst->vector_length, sizeof(double)); ! HTS_ModelSet_get_gv(ms, i, HTS_Label_get_string(label, 0), (const double *const *) gv_iw, sst->gv_mean, sst->gv_vari); } else { sst->gv_mean = NULL; Index: COPYING =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/vc/hts_engine_API/COPYING,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** COPYING 11 Dec 2014 08:27:57 -0000 1.3 --- COPYING 25 Dec 2015 06:24:07 -0000 1.4 *************** *** 5,9 **** /* ----------------------------------------------------------------- */ /* */ ! /* Copyright (c) 2001-2014 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ --- 5,9 ---- /* ----------------------------------------------------------------- */ /* */ ! /* Copyright (c) 2001-2015 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ |