📄 decode.c
字号:
/**********************************************************************
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Decoder - Lower Sampling Frequency Extension
*
* $Header: /MP3Stego/MP3Stego Decoder/decode.c 5 30/10/98 11:24 Fapp2 $
*
* $Id: decode.c,v 1.2 1996/03/28 03:13:37 rowlands Exp $
*
* $Log: /MP3Stego/MP3Stego Decoder/decode.c $
*
* 5 30/10/98 11:24 Fapp2
*
* 4 15/08/98 10:40 Fapp2
* Started revision control on this file.
* Revision 1.2 1996/03/28 03:13:37 rowlands
* Merged layers 1-2 and layer 3 revisions
*
* Revision 1.1 1996/02/14 03:45:52 rowlands
* Initial revision
*
* Received from FhG
**********************************************************************/
/**********************************************************************
* date programmers comment *
* 2/25/91 Douglas Wong, start of version 1.0 records *
* Davis Pan *
* 3/06/91 Douglas Wong rename: setup.h to dedef.h *
* dfilter to defilter *
* dwindow to dewindow *
* integrated "quantizer", "scalefactor" *
* combined window_samples routine into *
* filter samples *
* 3/31/91 Bill Aspromonte replaced read_filter by *
* create_syn_filter and introduced a *
* new Sub-Band Synthesis routine called *
* SubBandSynthesis() *
* 5/10/91 Vish (PRISM) Ported to Macintosh and Unix. *
* Changed "out_fifo()" so that last *
* unfilled block is also written out. *
* "create_syn_filter()" was modified so *
* that calculation precision is same as *
* in specification tables. *
* Changed "decode_scale()" to reflect *
* specifications. *
* Removed all routines used by *
* "synchronize_buffer()". This is now *
* replaced by "seek_sync()". *
* Incorporated Jean-Georges Fritsch's *
* "bitstream.c" package. *
* Deleted "reconstruct_sample()". *
* 27jun91 dpwe (Aware) Passed outFile and &sampFrames as *
* args to out_fifo() - were global. *
* Moved "alloc_*" reader to common.c. *
* alloc, sblimit, stereo passed via new *
* 'frame_params struct (were globals). *
* Added JOINT STEREO decoding, lyrs I&II*
* Affects: decode_bitalloc,buffer_samps *
* Plus a few other cleanups. *
* 6/10/91 Earle Jennings conditional expansion added in *
* II_dequantize_sample to handle range *
* problems in MSDOS version *
* 8/8/91 Jens Spille Change for MS-C6.00 *
*10/1/91 S.I. Sudharsanan, Ported to IBM AIX platform. *
* Don H. Lee, *
* Peter W. Farrett *
*10/3/91 Don H. Lee implemented CRC-16 error protection *
* newly introduced functions are *
* buffer_CRC and recover_CRC_error. *
* 2/11/92 W. Joseph Carter Ported new code to Macintosh. Most *
* important fixes involved changing *
* 16-bit ints to long or unsigned in *
* bit alloc routines for quant of 65535 *
* and passing proper function args. *
* Removed "Other Joint Stereo" option *
* and made bitrate be total channel *
* bitrate, irrespective of the mode. *
* Fixed many small bugs & reorganized. *
* 7/27/92 Juan Pineda Bug fix in SubBandSynthesis() *
*--------------------------------------------------------------------*
* 6/14/92 Juan Pineda Layer III decoding routines added. *
* Amit Gulati Follows CD 3-11172 rev2. Contains *
* hacks deal with evolving available *
* layerIII bitstreams. Some (minor) *
* modification of prior LI&II code. *
* 10/25/92 Amit Gulati Updated layerIII routines. Added code *
* for subblock_gain, switched block *
* modes, stereo pre-processing. *
* Corrected sign bits for huffman *
* decoding of quadruples region and *
* adjusted gain factor in III_dequant. *
* 11/21/92 Amit Gulati Several layerIII bugs fixed. *
* 12/15/92 Amit Gulati Corrected reordering (indexing) *
* Stan Searing within IMDCT routine. *
* 8/24/93 Masahiro Iwadare Included IS modification in Layer III.*
* Changed for 1 pass decoding. *
* 9/07/93 Toshiyuki Ishino Integrated Layer III with Ver 3.9. *
*--------------------------------------------------------------------*
* 11/20/93 Masahiro Iwadare Integrated Layer III with Ver 4.0. *
*--------------------------------------------------------------------*
* 7/14/94 Juergen Koller Bug fixes in Layer III code *
*--------------------------------------------------------------------*
* 08/11/94 IIS Bug fixes in Layer III code *
*--------------------------------------------------------------------*
* 9/20/94 Davis Pan Modification to avoid premature *
* synchword detection *
*--------------------------------------------------------------------*
* 11/09/94 Jon Rowlands Merged premature synchword detection *
* fix into layer III code version *
*--------------------------------------------------------------------*
* 07/12/95 Soeren H. Nielsen Changes for LSF Layer I and II *
*--------------------------------------------------------------------*
* 8/95 Roland Bitto Adapted to MPEG2 *
* 9/8/95 Roalnd Bitto Bugfix in Function III_stereo *
*--------------------------------------------------------------------*
* Aug 98 Fabien Petitcolas Add stego stuff *
**********************************************************************/
#include "common.h"
#include "decoder.h"
#include "huffman.h"
#include "../stegolib/stego.h"
/***************************************************************
/*
/* This module contains the core of the decoder ie all the
/* computational routines. (Layer I and II only)
/* Functions are common to both layer unless
/* otherwise specified.
/*
/***************************************************************/
/*****************************************************************
/*
/* The following routines decode the system information
/*
/****************************************************************/
/************ Layer I, Layer II & Layer III ******************/
//=======================================================
// Function name: decode_info
// Author:
// Date: 2002/3/16
// Description: decode the Frame information
// Input: *bs --- point to Bit_stream_struc
// *fr_ps --- point frame_params
// Return value:
// Notes:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -