| 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_ratio; \ |
| 19 | unsigned sbr_signaling; \ |
| 20 | unsigned transport_format; \ |
| 21 | unsigned adts_crc_check; \ |
| 22 | unsigned header_period; |
| 23 | |
| 24 | typedef struct aacenc_param_t { |
| 25 | AACENC_PARAMS |
| 26 | } aacenc_param_t; |
| 27 | |
| 28 | typedef struct aacenc_frame_t { |
| 29 | uint8_t *data; |
| 30 | uint32_t size, capacity; |
| 31 | } aacenc_frame_t; |
| 32 | |
| 33 | int aacenc_is_sbr_ratio_available(); |
| 34 | |
| 35 | int aacenc_is_sbr_active(const aacenc_param_t *params); |
| 36 | |
| 37 | int aacenc_is_dual_rate_sbr(const aacenc_param_t *params); |
| 38 | |
| 39 | void aacenc_get_lib_info(LIB_INFO *info); |
| 40 | |
| 41 | int aacenc_mp4asc(const aacenc_param_t *params, |
| 42 | const uint8_t *asc, uint32_t ascsize, |
| 43 | uint8_t *outasc, uint32_t *outsize); |
| 44 | |
| 45 | int aacenc_init(HANDLE_AACENCODER *encoder, const aacenc_param_t *params, |
| 46 | const pcm_sample_description_t *format, |
| 47 | AACENC_InfoStruct *info); |
| 48 | |
| 49 | int aac_encode_frame(HANDLE_AACENCODER encoder, |
| 50 | const pcm_sample_description_t *format, |
| 51 | const int16_t *input, unsigned iframes, |
| 52 | aacenc_frame_t *output); |
| 53 | |
| 54 | #endif |