Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2pass? #68

Open
zvezdochiot opened this issue Apr 15, 2020 · 7 comments
Open

2pass? #68

zvezdochiot opened this issue Apr 15, 2020 · 7 comments

Comments

@zvezdochiot
Copy link

2- and more- pass coding, like nero?

@rillian
Copy link
Contributor

rillian commented Apr 16, 2020

I don't know of anyone working on 2-pass rate control for Vorbis.

Can you share a use case for this? Usually two-pass is used to maximize quality within a strictly limited number of bytes, but vorbis is transparent at any current media readout or broadband streaming bitrate.

@zvezdochiot
Copy link
Author

zvezdochiot commented Apr 16, 2020

It is not so easy to answer your question.

Additional regulators (multipliers) are introduced into the coding system, initially equal to 1. Depending on where they are entered, the corresponding statistics are collected on the first pass. There is also a flag system that determines which regulatorswill be enabled. Based on statistics, the values of the regulators are calculated. In general, this system is empirical in nature and cannot be fully described using a certain theory.

PS: For stability, the values of the regulators are usually calculated by delta-functions:

regulator =  (freg) ? (1.0f + min(abs(f(stat)),deltaMax)*sign(f(stat))) : 1.0f;

@zvezdochiot
Copy link
Author

zvezdochiot commented Apr 16, 2020

ℹ️ The general meaning of multi-pass coding: to partially transfer control of the coding process to the sound itself (feedback).

PS: Multi-pass is no magic.

@rillian
Copy link
Contributor

rillian commented Apr 16, 2020

I understand what 2-pass encoding is. I do not understand why you want it for vorbis. Can you explain why it would be good?

@zvezdochiot
Copy link
Author

zvezdochiot commented Apr 16, 2020

Encoding, in which nothing is known about the encoded signal, in no way can have little bad. Only the encoding of a known signal (statistics accumulated) can have little bad.

PS: little bad != best || good

@rillian
Copy link
Contributor

rillian commented Apr 17, 2020

Well yes, but as you say, multi-pass encoding is not magic. It doesn't make every encoding better.

Two passes are only helpful to adjust the bitrate for different sections to meet some external constraint. That's typically only useful for video because video data is so large, so one might want either to avoid overwhelming someone's network bandwidth, or to exactly fill some distribution medium like a video disk. Those constraints mean video is often compressed so heavily that it's visible. You really are trying to spread around the bad so it's less noticeable.

What the current vorbis encoder does instead is just to make the file a little bigger for every piece that is harder to encode. This works fine since audio is so much smaller. Why doesn't that work for you?

@zvezdochiot
Copy link
Author

This "good" only works at high bitrates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants