Difference between revisions of "TTA"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
 
(Update with the 2023 comparison, the independent rewrite, and higher precision in some of the text)
 
(24 intermediate revisions by 12 users not shown)
Line 1: Line 1:
==TTA - Free lossless audio codec==
+
{{Codec Infobox
 +
| purpose =  
 +
| name = The True Audio
 +
| logo = [[File:TTA-logo.png]]
 +
| type = lossless
 +
| maintainer = Aleksander Djuric<br/>Pavel Zhilin<br/>Tamir Barak<br/>Noam Koenigstein<br/>Kazuki Oikawa
 +
| released = TTA 2.3 (Windows version, 2015-02)
 +
| website = [http://tausoft.org/wiki/True_Audio_Codec_Overview tausoft.org]
 +
}}
  
'''TTA''' (True Audio) [[lossless]] [[audio]] [[codec]] is a [[free]], simple real-time [[lossless]] audio encoder/decoder, based on adaptive prognostic filters which has shown the same or the better results comparing to majority of modern analogs.
+
'''The True Audio''' ('''TTA''') is a [[lossless]] audio [[codec]].  It is distributed as a free open-source (GPL/LGPL) encoder/decoder and library for several operating systems, and with DirectShow filters and plugins for several audio players, including [[foobar2000]].
  
==TTA Compressor==
+
It is not known whether the project is abandoned.  The codec sometimes identifies itself as "TTA1", and an announced development of a "TTA2" format has passed with no known updates since 2010.<ref>[https://web.archive.org/web/20100727022032/http://en.true-audio.com:80/TTA_Lossless_Audio_Codec_-_Format_Description Format description], archived 2010-07-27</ref>
  
* Down to 30% [[lossless]] [[audio]] [[data]] [[compression]]
+
TTA has a couple of unique properties: one is encryption with password protection, and that &ndash; apart from metadata &ndash; the bitstream is uniquely determined by the signal (and if applicable, the password). That is, ''one single setting'' with no encoding options for heavier / lighter compression / CPU load.  These properties have seen some appeal in certain applications, outside which TTA seems to have a limited userbase.
* Real-time encoding/decoding [[algorithm]]
+
* [[Fast]] operation speed and minimal system requirements
+
* Can be compiled and executed on several different platforms
+
* [[Free]] and [[open]] [[source]] [[code]] and documentation
+
* [[Hardware]] support
+
  
'''TTA''' performs [[lossless]] compression on multichannel 8,16 and 24 bit data of the [[Wav]] [[audio]] files. Being "[[lossless]]" means that no data/quality is lost in the [[compression]] - when uncompressed, the data will be identical to the original. The [[compression]] ratios of '''TTA''' depend on the type of music file being compressed, but the compression size will generally range between 30% - 70% of the original. '''TTA''' format supports both of [[ID3]]v1 and [[ID3]]v2 information tags.
+
Performance-wise, TTA has been measured around [[WavPack]] between default and <code>-h</code> on CD audio signals<ref>[http://audiograaf.nl/downloads.html Martijn van Beurden's comprehensive lossless comparison, version 6, 2023]</ref> &ndash; putting it on what traditionally has been considered on the ''fast encoder'' side rather than the ''heavy compression'' ([[Monkey's Audio]]/[[OptimFROG]]) side. In the most recent edition of the comparison, two codecs ([[TAK]] and, narrowly, [[FLAC]] after its recent performance improvements) could beat TTA simultaneously on all three tested parameters (encoding speed, decoding speed and file size) on the average signal tested.
  
Using '''True Audio codec''' you can store up to 20 [[audio]] [[CD]] from your music collection on one single DVD-R for playback, keeping all of [[CD]] information in a popular [[ID3]] information tags.
+
FFmpeg offers a third-party implementation which can encode and decode to higher channel count and accepts more input files than the official Windows encoder can do.  Also the foobar2000 component at foobar2000.org implements more features than the official version.  This wiki article aims at describing the features and limitations in the available end-user applications, rather than what the TTA ''format'' might accommodate (but nobody has implemented).  A 3rd party source code rewrite was posted in the Hydrogenaudio forums in 2023<ref>[https://hydrogenaud.io/index.php/topic,125048.0.html Hydrogenaudio forum post (2023) on codec rewrite]</ref><ref>[https://hydrogenaud.io/index.php/topic,125143.0.html Hydrogenaudio forum post (2023) on codec rewrite (library)] with [https://github.com/stseelig/libttaR github link]</ref>.
  
==The Project==
 
  
The '''TTA''' project provides:
+
 +
== Features ==
 +
From an end-user perspective, the following features are quite common among lossless codecs, except for password protection.  Some competing formats are lacking certain of these features, and some are free from certain of the limitations listed.  To compare TTA with other lossless codecs, see [[Lossless_comparison| HA Wiki's Lossless Codec Comparison]].
  
* [[Free]] and simple [[data]] [[format]]
+
* Seekable and streaming playback.
* [[Plugins]] for the most popular media players
+
* High-resolution audio support: the format supports 24 bits per sample, at any WAVE sampling rate (integers up to 4 GiHz; although the encoders may stop short of the 4 GiHz mark &ndash; ffmpeg at 2 GiHz &ndash; this limitation is hardly relevant for audio).
* TTA [[DirectShow]] filters
+
* Multichannel support, however with limitations (see below). Currently the reference encoder supports up to six channels, the ffmpeg implementation supports 16, and the unofficially modified foobar2000 component can handle 8.
* Tau Producer - GUI based compressor for [[Windows]]
+
* Piping support.
* Set of the C/C++ TTA development libraries
+
* Tagging (APEv2 or ID3v1/2).
 +
* Embedded CUE sheets support.
 +
* Unicode support.
 +
* Can be used in the [[Matroska]] container.
 +
* Password-protected encryption.
  
==See also==
+
The lack of encoding options may be a limitation or sometimes considered a feature: a given music signal corresponds to precisely one (unencrypted) TTA bit stream &ndash; no matter whether encoded with the reference encoder or ffmpeg.  Metadata sections may of course differ.
  
* [[Lossless data compression]]
+
=== Limitations ===
* [[Lossy data compression]]
+
The following list is in part based on issues revealed by tests in the Hydrogenaudio forums, as per 2022 available implementations &ndash; the 2023 independent rewrite not tested and is known to handle more input files.
* [[Audio data compression]]
+
* [https://hydrogenaud.io/index.php/topic,122094 Bad error handling.]<ref>[https://hydrogenaud.io/index.php/topic,122094 HA forum discussion (2022) on codecs' error handling]</ref> Errors will upon playback lead to full-volume static noise played back, at worst for the rest of the file.  Only the most severe errors seem to be detected by the reference decoder.  Testing reveals that ffmpeg can detect errors the reference decoder cannot, and might drop more defective frames, but ffmpeg might still play back static unmuted.  The lack of (MD5) audio checksum is a more severe shortcoming when the capability to detect errors by other means is so limited; there seems to be no reliable way implemented to scan a collection of files for corruption, although the ''format'' provides block checksums.
 +
* The existing implementations have limitations for non-CDDA signals:
 +
** Bit depth: The format supports 8, 16 or 24 bit files &ndash; and 8-bit signals are only supported in ffmpeg's implementation, not in the the reference encoder/decoder (nor the official [[foobar2000]] playback component). Note, some old sources refer to 32-bit (floating-point) support; that was apparently dropped circa 2004, and it is not known how to decode such files, should they even exist. <br/>Non-integer byte depths (say 20 valid bits in a 24-bit WAVE container) are not well supported.  Testing with 20-bit WAVE files has provoked the reference encoder into either of the following three: rejecting the file altogether; producing undecodeable files; silently upconverting to 24 bits, losing any information that it was ever 20 bits (ffmpeg appears to ''always'' do this).  In the latter case, TTA will not compress it well, as it is unable to make use of "wasted bits": other codecs can detect that bits 21 to 24 are zero and compress a 20-bit signal virtually without penalty.  (See van Beurden's lossless comparison, section 2.3.)
 +
** Limitations in multichannel support: Although the TTA ''format'' claims support for up to 65536 channels, no implementation seems to support more than 16 (ffmpeg), the reference implementation being capped at 6. The foobar2000 component repository includes a component version that handles 8 channels (unlike the component provided by the TTA developers), and that component also honours the [https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible WAVEFORMATEXTENSIBLE] tag to interpret what channels are encoded.  This is an unofficial feature; the format itself offers no channel assignment (e.g., if a TTA file has three channels there is no rule to tell whether it is 2.1 or 3.0, and likewise there is no rule to tell whether a five-channel file a 5.0 or a 4.1 &ndash; the component implements support through a tag).  Also, in van Beurden's comparison, TTA fared worse on multichannel material than on stereo.
 +
** The reference encoder is picky about input ''files,'' only supporting some versions/generations of the WAVE format (and no other format than WAVE) and requiring workarounds at 2 GiB input size.  Also the reference implementation might truncate too large files. These issues can be circumvented by using ffmpeg instead. 
 +
* Metadata:
 +
** TTA might be the lossless format most likely to suffer from tagging ambiguity.  While there are other formats which can (like MP3) accommotate both ID3 and APEv2 tags, applications seem to have converged to APEv2 for other lossless formats which accept it, and both ffmpeg's TTA encoder and [[foobar2000]] will try to enforce APEv2 in TTA.  However, a tagger like [https://en.wikipedia.org/wiki/MusicBrainz_Picard MusicBrainz Picard] will treat TTA files as MP3 files, defaulting to ID3v1&ID3v2.3 while ''ignoring'' any APEv2.  Apparently [[Mp3tag]] will write ID3 to an ''untagged'' .tta file, but ignore ID3 when APEv2 is already present.
 +
** There is no provision for (R)IFF chunks; i.e. TTA cannot store nor recreate ''non-audio'' chunks of the original file. That means that one limitation of ffmpeg &ndash; that it drops RIFF chunks &ndash; is moot for TTA, which could not store them in any case. Note that ffmpeg will transfer tags upon conversion in the usual way (to APEv2 when encoding), but the reference encoder/decoder does not know tags in WAVE.
 +
* Its unique feature &ndash; password protection &ndash; seems to be unsupported in ''players'', save for invoking ffplay from a command-line with the password typed in.
 +
* Just as the lack of options might be useful in specialized applications, other users will find it a limitation.  However, one may argue that by 2023, performance differences are less of an issue even if there is no way to speed up neither encoding nor decoding (which takes even more CPU power than encoding).
 +
* Like most lossless formats, TTA has no functionality for hybrid lossless/lossy encoding. For TTA, there is also no way (for power users!) to hack a hybrid solution by way of [[LossyWAV]].
  
== External links ==
+
Hardware support is limited outside [[Rockbox]].  A few hardware players with TTA support have been around over the years<ref>http://tausoft.org/wiki/True_Audio_Codec_Support</ref> until Cowon exited the hardware player market.  However the distinction between &laquo;hardware&raquo; and &laquo;software&raquo; support is arguably less clear with ffmpeg-based players on smart devices. 
  
* [http://www.true-audio.com True Audio Software Project]
+
==Using TTA (missing: info about DirectShow) ==
* [http://www.true-audio.com/codec.theory Compression theory]
+
At least for 16-bit signals, one might rather use ffmpeg than the reference implementation. Note that ffmpeg will, upon decoding to WAVE/AIFF, default to 16 bits regardless whether that is a lossy operation. (This is not specific to input source, and users should take care before using ffmpeg for lossless conversion.)
* [http://www.true-audio.com/codec.format TTA format description]
+
* [http://www.true-audio.com/codec.comparison True Audio codec comparison]
+
* [http://www.true-audio.com/codec.hardware Hardware Support]
+
* [http://www.true-audio.com/ftp/WinTTA-setup.exe Tau Producer (GUI-based TTA compressor for Windows)]
+
* [http://www.true-audio.com/codec.images Tau Producer Screen Shoots]
+
* [http://tta.corecodec.org/ Project @ Corecodec.Org]
+
* [http://tta.sourceforge.net/ Project @ Sourceforge.Net]
+
  
[[Category:Audio codecs]]
+
For foobar2000 playback, the component at the foobar2000 website has more features than the TTA developers' decoding component and is also available for 64-bit versions of the player.  Since non-audio chunks are not stored in .tta files, foobar2000 just as well be the preferred software to convert .tta files unless one encounters > 8 channels.
  
[[de:True Audio Codec]]
+
==Links==
 +
<references/>
 +
Additional sources:
 +
* [http://tausoft.org/wiki/True_Audio_Codec_Overview TTA Lossless Audio Codec &ndash; Tau Projects:] Codec overview at the official site.
 +
* {{wikipedia|TTA (codec)}}
 +
* [https://www.foobar2000.org/components/view/foo_input_tta foobar2000 component at foobar2000.org]
 +
* [[Lossless_comparison| HA Wiki's Lossless Codec Comparison]] originally by [[User:Rjamorim|Rjamorim]]
 +
 
 +
{{navbox audio codecs}}
 +
 
 +
[[Category:Codecs]]

Latest revision as of 17:51, 25 April 2024

The True Audio (TTA) is a lossless audio codec. It is distributed as a free open-source (GPL/LGPL) encoder/decoder and library for several operating systems, and with DirectShow filters and plugins for several audio players, including foobar2000.

It is not known whether the project is abandoned. The codec sometimes identifies itself as "TTA1", and an announced development of a "TTA2" format has passed with no known updates since 2010.[1]

TTA has a couple of unique properties: one is encryption with password protection, and that – apart from metadata – the bitstream is uniquely determined by the signal (and if applicable, the password). That is, one single setting with no encoding options for heavier / lighter compression / CPU load. These properties have seen some appeal in certain applications, outside which TTA seems to have a limited userbase.

Performance-wise, TTA has been measured around WavPack between default and -h on CD audio signals[2] – putting it on what traditionally has been considered on the fast encoder side rather than the heavy compression (Monkey's Audio/OptimFROG) side. In the most recent edition of the comparison, two codecs (TAK and, narrowly, FLAC after its recent performance improvements) could beat TTA simultaneously on all three tested parameters (encoding speed, decoding speed and file size) on the average signal tested.

FFmpeg offers a third-party implementation which can encode and decode to higher channel count and accepts more input files than the official Windows encoder can do. Also the foobar2000 component at foobar2000.org implements more features than the official version. This wiki article aims at describing the features and limitations in the available end-user applications, rather than what the TTA format might accommodate (but nobody has implemented). A 3rd party source code rewrite was posted in the Hydrogenaudio forums in 2023[3][4].


Features

From an end-user perspective, the following features are quite common among lossless codecs, except for password protection. Some competing formats are lacking certain of these features, and some are free from certain of the limitations listed. To compare TTA with other lossless codecs, see HA Wiki's Lossless Codec Comparison.

  • Seekable and streaming playback.
  • High-resolution audio support: the format supports 24 bits per sample, at any WAVE sampling rate (integers up to 4 GiHz; although the encoders may stop short of the 4 GiHz mark – ffmpeg at 2 GiHz – this limitation is hardly relevant for audio).
  • Multichannel support, however with limitations (see below). Currently the reference encoder supports up to six channels, the ffmpeg implementation supports 16, and the unofficially modified foobar2000 component can handle 8.
  • Piping support.
  • Tagging (APEv2 or ID3v1/2).
  • Embedded CUE sheets support.
  • Unicode support.
  • Can be used in the Matroska container.
  • Password-protected encryption.

The lack of encoding options may be a limitation or sometimes considered a feature: a given music signal corresponds to precisely one (unencrypted) TTA bit stream – no matter whether encoded with the reference encoder or ffmpeg. Metadata sections may of course differ.

Limitations

The following list is in part based on issues revealed by tests in the Hydrogenaudio forums, as per 2022 available implementations – the 2023 independent rewrite not tested and is known to handle more input files.

  • Bad error handling.[5] Errors will upon playback lead to full-volume static noise played back, at worst for the rest of the file. Only the most severe errors seem to be detected by the reference decoder. Testing reveals that ffmpeg can detect errors the reference decoder cannot, and might drop more defective frames, but ffmpeg might still play back static unmuted. The lack of (MD5) audio checksum is a more severe shortcoming when the capability to detect errors by other means is so limited; there seems to be no reliable way implemented to scan a collection of files for corruption, although the format provides block checksums.
  • The existing implementations have limitations for non-CDDA signals:
    • Bit depth: The format supports 8, 16 or 24 bit files – and 8-bit signals are only supported in ffmpeg's implementation, not in the the reference encoder/decoder (nor the official foobar2000 playback component). Note, some old sources refer to 32-bit (floating-point) support; that was apparently dropped circa 2004, and it is not known how to decode such files, should they even exist.
      Non-integer byte depths (say 20 valid bits in a 24-bit WAVE container) are not well supported. Testing with 20-bit WAVE files has provoked the reference encoder into either of the following three: rejecting the file altogether; producing undecodeable files; silently upconverting to 24 bits, losing any information that it was ever 20 bits (ffmpeg appears to always do this). In the latter case, TTA will not compress it well, as it is unable to make use of "wasted bits": other codecs can detect that bits 21 to 24 are zero and compress a 20-bit signal virtually without penalty. (See van Beurden's lossless comparison, section 2.3.)
    • Limitations in multichannel support: Although the TTA format claims support for up to 65536 channels, no implementation seems to support more than 16 (ffmpeg), the reference implementation being capped at 6. The foobar2000 component repository includes a component version that handles 8 channels (unlike the component provided by the TTA developers), and that component also honours the WAVEFORMATEXTENSIBLE tag to interpret what channels are encoded. This is an unofficial feature; the format itself offers no channel assignment (e.g., if a TTA file has three channels there is no rule to tell whether it is 2.1 or 3.0, and likewise there is no rule to tell whether a five-channel file a 5.0 or a 4.1 – the component implements support through a tag). Also, in van Beurden's comparison, TTA fared worse on multichannel material than on stereo.
    • The reference encoder is picky about input files, only supporting some versions/generations of the WAVE format (and no other format than WAVE) and requiring workarounds at 2 GiB input size. Also the reference implementation might truncate too large files. These issues can be circumvented by using ffmpeg instead.
  • Metadata:
    • TTA might be the lossless format most likely to suffer from tagging ambiguity. While there are other formats which can (like MP3) accommotate both ID3 and APEv2 tags, applications seem to have converged to APEv2 for other lossless formats which accept it, and both ffmpeg's TTA encoder and foobar2000 will try to enforce APEv2 in TTA. However, a tagger like MusicBrainz Picard will treat TTA files as MP3 files, defaulting to ID3v1&ID3v2.3 while ignoring any APEv2. Apparently Mp3tag will write ID3 to an untagged .tta file, but ignore ID3 when APEv2 is already present.
    • There is no provision for (R)IFF chunks; i.e. TTA cannot store nor recreate non-audio chunks of the original file. That means that one limitation of ffmpeg – that it drops RIFF chunks – is moot for TTA, which could not store them in any case. Note that ffmpeg will transfer tags upon conversion in the usual way (to APEv2 when encoding), but the reference encoder/decoder does not know tags in WAVE.
  • Its unique feature – password protection – seems to be unsupported in players, save for invoking ffplay from a command-line with the password typed in.
  • Just as the lack of options might be useful in specialized applications, other users will find it a limitation. However, one may argue that by 2023, performance differences are less of an issue even if there is no way to speed up neither encoding nor decoding (which takes even more CPU power than encoding).
  • Like most lossless formats, TTA has no functionality for hybrid lossless/lossy encoding. For TTA, there is also no way (for power users!) to hack a hybrid solution by way of LossyWAV.

Hardware support is limited outside Rockbox. A few hardware players with TTA support have been around over the years[6] until Cowon exited the hardware player market. However the distinction between «hardware» and «software» support is arguably less clear with ffmpeg-based players on smart devices.

Using TTA (missing: info about DirectShow)

At least for 16-bit signals, one might rather use ffmpeg than the reference implementation. Note that ffmpeg will, upon decoding to WAVE/AIFF, default to 16 bits regardless whether that is a lossy operation. (This is not specific to input source, and users should take care before using ffmpeg for lossless conversion.)

For foobar2000 playback, the component at the foobar2000 website has more features than the TTA developers' decoding component and is also available for 64-bit versions of the player. Since non-audio chunks are not stored in .tta files, foobar2000 just as well be the preferred software to convert .tta files unless one encounters > 8 channels.

Links

  1. Format description, archived 2010-07-27
  2. Martijn van Beurden's comprehensive lossless comparison, version 6, 2023
  3. Hydrogenaudio forum post (2023) on codec rewrite
  4. Hydrogenaudio forum post (2023) on codec rewrite (library) with github link
  5. HA forum discussion (2022) on codecs' error handling
  6. http://tausoft.org/wiki/True_Audio_Codec_Support

Additional sources: