-
Notifications
You must be signed in to change notification settings - Fork 2
/
dst_decoder.c
138 lines (115 loc) · 4.91 KB
/
dst_decoder.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/***********************************************************************
MPEG-4 Audio RM Module
Lossless coding of 1-bit oversampled audio - DST (Direct Stream Transfer)
This software was originally developed by:
* Aad Rijnberg
Philips Digital Systems Laboratories Eindhoven
* Fons Bruekers
Philips Research Laboratories Eindhoven
* Eric Knapen
Philips Digital Systems Laboratories Eindhoven
And edited by:
* Richard Theelen
Philips Digital Systems Laboratories Eindhoven
* Maxim Anisiutkin
ICT Group
in the course of development of the MPEG-4 Audio standard ISO-14496-1, 2 and 3.
This software module is an implementation of a part of one or more MPEG-4 Audio
tools as specified by the MPEG-4 Audio standard. ISO/IEC gives users of the
MPEG-4 Audio standards free licence to this software module or modifications
thereof for use in hardware or software products claiming conformance to the
MPEG-4 Audio standards. Those intending to use this software module in hardware
or software products are advised that this use may infringe existing patents.
The original developers of this software of this module and their company,
the subsequent editors and their companies, and ISO/EIC have no liability for
use of this software module or modifications thereof in an implementation.
Copyright is not released for non MPEG-4 Audio conforming products. The
original developer retains full right to use this code for his/her own purpose,
assign or donate the code to a third party and to inhibit third party from
using the code for non MPEG-4 Audio conforming products. This copyright notice
must be included in all copies of derivative works.
Copyright 2004.
Source file: DSTDecoder.c (Initialize decoder environment)
Required libraries: <none>
Authors:
RT: Richard Theelen, PDSL-labs Eindhoven <[email protected]>
MA: Maxim Anisiutkin, ICT Group <[email protected]>
Changes:
08-Mar-2004 RT Initial version
26-Jun-2011 MA Possibility to instantinate more than one decoder
************************************************************************/
/*============================================================================*/
/* INCLUDES */
/*============================================================================*/
#include "dst_fram.h"
#include "dst_init.h"
#include "dst_decoder.h"
/*============================================================================*/
/* GLOBAL FUNCTION IMPLEMENTATIONS */
/*============================================================================*/
/*************************GLOBAL FUNCTION**************************************
*
* Name : Init
* Description : Initialises the encoder component.
* Input : NrOfChannels: 2,5,6
* Output :
* Pre-condition :
* Post-condition :
* Returns: :
* Global parameter usage :
*
*****************************************************************************/
int Init(ebunch *D, int NrChannels, int Fs44)
{
D->FrameHdr.NrOfChannels = NrChannels;
D->FrameHdr.FrameNr = 0;
D->StrFilter.TableType = FILTER;
D->StrPtable.TableType = PTABLE;
/* 64FS => 4704 */
/* 128FS => 9408 */
/* 256FS => 18816 */
D->FrameHdr.MaxFrameLen = (588 * Fs44 / 8);
D->FrameHdr.ByteStreamLen = D->FrameHdr.MaxFrameLen * D->FrameHdr.NrOfChannels;
D->FrameHdr.BitStreamLen = D->FrameHdr.ByteStreamLen * RESOL;
D->FrameHdr.NrOfBitsPerCh = D->FrameHdr.MaxFrameLen * RESOL;
D->FrameHdr.MaxNrOfFilters = 2 * D->FrameHdr.NrOfChannels;
D->FrameHdr.MaxNrOfPtables = 2 * D->FrameHdr.NrOfChannels;
return DST_InitDecoder(D);
}
/*************************GLOBAL FUNCTION**************************************
*
* Name : Close
* Description :
* Input :
* Output :
* Pre-condition :
* Post-condition :
* Returns: :
* Global parameter usage :
*
*****************************************************************************/
int Close(ebunch *D)
{
return DST_CloseDecoder(D);
}
/*************************GLOBAL FUNCTION**************************************
*
* Name : Decode
* Description :
* Input :
* Output :
* Pre-condition :
* Post-condition :
* Returns: :
* Global parameter usage :
*
*****************************************************************************/
int Decode(ebunch *D, uint8_t *DSTFrame, uint8_t *DSDMuxedChannelData, int FrameCnt, uint32_t *FrameSize)
{
return DST_FramDSTDecode(DSTFrame, DSDMuxedChannelData, *FrameSize, FrameCnt, D);
}