// file: $isip/class/search/StackSearch/ssrch_16.cc // version: $Id: ssrch_16.cc 9296 2003-08-23 20:27:52Z parihar $ // // isip include files // #include "StackSearch.h" // method: decode // // arguments: // Vector& vector_fe: (input) front-ends providing data // int32 num_frames: (input) number of frames to decode // // return: logical error status // // this is the decoding wrapper method for the front-end input // bool8 StackSearch::decode(Vector& vector_fe_a, int32 num_frames_a) { int32 num_frames_available = vector_fe_a(vector_fe_a.length() - 1).getNumFrames(); // set the number of frames // if (num_frames_a == ALL_FRAMES) { // decode all available data // num_frames_d = num_frames_available; } else { // decode only specified number of frames // if (num_frames_a > num_frames_available) { // output warning // return Error::handle(name(), L"decode - number of frames to decode exceeds the number of features available from front end", Error::ARG, __FILE__, __LINE__, Error::WARNING); } else { num_frames_d = num_frames_a; } } // initialize required number of features // features_d.setLength(num_frames_d); for (int32 curr_frame = 0; curr_frame < num_frames_d; curr_frame++) { // assign features from the front end // // loop over the frontends // for (int32 i = 0; i < vector_fe_a.length(); i++) { vector_fe_a(i).getVector(features_d(curr_frame), 0, curr_frame); } } // call the core decoding method common for both feature and front // end input data // decode(); // exit gracefully // return true; } // method: decode // // arguments: // Vector& data: (input) feature data // int32 num_frames: (input) number of frames to decode // // return: logical error status // // this is the decoding wrapper method for the features input // bool8 StackSearch::decode(Vector& data_a, int32 num_frames_a) { int32 num_frames_available = data_a.length(); // set the number of frames // if (num_frames_a == ALL_FRAMES) { // decode all available data // num_frames_d = num_frames_available; } else { // decode only specified number of frames // if (num_frames_a > num_frames_available) { // output warning // return Error::handle(name(), L"decode - number of frames to decode exceeds the number of features available from the input feature vector", Error::ARG, __FILE__, __LINE__, Error::WARNING); } else { num_frames_d = num_frames_a; } } // initialize required number of features // features_d.setLength(num_frames_d); for (int32 curr_frame = 0; curr_frame < num_frames_d; curr_frame++) { // assign features from the input feature vector // features_d(curr_frame) = data_a(curr_frame); } // call the core decoding method common for both feature and front // end input data // decode(); // exit gracefully // return true; }