Help - Search - Members - Calendar
Full Version: WMA 2-Pass CBR Encoding
Hydrogenaudio Forums > Lossy Audio Compression > Other Lossy Codecs
sjbale
Hi,

If I record an audio file from CD using 2-pass WMA 9 encoding at 128 Kbps will this provide a significant quality boost when compared with a single pass file? How does this increase in quality compare when the single pass file is at a higher bit rate? I've been told that a 2-pass 128 Kbps file is equivalent to a single pass file at 256 Kbps, is this correct?

Best Regards, Simon.
sketchy_c
Please note that my feedback is not specific to WMA but my understanding of 2-pass encoding in general. Also note that most of it is theoretical.

2-pass is useless for CBR, where every second of audio takes up the same amount of bandwidth (Constant Bit Rate). 2-pass is more appropriate for ABR (Average Bit Rate). In this process, the first pass scans the entire file and uses the information during the second pass. The end-file should have a similar size to CBR, but the bits are distributed more intelligently across the file.

2-pass ABR should be a higher quality file than a CBR file of the same average bitrate. There's no easy formula (AFAIK) to say that 2-pass 128 ABR is equivalent to a CBR file of XXX bitrate. The best way to measure that is to listen for yourself. In my humble opinion, I would say the "128 2-pass = 256 CBR" claim is pretty outrageous, but I have no test data to back that up.

From the sounds of your question, you have a quality goal in mind. If so, it may be worth exploring VBR settings as well if quality is more important that a consistent, expected filesize.
LANjackal
QUOTE(sjbale @ Apr 23 2007, 08:51) *
If I record an audio file from CD using 2-pass WMA 9 encoding at 128 Kbps will this provide a significant quality boost when compared with a single pass file? How does this increase in quality compare when the single pass file is at a higher bit rate? I've been told that a 2-pass 128 Kbps file is equivalent to a single pass file at 256 Kbps, is this correct?
Your questions are honestly difficult to answer accurately as there haven't been any listening tests for WMA 9.2 Std.

However, it would be reasonable to expect that 2 pass should give a quality boost vs. 1 pass BUT not as much as doubling the 1 pass bitrate.
greynol
I would not go so far as to say that 2-pass for CBR is useless. If it was, then why would it be presented as an option?

Without commenting on quality, it should be easy enough to see if a CBR file encoded using a single pass is different than one encoded using two passes.

I agree with LANjackal: I seriously doubt you're going to get 256kbit single-pass performance by using 2-pass at 128kbit!
Junon
Have a look here:

QUOTE(quas)
EDIT 2: Maybe Microsoft is just crazy: "With CBR encoding, the bit rate of the file or stream remains fairly constant and close to the target bit rate over the course of the stream." So their two-pass CBR is actually VBR which averages, over the length of the file, to the exact specified bitrate; their bitrate-based VBR is equivalent to everyone else's ABR. I think I'm unconfused now. smile.gif

This should explain the reason for providing 2-pass CBR encoding, though it's unlikely that the little variation of the bitrate justifies the time-consuming usage of a 2nd pass.

