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

📄 fake_decoder.h

📁 Intel开发的IPP库的应用实例
💻 H
字号:
/*
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a 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.
//
//     Intel(R) Integrated Performance Primitives Gaussian Mixture Sample for Windows*
//
//  By downloading and installing this sample, you hereby agree that the
//  accompanying Materials are being provided to you under the terms and
//  conditions of the End User License Agreement for the Intel(R) Integrated
//  Performance Primitives product previously accepted by you. Please refer
//  to the file ippEULA.rtf located in the root directory of your Intel(R) IPP
//  product installation for more information.
//
//
//     Decoder Imitation Class
//
//     Processes fixed number of states per frame (in average)
//     States are taken randomly according to state weights
//     State activity time is uniformly distributed in [1,max_live]
//     Calls probability calculation function (state) for current frame
//     Collects statistisc on active state number and state actility
//     interval length
//
//     state_num    states (mixtures) number
//     avr_active   average active states number per frame
//     max_live     maximal activity time of state
//     frame_num    sentence length (frames)
//
*/

#ifndef aaaFAKE_DEC_Haaa
#define aaaFAKE_DEC_Haaa

#include <stdio.h>
#include <stdlib.h>
#include "len_stat.h"

class Prob_Cache;

class Fake_Decoder {

   protected:

      int state_number;        // states (mixtures) number
      int avr_active;          // average active states number per frame
      int max_live;            // maximal activity time of state
      int frame_num;           // sentence length (frames)
      int live_len;            // max length of activity for statistics
      int t;                   // frame number

      Prob_Cache *cache;
      FILE       *flog;

      int all_prob;            // overall calls for unique probabilities
      int rept_prob;           // repeated calls for probabilities

      float  *state_weight;    //  state weight (sum is 1)            [state]
      double *sum_inact;       //  inactive state weights sum         [frame]
      double *sumsq_inact;     //  inactive state weight squares sum  [frame]
      int    *last_act;        //  last active frame number           [state]
      int    *act_num;         //  active states number               [frame]

      unsigned char *if_calc;  //  used probability indicators        [state]
      int    *live_stat;       //  live interval statistics           [frame]
      int    *last_len;        //  length of live interval            [state]
      int     shift;           //
      double  sum;
      double  sumsq;

      int *wait_stat;          //  waiting states
      int waiting;             //  wait index
      int     ready;           //

   public:

      virtual int   Use_Probability(int state, float *prob);
      virtual int   Get_Probability(int state, float *prob);
      virtual int   Get_ProbabilityAdd(int state, float *prob);
      virtual int   Get_ProbabilityQueue(int state, float *prob);
      virtual int   Activity_Interval(int max_len);
      virtual bool  Ready(void) {return ready==0;}

      bool  Decode_Frame(int act_num);
      void  Get_Statistics(Len_Stat *stat);
      bool  Attach_Cache(Prob_Cache *cache);

      int   Init_LogFile(char *prob_log);
      int   Init_Decoder(void);
      void  Close_Decoder(void);

      Fake_Decoder(int state_number, int max_live);
      virtual ~Fake_Decoder(void);
};

#endif

⌨️ 快捷键说明

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