vitasdk
Documentation of the vitasdk
audiodec.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2_AUDIODEC_H_
8 #define _PSP2_AUDIODEC_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2/types.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef enum SceAudiodecErrorCode {
44 
45 #define SCE_AUDIODEC_ALIGNMENT_SIZE 0x100U
46 #define SCE_AUDIODEC_ROUND_UP(size) ((size + SCE_AUDIODEC_ALIGNMENT_SIZE - 1) & ~(SCE_AUDIODEC_ALIGNMENT_SIZE - 1))
47 
48 #define SCE_AUDIODEC_WORD_LENGTH_16BITS 16
49 
50 typedef enum SceAudiodecType {
54  SCE_AUDIODEC_TYPE_CELP = 0x1006U
56 
57 #define SCE_AUDIODEC_AT9_MAX_CH_IN_LIBRARY 16
58 #define SCE_AUDIODEC_MP3_MAX_STREAMS 8
59 #define SCE_AUDIODEC_AAC_MAX_STREAMS 8
60 #define SCE_AUDIODEC_CELP_MAX_STREAMS 8
61 
62 #define SCE_AUDIODEC_AT9_MAX_CH_IN_DECODER 2
63 #define SCE_AUDIODEC_MP3_MAX_CH_IN_DECODER 2
64 #define SCE_AUDIODEC_AAC_MAX_CH_IN_DECODER 2
65 #define SCE_AUDIODEC_CELP_MAX_CH_IN_DECODER 1
66 
67 #define SCE_AUDIODEC_AT9_MAX_SAMPLES 256
68 #define SCE_AUDIODEC_MP3_MAX_SAMPLES 1152
69 #define SCE_AUDIODEC_AAC_MAX_SAMPLES 2048
70 #define SCE_AUDIODEC_CELP_MAX_SAMPLES 320
71 
72 #define SCE_AUDIODEC_AT9_MAX_ES_SIZE 1024
73 #define SCE_AUDIODEC_MP3_MAX_ES_SIZE 1441
74 #define SCE_AUDIODEC_AAC_MAX_ES_SIZE 1536
75 #define SCE_AUDIODEC_CELP_MAX_ES_SIZE 24
76 
77 #define SCE_AUDIODEC_AT9_EXTRA_ACCESS_SIZE 0
78 #define SCE_AUDIODEC_MP3_EXTRA_ACCESS_SIZE 0
79 #define SCE_AUDIODEC_AAC_EXTRA_ACCESS_SIZE 0
80 #define SCE_AUDIODEC_CELP_EXTRA_ACCESS_SIZE 0
81 
82 #define SCE_AUDIODEC_AT9_MAX_NFRAMES 8
83 #define SCE_AUDIODEC_MP3_MAX_NFRAMES 1
84 #define SCE_AUDIODEC_AAC_MAX_NFRAMES 1
85 #define SCE_AUDIODEC_CELP_MAX_NFRAMES 1
86 
87 #define SCE_AUDIODEC_AT9_MAX_NSTREAMS 6
88 #define SCE_AUDIODEC_MP3_MAX_NSTREAMS 6
89 #define SCE_AUDIODEC_AAC_MAX_NSTREAMS 6
90 #define SCE_AUDIODEC_CELP_MAX_NSTREAMS 7
91 
92 typedef enum SceAudiodecMpegVersion {
98 
99 #define SCE_AUDIODEC_CELP_MPE 0
100 
101 #define SCE_AUDIODEC_CELP_SAMPLING_RATE_8KHZ 8000
102 
115 
121 
122 typedef struct SceAudiodecInitChParam {
127 
128 typedef union SceAudiodecInitParam {
136 
137 typedef struct SceAudiodecInfoAt9 {
147 
148 typedef struct SceAudiodecInfoMp3 {
154 
155 typedef struct SceAudiodecInfoAac {
163 
165 typedef struct SceAudiodecInfoCelp {
173 
174 typedef union SceAudiodecInfo {
182 
183 typedef struct SceAudiodecCtrl {
189  void *pPcm;
196 
206 
210 
211 #ifdef __cplusplus
212 }
213 #endif
214 
215 #endif /* _PSP2_AUDIODEC_H_ */
SceUInt32 size
Definition: audiodec.h:129
SceInt32 sceAudiodecTermLibrary(SceUInt32 codecType)
SceInt32 sceAudiodecCreateDecoder(SceAudiodecCtrl *pCtrl, SceUInt32 codecType)
void * pPcm
pointer to PCM
Definition: audiodec.h:189
SceAudiodecInfoAac aac
Definition: audiodec.h:178
SceUInt32 lostCount
Definition: audiodec.h:170
SceUInt32 samplingRate
Sampling rate.
Definition: audiodec.h:168
SceAudiodecErrorCode
Definition: audiodec.h:17
SceUInt32 size
Definition: audiodec.h:123
SceUInt32 excitationMode
Excitation mode.
Definition: audiodec.h:167
SceUInt8 configData[4]
Definition: audiodec.h:139
SceUInt32 outputPcmSize
size of PCM output actually (in byte)
Definition: audiodec.h:190
SceUInt32 size
Definition: audiodec.h:117
SceUInt32 size
Definition: audiodec.h:175
SceUInt32 ch
number of channels (mono: 1, stereo/joint stereo/two mono: 2)
Definition: audiodec.h:150
SceUInt32 totalStreams
Definition: audiodec.h:118
SceAudiodecInitStreamParam aac
Definition: audiodec.h:132
SceInt32 sceAudiodecDecodeNFrames(SceAudiodecCtrl *pCtrl, SceUInt32 nFrames)
SceInt32 sceAudiodecDecodeNStreams(SceAudiodecCtrl *pCtrls[], SceUInt32 nStreams)
SceUInt32 samplingRate
Definition: audiodec.h:142
SceInt32 sceAudiodecDeleteDecoderExternal(SceAudiodecCtrl *pCtrl, SceUIntVAddr *pvaContext)
SceUInt32 version
MPEG version (MPEG1: 3, MPEG2: 2, MPEG2.5: 0)
Definition: audiodec.h:151
SceInt32 sceAudiodecGetInternalError(SceAudiodecCtrl *pCtrl, SceInt32 *pInternalError)
SceUInt32 bitRate
Definition: audiodec.h:141
SceAudiodecInfoMp3 mp3
Definition: audiodec.h:177
SceUInt32 maxPcmSize
maximum size of PCM output (in byte)
Definition: audiodec.h:191
SceInt32 sceAudiodecDecode(SceAudiodecCtrl *pCtrl)
SceAudiodecInitChParam at9
Definition: audiodec.h:130
SceUInt32 isSbr
Definition: audiodec.h:160
SceInt32 sceAudiodecGetContextSize(SceAudiodecCtrl *pCtrl, SceUInt32 codecType)
SceUInt32 framesInSuperFrame
Definition: audiodec.h:144
SceUInt32 maxEsSize
maximum size of elementary stream used (in byte)
Definition: audiodec.h:188
SceUInt32 bitRate
Bit rate (one of SceAudiodecCelpBitrate)
Definition: audiodec.h:169
VITASDK_BUILD_ASSERT_EQ(8, SceAudiodecInitStreamParam)
SceUInt32 ch
Definition: audiodec.h:140
SceInt32 sceAudiodecClearContext(SceAudiodecCtrl *pCtrl)
SceUInt32 samplingRate
Definition: audiodec.h:159
SceUInt32 inputEsSize
size of elementary stream used actually (in byte)
Definition: audiodec.h:187
SceUInt32 isAdts
Definition: audiodec.h:157
SceUInt32 size
sizeof(SceAudiodecInfoCelp)
Definition: audiodec.h:166
SceUInt32 superFrameSize
Definition: audiodec.h:143
SceAudiodecInfoAt9 at9
Definition: audiodec.h:176
SceInt32 sceAudiodecCreateDecoderExternal(SceAudiodecCtrl *pCtrl, SceUInt32 codecType, SceUIntVAddr vaContext, SceUInt32 contextSize)
SceAudiodecInitStreamParam celp
Definition: audiodec.h:133
SceInt32 sceAudiodecInitLibrary(SceUInt32 codecType, SceAudiodecInitParam *pInitParam)
SceAudiodecMpegVersion
Definition: audiodec.h:92
SceUInt32 ch
Definition: audiodec.h:158
SceUInt32 size
Definition: audiodec.h:184
SceInt32 handle
Definition: audiodec.h:185
SceUInt32 size
Definition: audiodec.h:156
SceUInt32 wordLength
PCM bit depth.
Definition: audiodec.h:192
SceAudiodecInfo * pInfo
pointer to SceAudiodecInfo
Definition: audiodec.h:193
SceAudiodecInfoCelp celp
Definition: audiodec.h:179
SceInt32 sceAudiodecDeleteDecoder(SceAudiodecCtrl *pCtrl)
SceAudiodecCelpBitrate
Definition: audiodec.h:103
SceUInt32 size
Definition: audiodec.h:138
SceUInt32 totalCh
Definition: audiodec.h:124
SceUInt32 size
sizeof(SceAudiodecInfoMp3)
Definition: audiodec.h:149
SceAudiodecType
Definition: audiodec.h:50
SceAudiodecInitStreamParam mp3
Definition: audiodec.h:131
SceUInt8 * pEs
pointer to elementary stream
Definition: audiodec.h:186
@ SCE_AUDIODEC_ERROR_INVALID_TYPE
Definition: audiodec.h:19
@ SCE_AUDIODEC_ERROR_SAME_HANDLES
Definition: audiodec.h:36
@ SCE_AUDIODEC_MP3_ERROR_INVALID_MPEG_VERSION
Definition: audiodec.h:40
@ SCE_AUDIODEC_ERROR_CH_SHORTAGE
Definition: audiodec.h:29
@ SCE_AUDIODEC_ERROR_ALREADY_INITIALIZED
Definition: audiodec.h:21
@ SCE_AUDIODEC_ERROR_A_HANDLE_IN_USE
Definition: audiodec.h:24
@ SCE_AUDIODEC_ERROR_NOT_INITIALIZED
Definition: audiodec.h:23
@ SCE_AUDIODEC_ERROR_INVALID_NFRAMES
Definition: audiodec.h:33
@ SCE_AUDIODEC_CELP_ERROR_INVALID_CONFIG
Definition: audiodec.h:42
@ SCE_AUDIODEC_ERROR_DIFFERENT_TYPES
Definition: audiodec.h:35
@ SCE_AUDIODEC_ERROR_NOT_HANDLE_IN_USE
Definition: audiodec.h:28
@ SCE_AUDIODEC_ERROR_ALL_HANDLES_IN_USE
Definition: audiodec.h:25
@ SCE_AUDIODEC_ERROR_INVALID_NSTREAMS
Definition: audiodec.h:34
@ SCE_AUDIODEC_ERROR_INVALID_WORD_LENGTH
Definition: audiodec.h:30
@ SCE_AUDIODEC_ERROR_UNSUPPORTED
Definition: audiodec.h:32
@ SCE_AUDIODEC_MP3_ERROR_INVALID_CH
Definition: audiodec.h:39
@ SCE_AUDIODEC_ERROR_BUSY
Definition: audiodec.h:37
@ SCE_AUDIODEC_ERROR_INVALID_INIT_PARAM
Definition: audiodec.h:20
@ SCE_AUDIODEC_ERROR_INVALID_SIZE
Definition: audiodec.h:31
@ SCE_AUDIODEC_AAC_ERROR_INVALID_CH
Definition: audiodec.h:41
@ SCE_AUDIODEC_ERROR_API_FAIL
Definition: audiodec.h:18
@ SCE_AUDIODEC_ERROR_INVALID_HANDLE
Definition: audiodec.h:27
@ SCE_AUDIODEC_ERROR_INVALID_PTR
Definition: audiodec.h:26
@ SCE_AUDIODEC_ERROR_OUT_OF_MEMORY
Definition: audiodec.h:22
@ SCE_AUDIODEC_AT9_ERROR_INVALID_CONFIG
Definition: audiodec.h:38
@ SCE_AUDIODEC_MP3_MPEG_VERSION_2
Definition: audiodec.h:95
@ SCE_AUDIODEC_MP3_MPEG_VERSION_2_5
Definition: audiodec.h:93
@ SCE_AUDIODEC_MP3_MPEG_VERSION_1
Definition: audiodec.h:96
@ SCE_AUDIODEC_MP3_MPEG_VERSION_RESERVED
Definition: audiodec.h:94
@ SCE_AUDIODEC_CELP_BIT_RATE_6600BPS
Definition: audiodec.h:107
@ SCE_AUDIODEC_CELP_BIT_RATE_9900BPS
Definition: audiodec.h:110
@ SCE_AUDIODEC_CELP_BIT_RATE_4650BPS
Definition: audiodec.h:105
@ SCE_AUDIODEC_CELP_BIT_RATE_11800BPS
Definition: audiodec.h:112
@ SCE_AUDIODEC_CELP_BIT_RATE_3850BPS
Definition: audiodec.h:104
@ SCE_AUDIODEC_CELP_BIT_RATE_10700BPS
Definition: audiodec.h:111
@ SCE_AUDIODEC_CELP_BIT_RATE_5700BPS
Definition: audiodec.h:106
@ SCE_AUDIODEC_CELP_BIT_RATE_7300BPS
Definition: audiodec.h:108
@ SCE_AUDIODEC_CELP_BIT_RATE_12200BPS
Definition: audiodec.h:113
@ SCE_AUDIODEC_CELP_BIT_RATE_8700BPS
Definition: audiodec.h:109
@ SCE_AUDIODEC_TYPE_MP3
Definition: audiodec.h:52
@ SCE_AUDIODEC_TYPE_AAC
Definition: audiodec.h:53
@ SCE_AUDIODEC_TYPE_CELP
Definition: audiodec.h:54
@ SCE_AUDIODEC_TYPE_AT9
Definition: audiodec.h:51
Definition: audiodec.h:183
Definition: audiodec.h:155
Definition: audiodec.h:137
Information structure for CELP.
Definition: audiodec.h:165
Definition: audiodec.h:148
Definition: audiodec.h:122
Definition: audiodec.h:116
Definition: audiodec.h:174
Definition: audiodec.h:128
SceUIntPtr SceUIntVAddr
Definition: types.h:85
int32_t SceInt32
Definition: types.h:44
uint32_t SceUInt32
Definition: types.h:45
uint8_t SceUInt8
Definition: types.h:36