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

📄 umc_sound3d_filter.h

📁 audio-video-codecs.rar语音编解码器
💻 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) 2005-2006 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __UMC_SOUND3D_FILTER_H__
#define __UMC_SOUND3D_FILTER_H__

//#include "umc_structures.h"
#include "umc_base_codec.h"
#include "base_hrtf_parser.h"
#include "ipps.h"

namespace UMC {
  typedef enum {
    CHANGE_ONLY_HRTF = 1,
    CHANGE_ONLY_CTC  = 100,
    CHANGE_ALL       = 1000,
    ONLY_CTC_ON      = 11,
    ONLY_CTC_OFF     = 10
  } eTypeS3D_Params;

// function is defined by user for create invert filter
  typedef Ipp32s (*pFUNC_INVERT_FILTER) (Ipp32f *Denumerator, Ipp32s lenDen, Ipp32s Delay,
                                         Ipp32f *InvFilter, Ipp32s LenInvFilter);
  class Sound3dFilterParams:private BaseCodecParams {

    DYNAMIC_CAST_DECL_BASE(Sound3dFilterParams)

  public:
/*
 * common
 */
    Ipp32u MaxSamples;
    Ipp32u FreqSamples;
/*
 * HRTF-sphere
 */
    Ipp32s  Azimuth;    // Degree [-90; 90]
    Ipp32s  Elevation;  // Degree [-90; 270]
    Ipp32s  LenFilter;
    base_hrtf_parser *user_hrtf;
/*
 * cross-talk cancellation
 */
    Ipp32s  flag_ctc;
    Ipp32s  pos_speakers;
    Ipp32s  Delay;
    Ipp32s  LenInvFilter;
    pFUNC_INVERT_FILTER InvertFilter;
    eTypeS3D_Params type_set_param;
  };

  class Sound3dFilter:public BaseCodec {

    DYNAMIC_CAST_DECL_BASE(Sound3dFilter)

  public:

    Sound3dFilter(void);
    ~Sound3dFilter(void);

    Status  Init(BaseCodecParams * params);

    Status  GetFrame(MediaData * in_data, MediaData * out_data);

    Status  Close();

    Status  Reset();

    Status  GetInfo(BaseCodecParams * info);

    Status  SetParams(BaseCodecParams * params);

  protected:

    Sound3dFilterParams * s3d_params;

    IppsFIRState_32f *state_left;
    IppsFIRState_32f *state_right;
    IppsFIRState_32f *state_inv_filter_sum;
    IppsFIRState_32f *state_inv_filter_sub;

    Ipp32f *hrir_left;
    Ipp32f *hrir_right;
    Ipp32f *out_data_32f;
    Ipp16s *out_data_16s;

    Ipp32f *buff_in1;
    Ipp32f *buff_in2;
    Ipp32f *buff_out1;
    Ipp32f *buff_out2;

    Status  ScaleSignal_Linf(Ipp32f *pSrc, Ipp32s N, Ipp32f MAX);
    Status  FilterSpeakers(Ipp32f *ch1, Ipp32f *ch2, Ipp32s Len, Ipp32f *out_ch1,
                           Ipp32f *out_ch2);
  };

  Ipp32s  LMSInvertFilter(Ipp32f *Denumerator, Ipp32s lenDen, Ipp32s Delay,
                          Ipp32f *InvFilter, Ipp32s LenInvFilter);
  Ipp32s  FFTInvertFilter(Ipp32f *Denumerator, Ipp32s lenDen, Ipp32s Delay,
                          Ipp32f *InvFilter, Ipp32s LenInvFilter);
}

#endif

⌨️ 快捷键说明

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