[英]How to construct Codec Specific Data (CSD) from AAC-ADTS header?
How to construct CSD data from ADTS header? 如何从ADTS头构建CSD数据? I can create ADTS header for CSD data, but how to do the reverse?
我可以为CSD数据创建ADTS标头,但是如何反向?
/* function to construct ADTS header from CSD
* header_info - contains CSD
* frameLength - total frame size */
void addHeaderADTS(uint8_t header_info[], uint32_t frameLength) {
int profile = (csd_data[0] >> 3) & 0x1F;
int frequency_idx = ((csd_data[0] & 0x7) << 1) | ((csd_data[1] >> 7) & 0x1);
int channels = (csd_data[1] >> 3) & 0xF;
header_info[0] = 0xFF;
header_info[1] = 0xF1;
header_info[2] = (((profile - 1) << 6) + (frequency_idx << 2) + (channels >> 2));
header_info[3] = (((channels & 3) << 6) + (frameLength >> 11));
header_info[4] = ((frameLength & 0x7FF) >> 3);
header_info[5] = (((frameLength & 7) << 5) + 0x1F);
header_info[6] = 0xFC;
return;
} }
Found. 发现。 CSD data constructed using MakeAACCodecSpecificData function in avc_utils.cpp
使用MakeAACCodecSpecificData功能CSD数据构建avc_utils.cpp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.