• 大小: 34KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-09-26
  • 语言: C/C++
  • 标签: mp3  c  

资源简介

浮点c语言的mp3解码程序,总共包含5个.c文件和3个.h文件

资源截图

代码片段和文件信息

#include “mp3dec.h“

/* An Inverse Modified Discrete Cosinus Transform is applied to 18 values
   at a time. The 18 frequency values generate 36 time domain values 
   where half of these are overlapped with half of the previously generated
   values to produce 18 output values. These can later be fed into the
   subband synthesis.

   The multiply-add loop here is very time critical. It uses a total of
   684*32=21888 MAC operations per imdct 4 times per frame. With 38
   frames per second thats 3.33 million MAC‘s.

   Using some small trigonometric tricks we can do this in 360*32*4*38=
   1.75 million MAC‘s per second instead.

*/

extern mpfloat Granule_imdct_previous[2][576];  /* used for overlapping */
extern mpfloat Granule_9x9_idct[72];
extern mpfloat Granule_imdct_win[4][36];

mpfloat Granule_twiddles_short[23] = {
    0.866025403f 0.5f
    1.931851653f 0.707106781f 0.517638090f

    0.504314480f 0.541196100f 0.630236207f
    0.821339815f 1.306562965f 3.830648788f
    0.793353340f 0.608761429f 0.923879532f
    0.382683432f 0.991444861f 0.130526192f 
    0.382683432f 0.608761429f 0.793353340f
    0.923879532f 0.991444861f 0.130526192f
};

mpfloat Granule_twiddles_normal[] = {
    5.736856623f 1.931851653f 1.183100792f
    0.871723397f 0.707106781f 0.610387294f 
    0.551688959f 0.517638090f 0.501909918f

    -0.500476342f -0.504314480f -0.512139757f
    -0.524264562f -0.541196100f -0.563690973f 
    -0.592844523f -0.630236207f -0.678170852f 
    -0.740093616f -0.821339815f -0.930579498f
    -1.082840285f -1.306562965f -1.662754762f 
    -2.310113158f -3.830648788f -11.46279281f
};

void
Granule_imdct(Granule *gr int ch Granule_floatfreqs X)
{
    int sb i j k l window;
    mpfloat save sum sum2 pp1;
    mpfloat s;
    mpfloat x[36] t[18];
    mpfloat *v *prev *z *twid;

    prev = Granule_imdct_previous[ch];

    /* process each subband */

    for(sb = 0; sb < NUM_SUBBANDS; sb++) {

for(i = 0; i < 36; i++)
    x[i] = (mpfloat)0.0f;

/* decode the block_type - it‘s in block_type but we have to think
   about the mixed blocks lower 2 subbands */

if(gr->block_type == BLOCKTYPE_3WIN &&
   !(gr->window_switching_flag && 
     gr->mixed_block_flag && sb < 2)) {

    /* process the 3 windows separately each window has 12 values */

    for(window = 0; window < 3; window++) {

#ifdef LEE_IMDCT
/* 30*3=90 adds 25*3=75 muls */

X[15+window] += X[12+window];
X[12+window] += X[9+window];
X[9+window] += X[6+window];
X[6+window] += X[3+window];
X[3+window] += X[window];

X[15+window] += X[9+window];
X[9+window] += X[3+window];

twid = Granule_twiddles_short;

/* do a 3x3 IDCT on the even part */

pp1 = X[6+window] * twid[0];
sum = X[window] + X[12+window] * twid[1];
t[1] = X[window] - X[12+window];
t[0] = sum + pp1;
t[2] = sum - pp1;

/* 3x3 IDCT

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8953  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\fastimdct.c

     文件       5475  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\FASTSB.C

     文件       9515  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\HUFF.C

     文件      19029  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\HUFFMAN.H

     文件      56613  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\MP3DEC.C

     文件      12117  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\MP3DEC.H

     文件       6053  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\MP3DEC_D.H

     文件       1364  1999-03-22 16:20  用DSP进行mp3解压缩的算法原程序\windowing.c

     目录          0  2007-08-26 21:54  用DSP进行mp3解压缩的算法原程序

----------- ---------  ---------- -----  ----

               119119                    9


评论

共有 条评论