00001 #pragma once 00002 00003 #ifdef WIN32 00004 #if defined _USRDLL 00005 #define DllExport _declspec(dllexport) 00006 #else 00007 #define DllExport _declspec(dllimport) 00008 #endif 00009 #endif 00010 00011 #include "HLabHMM.h" 00012 #include "HLabFeat.h" 00013 #include "HLabConst.h" 00014 #include "HLabVector.h" 00015 00016 00033 class DllExport CHLabViterbiAlignment 00034 { 00040 float*** m_pppfLikelihoodTable; 00041 vector2d<float> m_vec2d_likelihoodTable; 00042 vector2d<float> m_vec2d_likelihoodTableTemp; 00043 00051 vector3d<float> m_vec3d_backtrackTable; 00052 int m_iNumHMMs; 00053 int m_iFeatLen; 00054 CHLabHMM* m_pHMM; 00055 CHLabFeat* m_pFeat; 00056 int m_iDim; 00057 int m_iMaxNumStates; 00058 00059 int** m_ppiStateBoundary; 00060 vector2d<int> m_vec2d_stateStartBounday; 00061 vector2d<int> m_vec2d_stateEndBoundary; 00062 float m_fTH; 00063 00064 float GaussianPDF(int iTestFrameIndex, 00065 int iHMMIndex, 00066 int iStateIndex); 00067 00068 public: 00069 CHLabViterbiAlignment(void); 00070 virtual ~CHLabViterbiAlignment(void); 00071 00080 int Init(CHLabHMM* pHMM, 00081 int iNumHMM, 00082 CHLabFeat* pFeat, 00083 float fTH = -HLab_INFINITY); 00084 00092 int Run(float* pLikelihood); 00093 00094 00095 00103 inline vector2d<int>& GetStateStartBoundary(void) 00104 { 00105 return (m_vec2d_stateStartBounday); 00106 } 00107 00115 inline vector2d<int>& GetStateEndBoundary(void) 00116 { 00117 return (m_vec2d_stateEndBoundary); 00118 } 00119 };