Log in

View Full Version : LC-AAC and HE-AAC for 5.1 audio


simps
9th October 2010, 23:11
I am trying to understand a bit more about multi-channel AAC. Can someone help?

1) What is the difference between LC-AAC and HE-AAC in multi-channel (5.1)?

2) For 5.1 audio, which one is better (quality wise)? LC-AAC or HE-AAC? (If the answer depends on the bitrate, please show me the details)

3) What are the available encoders for LC-AAC and HE-AAC? (for 5.1 audio)

4) Is there a "prefered" encoder, quality wise?

5) I've only heard about LC-AAC and HE-AAC for 5.1 audio, but is there a better (quality wise) AAC variant?

Thanks,
Simps

The Scientist
9th October 2010, 23:39
A quick Google search answers all your questions.

simps
10th October 2010, 00:14
I used google for this (before I wrote the thread), but 95% of the results were for AAC and stereo. The other 5% really didn't help. I am interested in AAC 5.1 audio. Can someone help?

tebasuna51
10th October 2010, 00:41
Is the same for stereo or 5.1. With AAC-HE the high frequencies are encoded with a special method (SBR) than work better for low bitrates.
Then for better quality use high bitrates and AAC-LC encode.

Please read http://en.wikipedia.org/wiki/Advanced_Audio_Coding

Midzuki
10th October 2010, 00:48
3) What are the available encoders for LC-AAC and HE-AAC? (for 5.1 audio)

neroaacenc

faac

There is also QuickTime,
but I don't use QuickTime since 1999. :)

Nero encoder is usually regarded as the "b35t" freeware AAC compressor available.

simps
10th October 2010, 14:30
Thanks tebasuna51 and Midzuki.

neroaacenc

faac

There is also QuickTime,
but I don't use QuickTime since 1999. :)

Nero encoder is usually regarded as the "b35t" freeware AAC compressor available.

I have used neroaacenc before. I thought it wasn't able to do 5.1 audio? If I remember, you have to feed neroaacenc with a single .wav file.

So, how do you encode 5.1 audio (6 mono .wav files) with neroaacenc?

nurbs
10th October 2010, 15:00
If I remember, you have to feed neroaacenc with a single .wav file.

So, how do you encode 5.1 audio (6 mono .wav files) with neroaacenc?
.wav files can be 5.1 or more channels. If you have 6 mono .wavs combine them to a 5.1 wav. There is software that can do this mentioned in this subforum, but I'm too lazy to search. It's probably easiest not to decode you source to multiple wav files to begin with.
Nero also accepts input from stdin.

edit:
Wavewizard can combine the wavs.

shon3i
10th October 2010, 16:11
Never use faac for any aac encoding, because is unfinished. NeroAAC, CTAAC (now Dolby) or QTAAC is freely avaible, and produce very high quality.

as input you need 6ch interleaved wav file.

And keep in mind, never go below 300kbps if you use LC-AAC.

simps
11th October 2010, 00:49
Thanks nurbs and shon3i.

I think I will give AAC 5.1 a try.
Since my source will usually be a 5.1ch ac3 or dts file, I will do this:

1) demux to 6 mono wavs with eac3to
2) mux the 6 mono wavs into a single 6ch wav (I will need to learn more about this. About the channel order, the tool to do it, etc)
3) neroaacenc. I think neroaacenc will automaticly set LC, HE or HEv2 based on the -q value, or the bitrate. So all I need to do is especify a "q" value, or a "bitrate".

My goal is to shrink the audio files in the movies I encode for backup. I usually do AC3 5.1ch at 320kb/s. I hope I can shrink it to 256kb/s with AAC, keeping the same quality... we will see.

nurbs
11th October 2010, 00:55
You can directly encode with with NeroAAC encoder using eac3to as long as the encoder is in the same directory.

eac3to input.ac3 output.aac -quality=0.45

or -256 if you want bitrate instead of quality.

simps
11th October 2010, 01:00
You can directly encode with with NeroAAC encoder using eac3to as long as the encoder is in the same directory.

eac3to input.ac3 output.aac -quality=0.45

or -256 if you want bitrate instead of quality.

I thought that only worked with 2ch ac3? Are you sure that works with 5.1 ac3 too?

tebasuna51
11th October 2010, 01:13
I thought that only worked with 2ch ac3? Are you sure that works with 5.1 ac3 too?

Of course, try before with -quality=0.35, with 0.45 you obtain a bitrate average greater than 256 Kb/s I think.

IgorC
11th October 2010, 03:53
Nero encoder can do 2-pass ABR. It makes sense for large files (in opposite of songs). Nero VBR is enough constrained but still admits some wider deviation of bitrate than ABR.


.
And keep in mind, never go below 300kbps if you use LC-AAC.
Nero goes for HE-AAC up to 200-220 kbps for 5.1 by default (recommended) and higher is only LC-AAC.

Plus it depends a lot of compressibility.

simps
11th October 2010, 12:53
Nero encoder can do 2-pass ABR. It makes sense for large files (in opposite of songs). Nero VBR is enough constrained but still admits some wider deviation of bitrate than ABR.



Nero goes for HE-AAC up to 200-220 kbps for 5.1 by default (recommended) and higher is only LC-AAC.

Plus it depends a lot of compressibility.

Is it possible to do 2-pass AAC encodes using eac3to? What would be the syntax?

tebasuna51
11th October 2010, 15:49
Is not possible. For a 2-pass AAC encode you need a physical wav file.
You can decode the source to wav and after use the NeroAacEnc CLI.

simps
11th October 2010, 18:14
Is not possible. For a 2-pass AAC encode you need a physical wav file.
You can decode the source to wav and after use the NeroAacEnc CLI.

Ok, thanks.
I will share an info that might be useful to someone...

I encoded a 448kbps 5.1ch AC3 with eac3to input.ac3 output.m4a -quality=0.3 and this is what media info says about the output.m4a file:

-------------------------------

Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : No
Codec ID : 40
Duration : 3h 13mn
Bit rate mode : Variable
Bit rate : 222 Kbps
Maximum bit rate : 308 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Stream size : 307 MiB (100%)
Encoded date : UTC 2010-10-11 14:12:01
Tagged date : UTC 2010-10-11 14:25:42

-------------------------------

So, for this particular source (will change from source to source), -q 0.3 resulted in a 222kbps 5.1ch AAC file. Note that it is using SBR, so I guess this would be an AAC-HE, instead of AAC-LC.

I did some blind test, switching between the 448kbps AC3 and the 222kbps AAC. They sound pretty much the same, with a tiny advantage for the AC3 file, pretty much negligible, very hard to detect.

So, I would recomend AAC with -q ~0.3 for 5.1ch audio. This will save space, and will give you the chance to raise your video bitrate for more image quality too.

I have only tested -q 0.3 with 5.1ch movie audio tracks. I don't know about stereo or music audio tracks, but I would imagine that for stereo music, -q 0.3 might not be enough, you might wanna use -q 0.35 or even higher values for stereo music tracks.

tebasuna51
12th October 2010, 00:00
-q 0.3 is the boundary betwenn AAC-HE and AAC-LC, for that I recommend -q 0.35 at least to recode AC3 448 or DTS 768.
Still there are players without support for SBR part, then for a little more bitrate you obtain a more compatible stream.

With the same sample:
encoded -q 0.30 -> AAC-HE 231 Kb/s
encoded -q 0.35 -> AAC-LC 266 Kb/s

SeeMoreDigital
12th October 2010, 09:20
There is also QuickTime,
but I don't use QuickTime since 1999When it comes to playback, Quicktime player does not support AAC-HE (SBR) decoding. And the Pro version does not offer AAC-HE encoding...

simps
12th October 2010, 13:38
-q 0.3 is the boundary betwenn AAC-HE and AAC-LC, for that I recommend -q 0.35 at least to recode AC3 448 or DTS 768.
Still there are players without support for SBR part, then for a little more bitrate you obtain a more compatible stream.

With the same sample:
encoded -q 0.30 -> AAC-HE 231 Kb/s
encoded -q 0.35 -> AAC-LC 266 Kb/s

I recode with -q 0.35 and got this:

-q 0.30 -> AAC-HE 222 Kbps (SBR: Yes)
-q 0.35 -> AAC-LC 260 Kbps (SBR: No)

I did some blind test between both files, and I couldn't tell the difference. Dialogs were just as clean in both files. There were some explosions and gun shots too, and I kept going back into those parts to try to see a difference between the files, and I couldn't. The audio is from a war movie, so there were some pretty complicated parts, and also, some silent parts. I couldn't find a difference between both files in the blind test, and I did it with a good HI-FI headphone (AT-AD900) and a X-FI sound card.

So, I guess the SBR algorithm is doing a really good job. 222kbps is 85% of 260kbps so you would expect a decrease in quality since 260kbps is already a bit low for 5.1ch audio, but for me, the quality was the same. I couldn't find a difference in the high freqs, or any other freq.

I guess if one is concerned about compatibility, then might be good to avoid SBR, as you said, since some players won't be able to decode it. But if that is not a problem, I think there is no point to be afraid of SBR. It really helps compression, and I wasn't able to detect any change in quality, even with an AT-AD900. OF course, if you go down as much as -q 0.25 or so, I am sure quality will suffer a lot. And all of this is valid only for 5.1ch movie tracks. For stereo music, you would need a higher -q value, and no SBR. Both -q 0.3 and -q 0.35 will give you enough quality for 5.1ch movie tracks in my opinion. One will waste a little more bitrate, but will be compatible with more players.

Anyway, thanks for all the help you guys provided in this thread. I learned a lot about AAC here.

IgorC
17th October 2010, 03:52
When it comes to playback, Quicktime player does not support AAC-HE (SBR) decoding. And the Pro version does not offer AAC-HE encoding...
QT has HE-AAC codec (both encode and decode). And it's very good.
http://www.hydrogenaudio.org/forums/index.php?showtopic=74781&hl=

http://tmkk.hp.infoseek.co.jp/qtaacenc/

SeeMoreDigital
17th October 2010, 10:16
QT has HE-AAC codec (both encode and decode). And it's very good.
http://www.hydrogenaudio.org/forums/index.php?showtopic=74781&hl=

http://tmkk.hp.infoseek.co.jp/qtaacenc/Apple/iTunes offers AAC-HE encoder/decoder support... However, the most current version of QuickTime player (ie: v7.68.75.0) for Windows O/S does not...

IgorC
17th October 2010, 18:45
Quicktime for Windows supports encode/decode of HE-AAC
I just encode and play HE-AAC file.

http://i52.tinypic.com/npme8h.png

SeeMoreDigital
17th October 2010, 19:00
Quicktime for Windows supports encode/decode of HE-AAC
I just encode and play HE-AAC file.Well this is very confusing...

Was your encode generated using the standard Windows download version of QuickTime Pro v7.68.75.0?


Cheers

IgorC
17th October 2010, 19:12
HE-AAC file was perfectly decoded by regular Quick Time 7.6.8 (not PRO).

I have no iTunes on my system. HE-AAC file was encoded by qtaacenc which uses Qucik Time (not PRO) for AAC encoding.

SeeMoreDigital
17th October 2010, 19:59
HE-AAC file was perfectly decoded by regular Quick Time 7.6.8 (not PRO).

I have no iTunes on my system. HE-AAC file was encoded by qtaacenc which uses Qucik Time (not PRO) for AAC encoding. Thanks IgorC.

Can you do me a favour and provide a sample please? I'd like to test it various versions of Quicktime and in my hardware decoders.


Cheers

IgorC
17th October 2010, 20:39
Lossless source http://ff123.net/samples/rushing.flac

The files are Apple QT 7.6.8 (build 1675) LC or HE encoded with qtaacenc --highest option (high quality) CBR/ABR/CVBR/TVBR

where
CVBR is constrained VBR
TVBR is true VBR (or fully VBR)

http://www.mediafire.com/?td70dv0x4wht9df

audyovydeo
18th October 2010, 09:07
this is weird.

OS : WinXP SP2

QT 7.6.8 Pro
exporting, the only choice you get is AAC-LC (Music)
(as SeeMoreDigital points out)


qtaacenc --he --cvbr 64 whatever.wav

creates a file which QT player Movie inspector reports as :

"MPEG 4 High Efficiency AAC, Stereo (L, R)"

and which mediainfo reports as :

Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : No

so, for one second I thought that qtaacenc used the QT API to encode in HE, but apparently it's more complicated.

SeeMoreDigital, what are your findings ?

cheers
audyovydeo

SeeMoreDigital
18th October 2010, 09:48
SeeMoreDigital, what are your findings ?

Well... when I played IgorC's .M4A samples in QuickTime v7.68.75.0 (and many thanks for those by the way :)). All three of the AAC-HE samples did indeed report this: -

http://img715.imageshack.us/img715/253/snap1e.png

And I'm happy to report that the same "High Efficiency" information was maintained when the .M4A contained files were re-muxed to .MOV container (using QT7 Pro).

Which is great news...

I'll do some more tests...

audyovydeo
18th October 2010, 10:13
... All three of the AAC-HE samples did indeed report this: -

http://img715.imageshack.us/img715/253/snap1e.png




Well, Mediainfo does report the following for the same samples :

Format profile : LC

so there is obviously something amiss.

What seems certain is that QuickTime player itself cannot export to AAC-HE.
Again, maybe :
- Igor got the QuickTime SDK installed & this enables HE ?
- qtaacend accesses HE through the QT API ?

which still does not explain why two different apps report two different profiles for the same file.

cheers
audyovydeo

tebasuna51
18th October 2010, 13:18
Well, Mediainfo does report the following for the same samples :

Format profile : LC

so there is obviously something amiss.
...
MediaInfo say:
Format profile : LC
Format settings : SBR
Format settings, PS : No
Codec : AAC LC-SBR
Is the same than AAC-HE

SeeMoreDigital
18th October 2010, 16:09
After doing a few more tests...

I can report that the standard Windows version of QuickTime player (ie: v7.68.75.0) correctly detects "Nero" AAC-HE encodes (generated using LameXP). Which is handy.

In order to further check this new version of QuickTime player abilities. I tried playing some "Nero" AAC-HE PS encodes. And although it correctly detects the "high-efficiency" element, it can't replicate the "parametric stereo" element. And plays them in mono.