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

📄 mp3dec_subband_fp.c

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 C
字号:
/*//////////////////////////////////////////////////////////////////////////////////                  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) 2003-2005 Intel Corporation. All Rights Reserved.//*/#include "mp3dec_own_fp.h"/*//  Functions in this file.////  int mp3dec_SubBandSynth(MP3Dec* DC, int ch, int num)*//******************************************************************************//  Name://    mp3dec_SubBandSynth////  Description://    Implementation of filterbank in the decoder that reconstructs a PCM audio//    signal from subband samples.////  Input Arguments://    DC - point to sDecoderContext structure//    gr - number of granule//    ch - number of channel////  Output Arguments://    smpl_rw[ch] - reconstracted samples////  Returns://    1 - all ok//******************************************************************************/int mp3dec_SubBandSynth(MP3Dec *state, int ch, int num){    int     i, odd, odd_idx, k, idx, even_idx, evn;    float  *wnd_ptr_odd, *wnd_ptr_even;    float  *flt_ptr_even, *flt_ptr_odd;    float  *out = (*state->smpl_sb)[ch];    float  *samples = (float *)(*state->smpl_rw)[ch];    float  (*filter_bfr)[16][64] = state->filter_bfr;    short   *m_even = state->m_even;    short (*m_ptr)[2] = state->m_ptr;    float *tmp_bfr = state->tmp_bfr;    for (k = 0; k < num; k++) {        m_even[ch] = (++m_even[ch] & 0x1);        m_ptr[ch][m_even[ch]] = (m_ptr[ch][m_even[ch]] + 7) & 0x7;        ippsDCTFwd_32f(samples, tmp_bfr, state->pDCTSpecFB, state->mdct_buffer);        ippsMulC_32f_I(4, tmp_bfr, 32);        tmp_bfr[0] *= 1.41421356f;        idx = m_even[ch] * 8 + m_ptr[ch][m_even[ch]];        for (i = 0; i < 16; i++) {            filter_bfr[ch][idx][i] = tmp_bfr[i + 16];        }        filter_bfr[ch][idx][16] = 0;        for (i = 17; i < 48; i++) {            filter_bfr[ch][idx][i] = -tmp_bfr[48 - i];        }        for (i = 48; i < 64; i++) {            filter_bfr[ch][idx][i] = -tmp_bfr[i - 48];        }        // calculate variables        odd = ((m_even[ch] + 1) & 0x1);        odd_idx = odd << 3;        odd = (8 - m_ptr[ch][odd]) & 7;        evn = (8 - m_ptr[ch][m_even[ch]]) & 7;        even_idx = m_even[ch] << 3;        wnd_ptr_even = mp3dec_Dcoef[0] + evn;        wnd_ptr_odd = mp3dec_Dcoef[0] + odd + 15;        flt_ptr_even = &filter_bfr[ch][even_idx][0];        flt_ptr_odd = &filter_bfr[ch][odd_idx][32];        // calculate samples        for (i = 0; i < 32; i++) {            out[i] =                flt_ptr_even[0<<6] * wnd_ptr_even[0] +                flt_ptr_even[1<<6] * wnd_ptr_even[1] +                flt_ptr_even[2<<6] * wnd_ptr_even[2] +                flt_ptr_even[3<<6] * wnd_ptr_even[3] +                flt_ptr_even[4<<6] * wnd_ptr_even[4] +                flt_ptr_even[5<<6] * wnd_ptr_even[5] +                flt_ptr_even[6<<6] * wnd_ptr_even[6] +                flt_ptr_even[7<<6] * wnd_ptr_even[7] +                flt_ptr_odd[0<<6] * wnd_ptr_odd[0] +                flt_ptr_odd[1<<6] * wnd_ptr_odd[1] +                flt_ptr_odd[2<<6] * wnd_ptr_odd[2] +                flt_ptr_odd[3<<6] * wnd_ptr_odd[3] +                flt_ptr_odd[4<<6] * wnd_ptr_odd[4] +                flt_ptr_odd[5<<6] * wnd_ptr_odd[5] +                flt_ptr_odd[6<<6] * wnd_ptr_odd[6] +                flt_ptr_odd[7<<6] * wnd_ptr_odd[7];            flt_ptr_even ++;            flt_ptr_odd ++;            wnd_ptr_even += 30;            wnd_ptr_odd += 30;        }        out += 32;        samples += 32;    }   // for    return 1;}

⌨️ 快捷键说明

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