Besides, is there any serious reason for the OP to use CBR encoding? If it was for streaming purposes peak bit rate-based ABR (which is called "peak bit rate-based VBR" in Microsoft's encoder) might be the better option. It provides better quality than CBR mode and resolves the issue of bitrates possibly exceeding certain bandwidth-related limitations.
Woodinville
QUOTE(Junon @ Apr 23 2007, 10:35) *

Have a look here:

QUOTE(quas)
EDIT 2: Maybe Microsoft is just crazy: "With CBR encoding, the bit rate of the file or stream remains fairly constant and close to the target bit rate over the course of the stream." So their two-pass CBR is actually VBR which averages, over the length of the file, to the exact specified bitrate; their bitrate-based VBR is equivalent to everyone else's ABR. I think I'm unconfused now. smile.gif

This should explain the reason for providing 2-pass CBR encoding, though it's unlikely that the little variation of the bitrate justifies the time-consuming usage of a 2nd pass.

Besides, is there any serious reason for the OP to use CBR encoding? If it was for streaming purposes peak bit rate-based ABR (which is called "peak bit rate-based VBR" in Microsoft's encoder) might be the better option. It provides better quality than CBR mode and resolves the issue of bitrates possibly exceeding certain bandwidth-related limitations.


Well, actually, 2-pass CBR allows much better buffer control.

Any assumption of "little variation" needs to be demonstrated, too.
Junon
QUOTE(Woodinville @ Apr 24 2007, 01:57) *
Any assumption of "little variation" needs to be demonstrated, too.

I don't think so. Since the variation is negligible enough for Microsoft to still call this mode "constant bit rate" I guess it's safe to say that there's no serious need to back this assumption up.

Edit: Hm, maybe it is... now which company is the one claiming that 64 kbps WMA 9 were close to CD quality?
sketchy_c
QUOTE(Junon @ Apr 24 2007, 11:41) *

Since the variation is negligible enough for Microsoft to still call this mode "constant bit rate" I guess it's safe to say that there's no serious need to back this assumption up.

Edit: Hm, maybe it is... now which company is the one claiming that 64 kbps WMA 9 were close to CD quality?

DING! wink.gif

On the other hand, the link quas posted differentiates two-pass CBR from the three VBR formats: quality-based, bitrate-based, peak bitrate-based. Little (or at least "less") variation would also be my first guess at a distinction.

From here:
QUOTE
Standard CBR uses only a single encoding pass. You provide your content as input samples, and the codec compresses the content and returns output samples. It is also possible to process input samples twice. On the first pass, the codec performs calculations to optimize encoding for your content. On the second pass, the codec uses the data gathered during the first pass to encode the content.

Two-pass CBR encoding has many advantages. It often yields significant quality gains over standard CBR encoding without changing any of the buffering requirements. This makes this encoding mode ideal for content that is streamed over a network. The only situation where two-pass CBR is not feasible is when you encode content from a live source and cannot use a second pass.

The output media type of a two-pass CBR stream is identical to that of a standard CBR stream; you still specify the bit rate and buffer window to use. When configuring the DMO, you must set it to perform two passes. And you must notify the DMO when you are finished sending samples for the first pass.

I just don't get how it can be called CBR if a second pass provides added benefit. Can the same number of bits be used against a single frame differently (more efficiently perhaps)?
pdq
If every frame is the same size (my definition of CBR) then the only variable left is the use of the bit reservoir. Assuming that the bit reservoir only extends over a few frames then all that is needed for "2-pass CBR" is to look ahead this number of frames to determine how to allocate the bit reservoir in the current frame, thus giving "2-pass CBR" in real time.
Sebastian Mares
Could be something like the bit reservoir in MP3 and a using a second pass can improve how bits are allocated there if that is what is meant by "buffering".
Woodinville
QUOTE(Junon @ Apr 24 2007, 03:41) *

QUOTE(Woodinville @ Apr 24 2007, 01:57) *
Any assumption of "little variation" needs to be demonstrated, too.

I don't think so. Since the variation is negligible enough for Microsoft to still call this mode "constant bit rate" I guess it's safe to say that there's no serious need to back this assumption up.


Really, now.

And exactly how did you document the instantaneous (block by block) bit rate, pray tell?

QUOTE(pdq @ Apr 24 2007, 09:56) *

If every frame is the same size (my definition of CBR)



So then you conclude that there is absolutely no MP3 that is CBR?

No AAC bitstream?

NOTHING is CBR that's in common use, except perhaps oddities like OG that I know nothing about, by your definition.
Junon
I don't feel like providing any proof for guesses based on the Microsoft statements quoted by quas earlier.

QUOTE(quas)
"With CBR encoding, the bit rate of the file or stream remains fairly constant and close to the target bit rate over the course of the stream."

If that's not sufficient in your eyes, so be it.
Woodinville
QUOTE(Sebastian Mares @ Apr 24 2007, 10:04) *

Could be something like the bit reservoir in MP3 and a using a second pass can improve how bits are allocated there if that is what is meant by "buffering".


Well, perhaps one might want to mitigate starvation situations mostly. This is, actually, just a guess.

QUOTE(Junon @ Apr 24 2007, 10:56) *

I don't feel like providing any proof for guesses based on the Microsoft statements quoted by quas earlier.

QUOTE(quas)
"With CBR encoding, the bit rate of the file or stream remains fairly constant and close to the target bit rate over the course of the stream."

If that's not sufficient in your eyes, so be it.



So, in other words, the Microsoft statement does not agree with your own interpretation, but you will still stick to your own interpretation when regarding their software.

I understand very, very clearly what you're saying, indeed.
Junon
I've never claimed the opposite to Microsoft's official statements, it's "fairly constant" vs. "little variation". Both are analogue to each other, a newspaper article that's only fairly correct is in fact a little erronous. Buffering as well as the bitrate reservoir mentioned by Sebastian Mares weren't taken into account in my statement, because actual information about these two points isn't available in the material linked to by quas. With this information lacking I can only conclude that the usage of 2-pass encoding is rather questionnaible, especially since ABXing two samples using foobar's ABX tool didn't provide any useful results. I couldn't tell the difference between 1-pass and 2-pass CBR in both of these samples. Maybe someone else could - if yes, this would justify the two passes, no matter what theoretical advantages they actually provided compared to single pass encoding.

QUOTE(Woodinville)
So, in other words, the Microsoft statement does not agree with your own interpretation, but you will still stick to your own interpretation when regarding their software.

I understand very, very clearly what you're saying, indeed.

My "own interpretation" about "their software" is of no concern to you, because we're discussing about an individual case here, not their software in general. Don't even try to generalize anything based on individual cases. It's pointless.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.