2
如何從ADTS頭構建CSD數據?我可以爲CSD數據創建ADTS標頭,但是如何做相反的操作?如何從AAC-ADTS標頭構建編解碼器特定數據(CSD)?
/* 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;
}
給我們提供CSD數據嗎?究竟是什麼? – Danijel
編解碼器特定數據(CSD)csd_data [0] = 0x13,csd_data [1] = 0x0x90。要了解csd,請參閱http://wiki.multimedia.cx/index.php?title=Understanding_AAC&redirect=no http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio –
該wiki上沒有CSD頁。該wiki頁面上也沒有csd_data。 – Danijel