⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gauss_example_32f_2threads.txt

📁 Intel开发的IPP库的应用实例
💻 TXT
📖 第 1 页 / 共 2 页
字号:
//
//                        INTEL CORPORATION PROPRIETARY INFORMATION
//        This software is supplied under the terms of the license agreement
//        or nondisclosure agreement with Intel Corporation and may not be copied
//        or disclosed except in accordance with the terms of that agreement.
//            Copyright (c) 1999-2006 Intel Corporation. All Rights Reserved.
//
//




        Simple program to illustrate vector Gaussian mixture calculation
        Float mean, variance, features and probabilities


        Fake_Decoder class

Imitates time-synchronous tree decoder requests for state probabilities. Active
states and the length of state activity interval are chosen randomly. Required
active states number is defined for each frame. State activity interval length is
uniformly distributed in [1,max_live]. Probability of the active state is requested
for the current frame once per frame only. Real tree decoder could request the same
probability several times per frame and could request probabilities for some
following frames if acoustic look-ahead is used. If cache contain probability of
the active state that it will be returned to the decoder. Otherwise active state
will be added to the queue of states for probability calculation and will be requested
at the end of frame

For parallel thread of calculating of probability accelerations are:

    for 2 x PIII 500
in case avrmix 1500 for HMM_39 and 1000 for HMM_36 without output to the logfile
23.2% and 14.0% correspondingly.
in case avrmix 1500 for HMM_39 and 1000 for HMM_36 with output to the logfile
13.7% and 5.0% correspondingly.
in case avrmix 3000 for HMM_39 and 2000 for HMM_36 without output to the logfile
34.7% and 28.8% correspondingly.
in case avrmix 3000 for HMM_39 and 2000 for HMM_36 with output to the logfile
21.0% and 18.4% correspondingly.

Fake_Decoder(int state_number, int max_live)
                                     - constructor
~Fake_Decoder(void)                  - destructor
int Init_Decoder(void)               - internal structures initialization
                                       >= 0 if OK, otherwise failed
bool Attach_Cache(Prob_Cache *cache) - attach ready-to-use probability cache
                                       cache state number should not be less
                                       than decoder state number
                                       true if OK, otherwise failed
int Init_LogFile(char *prob_log)     - opens log file for probabilities
                                       each probability used by decoder
                                       is written to this file as float value
                                       file is closed in desctuctor                                      cache
                                       this feature is useful to compare
                                       different modes of probability calculation
                                       >= 0 if OK, otherwise failed

After successful constructor, Init_Decoder and Attach_Cache calls decoder is ready

bool Ready(void)                     - true if decoder is ready, false otherwise
bool Decode_Frame(int act_num)       - process frame with act_num active states
                                       real number of active states could differ
                                       from requested (eg if it was more for
                                       previous frame and no activity intervals
                                       is finished)
                                       true if the frame is not last one
void Close_Decoder(void)             - stop decoder and fix statistics
void Get_Statistics(Len_Stat *stat)  - extract statistics data: all requests,
                                       repeated requests (0 now), number of
                                       state activity intervals of length [1,256]

int Get_Probability(int state, float *prob) -
                                       request for state probability for current
                                       frame passed to cache and statistics collected
                                       if probability is accessible 0 is returned and
                                       it is written to prob[0]
                                       if probability is not accessible 1 is returned

int Get_ProbabilityAdd(int state, float *prob) -
                                       this function is similar to Get_Probability.
                                       The difference is: if there is not probability
                                       in cache function add state to queue and return -1
                                       otherwise it request probability for current state
                                       from cache and return 1.

int Get_ProbabilityQueue(int state, float *prob) -
                                       this function request probability for state from
                                       queue and always return 1.

int Use_Probability(int state, float *prob) -
                                       use of calculated probability (imitation of
                                       calculated probability use in decoder)
                                       0 is returned

int Activity_Interval(int max_len)   - random length of state activity interval




        Prob_Cache class

Simplified SDT probability cache class. Supplies probabilities for the current frame.
If the value is not in cache up to vec_length values are requested from probability
calculator. Cache has size state_number*vec_length and crawls forward one element per
frame. After frame_num frames it is moved to the beginning.

Prob_Cache(int state_number, int vec_length, int frame_num)
                                     - constructor
~Prob_Cache(void)                    - destructor
int Init_Cache(void)                 - internal structures initialization
                                       >= 0 if OK, otherwise failed
bool Attach_Calc(Prob_Calc *calc)    - attach ready-to-use probability calculator
                                       cache state number should not be less
                                       than calculator state number
                                       true if OK, otherwise failed

After successful constructor, Init_Cache and Attach_Calc calls cache is ready

bool Ready(void)                     - true if cache is ready, false otherwise
bool Step_Forward(void)              - step to the next frame, values for the
                                       previous frame are lost
                                       true if the next frame exists
void Detach_Calc(void)               - detach probability calculator
                                       after successful Attach_Calc cache could
                                       work with other calculator
void Get_Statistics(Len_Stat *stat)  - extract statistics data: unused values,
                                       calculated vectors of length [1,vec_length]

float Get_Probability(int state, float *prob)
                                     - request for state probability for current frame

float Get_ProbabilityAdd(int state, float *prob)
                                     - request for state probability for current frame
                                       if this probability exist, otherwise add state to
                                       the queue

float Get_ProbabilityQueue(int state, float *prob)
                                     - request for state probability for current frame

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -