Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Mpc Quality Settings For Dolby 2.1 Streams (Read 20838 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Mpc Quality Settings For Dolby 2.1 Streams

Not sure whether this has been addressed before.  Had a look through the forums, but could not find anything at first glance.

Something I picked up quite some time ago with MP3 was that the surround channel in a Dolby 2.1 (is that the correct term?) stream contained severe artifacts even with fairly high quality settings.

I experimented with MPC, and found this to also be true to for --quality 5.  --quality 6 is significantly better, but I lack the equipment and expertise to truly compare the original with varying quality settings.

My question is:  is this reasonable cause for encoding albums at --quality 6 or higher?  In my opinion, yes.  I have seen mention of other parameters (--ms?) that could possibly provide better stereo encoding (which is where the surround channel data really lives, isn't it?).

Can anyone maybe confirm my findings and comment on whether I'm just being paranoid, or whether it is more appropriate to use other parameters for such streams, in stead of --quality 6?

Note that many albums (especially live shows) seem to have this type of surround channel information;  I believe it's either intentional or a side-effect of the way 2.1 decoding interprets the audio.

 

Mpc Quality Settings For Dolby 2.1 Streams

Reply #1
Have done some more reading and testing.  A fairly good Surround Sound resource is available at http://www.srslabs.com/pdf/01-10-02%20EDN.pdf.

What I am actually referring to seems to be known as Dolby Surround, used for encoding a center and mono rear surround channel into a standard 2-channel stereo signal.

Surround Sound Encoding Algorithm

Surround Sound Decoding Algorithm

In a nutshell:  to extract only the surround channel from an audio stream, you could invert either the left or right channel and then add the two together.  While this will be 90 degrees out of phase if played in conjunction with the true left and right, it is sufficient for testing purposes (we'll only be listening to the surround channel.)

I extracted a portion of an AC3 stream from a Dolby 5.1 "music" DVD and downmixed it to Dolby Surround using Azid 1.8, resampled to 44.1Khz 16-bit using SSRC 1.29, then encoded the result with MPPENC 1.14 using --quality settings 5, 6 and 7.  Extracted the encoded files back to WAV using MPPDEC 1.93j, inverted the left channel and converted the file to mono (adding the two channels.)

Original sample and results available at http://www.geocities.com/mr_atom_guy/surround.zip

NOTE:  copy and paste the URL.  Just clicking on a Geocities URL that points to a file does not work.

original.ape - original sample extracted from DVD
surround-orig.ape - surround channel extracted from original
surround-q5.ape - surround channel extracted from --quality 5 encoding
surround-q6.ape - surround channel extracted from --quality 6 encoding
surround-q7.ape - surround channel extracted from --quality 7 encoding

I ran a WinABX test.  Results:

A file: C:\temp\surround_orig.wav
B file: C:\temp\surround_q5.wav
21:05:38  10/10  p< 0.1%

A file: C:\temp\surround_orig.wav
B file: C:\temp\surround_q6.wav
21:25:01  10/10  p< 0.1%

surround_q5.wav has severe artifacts, clearly audible.  --quality 6 was VERY close to the original - just a slight "tremelo" effect on the "sss" sounds right at the beginning.  I could not detect any difference at --quality 7, but I don't have the best equipment or ears for the job.

Is Q5 designed to be transparent even for this Surround sources?  Should it be?  Asking, and hoping for a response. 

Mpc Quality Settings For Dolby 2.1 Streams

Reply #2
some rumble:
very interesting, did you test any other encoders? (like lame, oggenc?), not to forget that prologic is not transparent by itself (dolby 'manuals' suggest that even at mixing stage of such streams those should be performed over the encoder->decoder->speakers line, wonder what the dolbydigital setup would look like...)

questions:
has any1 any experience with dealing with dolbylabs, like how to pay all the stuff that is needed for prologic mix and broadcasting? (is that like $perminute of use of the encoder or one time payment?, or is this only connected with minutes of broadcast? (if we are talking about the tv station))
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Mpc Quality Settings For Dolby 2.1 Streams

Reply #3
Quote
Note that many albums (especially live shows) seem to have this type of surround channel information;  I believe it's either intentional or a side-effect of the way 2.1 decoding interprets the audio.

I'm almost certain that this is a side-effect.  I haven't yet seen a cd with any dolby surround label, but I have heard cds that have very audible surround effects.  Its usually only certain instruments (usually the snare drum) and occurs in music with alot of reverb.  Sometimes it sounds cool; sometimes stupid.

It would be nice if mpc could save this info, but if the cost is alot higher bitrate I'd lose the surround info, as it is generally unintentional.

Of course, if a dshow filter for mpc ever appears, and it is used for movies, then we'd likely need some sort of 'movie' preset, that saves surround info at the expense of bitrate and or quality.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #4
A good example of an album with fairly strong surround effects is Alanis Morissette's Unplugged album.  The crowd was recorded in full stereo, resulting in a fantastic spatial effect during applause when the standard 2-channel CD is played back on a Dolby Surround capable system.

Anyway.

I Reran the tests using Lame v3.92.  The quality on both APS and APX is appalling.  The only setting that comes close is --api.  I'm speculating that this has to do with the number of frames encoded in stereo/joint-stereo.  For this sample, APS yields 10/139;  for APX it's 91/58.  --api encodes almost all the frames in pure stereo:  144/5.  I can still pick out --api 10 out of ten times in an ABX test, though.

Ogg Vorbis v1.0 fared remarkably well.  Acceptible results are found even at --quality 5, even though I can ABX it 10 out of 10 times from the original.  --quality 4 results in very audible artifacts, while --quality 6 and 7 is slightly better than 5 (can still ABX both 10 out of 10 times, though.)  I've also found mention in this forum that the Ogg documentation states that it employes lossless stereo coupling for -q 6 or higher, which would explain the better performance to a large degree.

AAC also offered great results with the -normal quality setting.  -streaming produced clearly audible artifacts.  Both -extreme and -archive could be ABX'd 9 out of ten times, but it was very difficult to do so.

Tip on ABX'ing this sample: I found that the if you can't hear any evident flanging on the s-sounds, there is also a slight over- or under-emphasis (depending on the decoder) on the strumming of the guitar strings between 1.3 and 1.7 seconds.

If I consider that the surround will be listened to in a normal environment with both left & right channels as well, then perceptually the various encoders would produce acceptable results (that is, without disturbing artifacts but still with small differences) for this sample at:
AAC:   Acceptable at:  -normal (155.6kbits/s)
LAME:   Acceptable at:  -alt-preset insane (320.0kbits/s)
MPC:   Acceptable at:  --quality 6 (214kbits/s)
Ogg:   Acceptable at:  --quality 5 (165kbits/s)

My problem with the encoding quality is not so much the preservation of the surround channel, but the fact that it can contain very annoying artifacts if not properly encoded.  Dolby surround or mere side-effect, I'd prefer not to hear distortion behind my head.  My personal opinion is that if one compares the various results, and which bitrates provide good stereo imaging, MPC needs some work.  LAME needs a LOT.  Granted, MPC would probably beat the socks off the others when it comes to two-speaker stereo at 214kbits/s.

It's either that, or the description of which presets yields approximate transparentness need to be redefined.

Having written the above and looking back, I find it remarkable how much I learned about lossy compression just doing these tests! ;-)  I could probably upload my already-encoded test samples, but since they're fairly big in total, I'll only do so on request.  You're free to do your own comparison by encoding the sample posted earlier.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #5
MPC is designed and tuned only for normal stereo listening, not surround, which explains why it sounds so bad. The higher presets use more conservative stereo coupling than the lower ones. Please retest using something like --standard --ms 15. If that still fails, then try --standard --ms 0.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #6
Quote
My problem with the encoding quality is not so much the preservation of the surround channel, but the fact that it can contain very annoying artifacts if not properly encoded.  Dolby surround or mere side-effect, I'd prefer not to hear distortion behind my head.

Or you can just turn off pro-logic on your receiver..  Works for me.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #7
Another happy customer :-)  Thanks, Gecko.  Your comment also valid, Floyd.  I suppose I just had some sour grapes over AAC and Ogg Vorbis getting it right on the default settings ;-)

With mppenc --xlevel --quality 5 --ms 15 I found near perfection.  It took a LOT of scrutiny before I could find any difference provable with an ABX test for either --ms 15 or --ms 0.  The funny thing is that --ms 15 seemed to provide better quality for one particular portion of the sample than --ms 0.  There's a patch at 0.4s to 0.7s that sounds "rougher" on --ms 0 than --ms 15.  Possibly just coincidence.

To compare for this particular sample:
MPC @ --quality 5          183Kb/s
MPC @ --quality 5 --ms 15  189Kb/s
MPC @ --quality 5 --ms 0  196Kb/s
MPC @ --quality 6          214Kb/s

I've also encoded two entire normal albums and a 50 minute Dolby Digital 5.1 stream downmixed to Dolby Surround with the command line above.  Using the --ms 15 setting, I noticed encoded size increases of anything 1% and 10% for the normal albums, and 4% for the Dolby Surround track.

I'm fairly certain that further tweaking could result in similar quality with smaller changes in file size.

As for me, I'm happy to take the hit of adding 1% to 10% to the sizes of my files to get proper surround encoding.  It would be interesting to know what the average would be over a large sample of music files.

Thanks again for everyone's help.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #8
I've been using a "poor man's surround system" for awhile now and haven't noticed anything other than what normal difference information sounds like. I use a quality setting of 5 for all my files.

Dolby Pro Logic decoders do a lot of signal processing (100-7000 hz bandpass and some delay) to the surround channel which could sound bad when coupled with lossy audio formats. The poor man's surround system doesn't do any signal processing (other than getting the difference between the left and right channels).

If you want to try it, it's easy to wire. Connect the two surround speaker's negatives together, then connect the front left's postive to the surround left's positive. Connect this to the amplifier and repeat for the right channel. This is a very simple surround system that works very similar to Dolby Pro Logic.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #9
Quote
The funny thing is that --ms 15 seemed to provide better quality for one particular portion of the sample than --ms 0.  There's a patch at 0.4s to 0.7s that sounds "rougher" on --ms 0 than --ms 15.  Possibly just coincidence.

Here's what Frank has said on this issue quite some time ago:

Quote
--ms 0 disables Mid/Side coding. This reduces significantly
quality for signal with high channel correlation.

This effect is called stereo unmasking. First mentioned in 1953.
A related effect is the "cocktail party effect".


--ms 0 should never be used.

Maybe someone should add this to the recommend MPC command lines.  CiTay?

Mpc Quality Settings For Dolby 2.1 Streams

Reply #10
Quote
Maybe someone should add this to the recommend MPC command lines.  CiTay?

Added. Maybe i should be more specific, but i don't wanna scare anyone off with technical explanations...

Mpc Quality Settings For Dolby 2.1 Streams

Reply #11
Adding --ms 15 in generally to --quality 5 ... 8 ?


I have encoded a test song with a lot surround informations, in different settings.
Well, it is a test song, which results to a higher  bitrate than "average songs", I assume.
Here the bitrate increase is always neglectable.
As atom or somebody else told above, adding --ms 15, results to increases between 1% and max. 10%; so, for a better stereo image or surround image, people could add that switch.

So I suggest, to write this switch --ms 15 to recommended list of mpc settings (with remark about slightly increased filesizes), but only, if there are no other drawbacks, disadvantages.


The test:

CD Stereoplay Dolby Pro Logic 2 DPL2  Promo-CD
01.Pink Panther, Henry Mancini , Erich Kunzel & Cincinnati Pops Orchestra 2002
5732 samples, 2.29 min.sec
This song contains a lot surround info. Especially informations for
Logic7/DPL2 decoders. These informations are compatible to old DPL-decoders.

As Encoder I used actual  recommended mppenc 1.14.

avr bitrate - filesize - setting (difference: kbit/s - Byte)

190.3 - 3,561,276 - --quality 5 --xlevel
190.9 - 3,572,708 - --quality 5  --ms 15  --xlevel  (difference: + 0.6 - + 11,400)
221.5 - 4,144,888 - --quality 6  --xlevel
221.7 - 4,149,804 - --quality 6  --ms 15  --xlevel (difference: + 0.2 - + 4,900)
252.8 - 4,730,904 - --quality 7  --xlevel
252.8 - 4,732,108 - --quality 7  --ms 15 --xlevel (difference: 0 - + 1,200)
265.4 - 4,966,428 - --quality 7.5  --xlevel
265.4 - 4,967,360 - --quality 7.5 --ms 15  --xlevel (difference: 0 - + 1,000)
287.1 - 5,373,028 - --quality 8 --xlevel
287.1 - 5,373,868 - --quality 8 -ms 15  --xlevel (difference: 0 - + 0,800)
318.9 - 5,968,532 - --quality 9  --xlevel
318.9 - 5,969,068 - --quality 9  --ms 15 --xlevel (difference: 0 - + 0,500)
356.7 - 6,675,772 - --quality 10  --xlevel
356.7 - 6,675,772 - --quality 10 --ms 15  --xlevel (difference: 0 - 0) identical by bit to bit comparison.

Conclusion:

(well, I know, you should not draw conclusions based on one sample or song,
but this is "normal music" with surround-info, lasting 2.5 minutes. So it
contains different parts of music und should represent a kind of "average").

Only in q5 and q6 settings you have a minor increase of bitrates (+ 0.6
kbit/s !), comparing quality setting and same quality setting with added
switch --ms 15.
From q7 to q10 you can forget the bitrate increase at all.
q10 results to bit-identical output compared to q10 --ms 15.

So:
If --ms 15 does not have any other disadvantage regarding sound quality, I
would recommend to add --ms 15 to the quality settings, if you want more
precise stereo-image or keeping surround informations.
Because the bitrate increase is nearly neglectable, or below 10% (tested by somebody above).

Or do you have examples, where you experience worse sound quality, due to
added --ms 15 ?

Mpc Quality Settings For Dolby 2.1 Streams

Reply #12
Yes this is a very interesting topic.
I do think Frank Klemm will know more clarifying things about this, as --ms tweakings will probably already be taken into consideration during the finetuning of the MPC model.

Thread Bookmarked 

Mpc Quality Settings For Dolby 2.1 Streams

Reply #13
We surely shouldn't generally append this switch. This would go against the philosophy to not recommend special "tweaking" switches to the average user. What we could do is to add another line solely for the purpose of encoding 'surround sound' tracks. But i don't think that the demand is very high for that...

Mpc Quality Settings For Dolby 2.1 Streams

Reply #14
I hope, my words above are not misunderstood, please.

Of couse no "general" recommendation to use --ms 15.

I meant, mentioning it as possible improvement, option, for stereo-image or surround informations in music/sound
(and that only, if there are no other drawbacks, disadvantages caused by that switch --ms 15 (compared like adding --ms to --alt-preset standard, e or i, which destroys the code-level-tweaking of those presets)).


As appendix somewhere in the list.


So that people are informed.


http://www.hydrogenaudio.org/forums/index....=ST&f=11&t=4157

atom is not the only one, who has experienced certain things (improvements) with --ms 15.
the duke and  xbenchman report it, too.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #15
Got an email from Frank Klemm (you too, user, thx):

He thinks that a new recommendation for surround encoding isn't necessary. For instance, he held another listening test where people didn't favor --ms 15, it was more like the opposite. People concerned with best "imaging" for their surround files should first try a higher quality setting, i.e. --quality 6 or --quality 7.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #16
i don't like the term "stereo imaging" in this context, since problem at hand here does not have much to do with the actual stereo imaging when just listening to the track in (well, duh!) stereo - more with the immediate perceived quality of the difference signal..

or did i miss something..?
A riddle is a short sword attached to the next 2000 years.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #17
You are right, "surround information" then.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #18
yes, you are right. I don't know, if Frank has read those 2 threads with 3 people reporting these issues, up to quality 6.



hmm, if atom should have listened only to difference signals, or only to rear speakers, then he did a bad test.
Of course by normal listening behaviour minor artefacts of rear channels are masked by louder front signals, eg.
It does not make sense to listen to rear speakers only, just to detect artefacts.

This has Frank told, too, in his answer.
There he is obviously right, but I dunno, if atom or anybody else reporting here should have tried/tested by that silly way....







Summarizing:

Reading his answer, I understand, that --ms 15 does not cause trouble/harm to sound-quality,

but can increase bitrate, sometimes only few bits (like in my test-song, which is not representative), sometimes 1% - 10%, but sometimes up to 40% bitrate increasement, as he experienced.
He tells, that mono-recordings with asymmetrical gain levels right and left make such trouble ?


So he recommends like Citay told above, using q6, or q7, if problems occur.
This has been confirmed by those 3 reporters, too.
Either they got transparent samples by using --ms 15, or by going up to q7.

Citing Frank: "If problems occur, try first switching from --ms 11 to 12 (standard in q6), or if that does not help, then go to --ms 13 (standard in q7, 8, 9)




table of used --ms settings:

> --ms x Mid/Side Stereo, 0: off, 1: reduced, 2: on, 3:
> decoupled,
> 10: enhanced 1.5/3 dB, 11: 2/6 dB, 12: 2.5/9 dB,
> 13: 3/12 dB, 15: 3/oo dB (dflt: 11)
> q5 uses 11
> q6 uses 12
> q7, q8, q9 uses 13
> q10 uses 15
> (14 doesn't seem to be implemented)

Mpc Quality Settings For Dolby 2.1 Streams

Reply #19
Adding --ms 15 does not cause artefacts or worse sound.


So, just to clarify things, I asked Frank Klemm a second time, if adding --ms 15 cannot cause any problems (besides bitrate increase).



He confirmed it again.



user:
So, there is no danger/possibility of reducing quality of sound ?
German original:
> Also, es besteht keine Gefahr der klanglichen Verschlechterung?

Klemm:
No, there is no danger. The quantization noise will never be increased. It stays the same or is reduced.
German original:
Nein, es besteht keine Gefahr. Das Quantisierungsrauschen wird in keinem
Fall erhöht, sondern bleibt gleich oder wird verringert.



Furtheron he tells again, that with certain songs, namely a lot of mono-recordings, there could be an increase of 50 - 60% of bitrate.
So, with mono, don't use --ms 15.



Then he tells, that he gets averaged 2 mails (unfortunetaly he does not tell: 2/day, 2/week, 2/month, 2/year, lol) from people, who do those silly bad listening descibed in my previous post:
Listening only to difference signals, or only to rear speakers is total crap !

Do not bother Mr. Klemm with such "experiences" again, please !

Mpc Quality Settings For Dolby 2.1 Streams

Reply #20
Hi folks.  As is implied in my earlier tests, I DID test using just the delta between the left and right channels.  This was done for the simple reason that I lack the equipment at my computer to do proper ABX tests on surround samples, and that I believed it to be an easier method to identify the artefacts.

HOWEVER - The original investigation was prompted by artefacts observed through normal listening of the same album on a surround-capable system on MP3's encoded to approximately 192kb/s.

ALSO - As stated in my findings earlier in this thread, on (--quality 6) or (--quality 5 --ms 15), the artefacts are as close to inaudible as could be hoped for even with the "silly" method of testing.

--quality 5 still yields unacceptably high artefact levels for surround recordings, akin to MP3 encoding BELOW 192kb/s.

For the moment, I have switched to --quality 6 for all encodings.  This solves my problem with sorround channels and also provided me with a feeling of (apparent?) safety for transcoding to MP3 for my portable.

Atom

P.S. - I have since embarked on a two year traveling stint, and am unfortunately not able to perform further advanced tests.  So is there anybody out there that are willing to take on --ms 13 and/or do further subjective listening tests on a surround system?

Mpc Quality Settings For Dolby 2.1 Streams

Reply #21
hmmm, i have about 15 gigs of mpcs (mostly), and not a single 'surround' recording.  am I missing something?

Mpc Quality Settings For Dolby 2.1 Streams

Reply #22
please correct me if i am wrong but, just because you dont have a "surround" recording doesnt necessarily mean that your recordings dont contain any surround information.

Mpc Quality Settings For Dolby 2.1 Streams

Reply #23
Uhm..
Dolby Surround is just 2 channels where you fuck up the phases until you've shortcircuited all of them to get the differences. it's really crap if you compare it to anything else.
Build ambisonics instead

Mpc Quality Settings For Dolby 2.1 Streams

Reply #24
Quote
please correct me if i am wrong but, just because you dont have a "surround" recording doesnt necessarily mean that your recordings dont contain any surround information.

there has been another thread on this topic I believe.

anyway, while all music will likely output -something- to the rear channels through a dolby pro logic decoder, it was almost never intended to be there by the artists or sound engineers (i'd be curious to know any album that actually intended it).  Therefore you can get some wacky sounds, most of the time that aren't worth preserving.