48e2f01c |
1 | /* |
2 | * Copyright (C) 2013 nu774 |
3 | * For conditions of distribution and use, see copyright notice in COPYING |
4 | */ |
5 | #ifndef AACENC_H |
6 | #define AACENC_H |
7 | |
8 | #include <fdk-aac/aacenc_lib.h> |
9 | #include "lpcm.h" |
10 | |
11 | #define AACENC_PARAMS \ |
12 | unsigned profile; \ |
13 | unsigned bitrate; \ |
14 | unsigned bitrate_mode; \ |
15 | unsigned bandwidth; \ |
16 | unsigned afterburner; \ |
17 | unsigned lowdelay_sbr; \ |
18 | unsigned sbr_signaling; \ |
19 | unsigned transport_format; \ |
20 | unsigned adts_crc_check; \ |
21 | unsigned header_period; |
22 | |
23 | typedef struct aacenc_param_t { |
24 | AACENC_PARAMS |
25 | } aacenc_param_t; |
26 | |
3b518efd |
27 | typedef struct aacenc_result_t { |
28 | uint8_t *data; |
29 | uint32_t len, size; |
30 | } aacenc_result_t; |
31 | |
48e2f01c |
32 | int aacenc_is_sbr_active(const aacenc_param_t *params); |
33 | |
9b8f9915 |
34 | int aacenc_mp4asc(const aacenc_param_t *params, |
35 | const uint8_t *asc, uint32_t ascsize, |
36 | uint8_t *outasc, uint32_t *outsize); |
37 | |
48e2f01c |
38 | int aacenc_init(HANDLE_AACENCODER *encoder, const aacenc_param_t *params, |
39 | const pcm_sample_description_t *format, |
40 | AACENC_InfoStruct *info); |
41 | |
42 | int aac_encode_frame(HANDLE_AACENCODER encoder, |
43 | const pcm_sample_description_t *format, |
44 | const int16_t *input, unsigned iframes, |
3b518efd |
45 | aacenc_result_t *output); |
48e2f01c |
46 | |
47 | #endif |