diff options
author | Stefan Pöschel <github@basicmaster.de> | 2017-08-07 23:48:00 +0200 |
---|---|---|
committer | Stefan Pöschel <github@basicmaster.de> | 2017-08-07 23:48:00 +0200 |
commit | b25021100436ada451cdd22e5a4d9a644d2bc3d7 (patch) | |
tree | 7629024d439ac8506cccb24a9d46135f081dc864 | |
parent | e110738ab180ce1eb38b0bf533ace51b58b95dc0 (diff) | |
download | ODR-AudioEnc-b25021100436ada451cdd22e5a4d9a644d2bc3d7.tar.gz ODR-AudioEnc-b25021100436ada451cdd22e5a4d9a644d2bc3d7.tar.bz2 ODR-AudioEnc-b25021100436ada451cdd22e5a4d9a644d2bc3d7.zip |
AAC: skip PAD if only zero F-PAD
This optimizations saves four bytes if no X-PAD is present.
-rw-r--r-- | src/odr-audioenc.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 94e47cc..ff743bb 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -982,7 +982,18 @@ int main(int argc, char *argv[]) throw runtime_error(ss.str()); } - status |= STATUS_PAD_INSERTED; + /* + * AAC: skip PAD if only zero F-PAD (saves four bytes) + * See §5.4.3 in ETSI TS 102 563 + */ + if ( + selected_encoder == encoder_selection_t::fdk_dabplus && + calculated_padlen == 2 && + pad_buf[padlen - 2] == 0x00 && + pad_buf[padlen - 1] == 0x00 + ) { + calculated_padlen = 0; + } } else { // Some other error occurred during read. @@ -990,6 +1001,8 @@ int main(int argc, char *argv[]) break; } } + if (calculated_padlen) + status |= STATUS_PAD_INSERTED; // -------------- Read Data |