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: Musepack highest possible "singled-out" bitrate (Read 1826 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Musepack highest possible "singled-out" bitrate

Tinkering over the weekend with Foobar2000’s option for how frequently the %bitrate% field updates in a playlist (at least in Columns UI), the high numbers I saw for each "sample" (not the audio's real sample rate, of course) for Musepack files—some reaching over 800 Kbps for certain Big Audio Dynamite tracks at certain points - got me curious about Musepack's theoretical maximum bitrate for 16-bit, 44.1-kHz stereo audio. It’s not limited to PCM's 1,411 Kbps ceiling, right?

To easily spot high bitrates (it was a rainy weekend, mind you), I wrote a quick style script that greys out all bitrates until they cross a set threshold - roughly above 224 Kbps for classical music (bar violin solos and high pitched soprano's arias), 256Kbps for hard rock; even higher for electronic/sampled music and son on. Suffice to say said numbers are at random, but still reflecting my own MP3-derived way when thinking about bitrates, but in Musepack's case any number around those values would be okay, of course.

Pretty sure that if using other lossy CODECS with real variable bitrate (sorry MP3!) such as AAC, Vorbis set a HQ mode, that would also yield similar results. But heck, I'm content with MPC -extreme as it is - both in terms of quality and for this experiment's purpose, hence my posting this doubt here.

Naturally, the 100-update-per-second setting doesn’t come close to reflecting the actual 44,100 frames churned out each second by the decoder... Still, I find it offers a far better refresh rate than Foobar2000’s default of around three updates per second, making it more of a useful approximation of whatever foo_mpc's output is at any given moment.

[Edit] As there's nothing about it I couldn't find anything about it in the Musepack documentation, I wonder if I can count on anyone's expertise down here to get this answered.

Thanks.
How I stopped worrying and returned to loving lossy encoding again?
By listening to music, not the media it's on.

"União e reconstrução"

Re: Musepack highest possible "singled-out" bitrate

Reply #1
what do you mean by "possible"?
MPC has fine-tunable parameters that can go (much) higher than their values in the standard "maximum quality" (10) preset,
I remember I tried to push some of them to the extreme levels just for fun and IIRC that made it easily go over 1411 (on average!) on any kind of content.
I don't remember exactly though, it was a while ago.

Here's a table taken from the encoder source code that defines all presets, some of these individual values have max/min limits way further than with preset 10:

Code: [Select]
 	/*    Short   MinVal  EarModel  Ltq_                min   Ltq_  Band-  tmpMask  CVD_  varLtq    MS   Comb   NS_        Trans */
  /*    Thr     Choice  Flag      offset  TMN   NMT   SMR   max   Width  _used    used         channel Penal used  PNS    Det  */
  { 1.e9f,      1,      300,       30,    3.0, -1.0,    0,  106,   4820,   1,      1,    1.,      3,     24,  6,   1.09f, 200 },  // 0: pre-Telephone
  { 1.e9f,      1,      300,       24,    6.0,  0.5,    0,  100,   7570,   1,      1,    1.,      3,     20,  6,   0.77f, 180 },  // 1: pre-Telephone
  { 1.e9f,      1,      400,       18,    9.0,  2.0,    0,   94,  10300,   1,      1,    1.,      4,     18,  6,   0.55f, 160 },  // 2: Telephone
  { 50.0f,      2,      430,       12,   12.0,  3.5,    0,   88,  13090,   1,      1,    1.,      5,     15,  6,   0.39f, 140 },  // 3: Thumb
  { 15.0f,      2,      440,        6,   15.0,  5.0,    0,   82,  15800,   1,      1,    1.,      6,     10,  6,   0.27f, 120 },  // 4: Radio

  {  5.0f,      2,      550,        0,   18.0,  6.5,    1,   76,  19980,   1,      2,    1.,     11,      9,  6,   0.00f, 100 },  // 5: Standard

  {  4.0f,      2,      560,       -6,   21.0,  8.0,    2,   70,  22000,   1,      2,    1.,     12,      7,  6,   0.00f,  80 },  // 6: Xtreme
  {  3.0f,      2,      570,      -12,   24.0,  9.5,    3,   64,  24000,   1,      2,    2.,     13,      5,  6,   0.00f,  60 },  // 7: Insane
  {  2.8f,      2,      580,      -18,   27.0, 11.0,    4,   58,  26000,   1,      2,    4.,     13,      4,  6,   0.00f,  40 },  // 8: BrainDead
  {  2.6f,      2,      590,      -24,   30.0, 12.5,    5,   52,  28000,   1,      2,    8.,     13,      4,  6,   0.00f,  20 },  // 9: post-BrainDead
  {  2.4f,      2,      599,      -30,   33.0, 14.0,    6,   46,  30000,   1,      2,   16.,     15,      2,  6,   0.00f,  10 },  //10: post-BrainDead
a fan of AutoEq + Meier Crossfeed

Re: Musepack highest possible "singled-out" bitrate

Reply #2
what do you mean by "possible"?
Yeah, thinking in retrospect "the proof was in the source code" not the documentation! Silly me!
Edit: though I wouldn't know where to look at precisely (Care to explain to this layman the 3rd column, please?)

I should've also mentioned I specifically meant the more pedestrian "standard" or "-extreme" settings.

Thanks a lot.


PS: on a totally different note... regarding your sig, I also vouch for Meier Crossfeed but should definitely try my hand at auto EQ.  ;) 
Thanks again, @magicgoose
How I stopped worrying and returned to loving lossy encoding again?
By listening to music, not the media it's on.

"União e reconstrução"

Re: Musepack highest possible "singled-out" bitrate

Reply #3
Naturally, the 100-update-per-second setting doesn’t come close to reflecting the actual 44,100 frames churned out each second by the decoder...
But you're measuring the input bitrate, not the output bitrate. There are fewer than 100 Musepack frames per second, so 100 updates per second is enough.

Re: Musepack highest possible "singled-out" bitrate

Reply #4
Naturally, the 100-update-per-second setting doesn’t come close to reflecting the actual 44,100 frames churned out each second by the decoder...
But you're measuring the input bitrate, not the output bitrate. There are fewer than 100 Musepack frames per second, so 100 updates per second is enough.
Is that so? Boy! How much have I missed on not properly "getting" all this!

Care to expand on it, please? Or just point me out to further reading, if you will.
How I stopped worrying and returned to loving lossy encoding again?
By listening to music, not the media it's on.

"União e reconstrução"

Re: Musepack highest possible "singled-out" bitrate

Reply #5
> Edit: though I wouldn't know where to look at precisely (Care to explain to this layman the 3rd column, please?)

I only have a vague and imprecise understanding of some of them, but sadly not the 3rd column.
I didn't write any of this code, and spent only very little time trying to make sense of some parts of it.
Btw, documentation (--longhelp and whatever is left online) can also provide some clues.
a fan of AutoEq + Meier Crossfeed

Re: Musepack highest possible "singled-out" bitrate

Reply #6
got me curious about Musepack's theoretical maximum bitrate for 16-bit, 44.1-kHz stereo audio. It’s not limited to PCM's 1,411 Kbps ceiling, right?

According to Andree Buschmann (Musepack first developer) in former FAQ:

Quote
What are the minimum and the maximum bitrates supported by mp+/mpc?
The encoder can theoretically use bitrates up to 1.32 MBit/sec. Normally such high bitrate will not occure. The minimum bitrate is used for zero-samples and will reach about 3.4 kbit/s.

source:
https://hydrogenaud.io/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/audiocoder_english.html
Wavpack Hybrid: one encoder for all scenarios
WavPack -c4.5hx6 (44100Hz & 48000Hz) ≈ 390 kbps + correction file
WavPack -c4hx6 (96000Hz) ≈ 768 kbps + correction file
WavPack -h (SACD & DSD) ≈ 2400 kbps at 2.8224 MHz

Re: Musepack highest possible "singled-out" bitrate

Reply #7
Care to expand on it, please? Or just point me out to further reading, if you will.
Most audio codecs - including Musepack - encode multiple samples in each frame, and they do it in a way that makes it impossible to decode individual samples without decoding the entire frame, so you can't really measure bitrate on units smaller than whole frames.

Musepack encodes 1152 samples in each frame. With a 44.1kHz sample rate, that means about 38.3 frames per second.

Re: Musepack highest possible "singled-out" bitrate

Reply #8
Btw that's a link to SV7 spec, which is not the latest. But it must be the same in SV8, or else lossless conversion sv7->8 wouldn't be possible.
Also isn't it cool how so many parameters are adjustable? If you find a sample that really bothers you, it could be possible to find a specific knob that might make it transparent for relatively cheap bitrate-wise.
Assuming you don't accidentally break the math somewhere if there are some edge cases.
a fan of AutoEq + Meier Crossfeed

Re: Musepack highest possible "singled-out" bitrate

Reply #9
Btw that's a link to SV7 spec, which is not the latest. But it must be the same in SV8, or else lossless conversion sv7->8 wouldn't be possible.
Also isn't it cool how so many parameters are adjustable? If you find a sample that really bothers you, it could be possible to find a specific knob that might make it transparent for relatively cheap bitrate-wise.
Assuming you don't accidentally break the math somewhere if there are some edge cases.

Actually a TOTAL transparency bitrate usually isn't above ≈320kbps. Hard samples can sometimes go above ≈400kbps.
You just need to play with TMN/NMT and LTQ in Q6/7.

I mean this for very high quality, where Vorbis and AAC aren't still good enough, but the three are quite transparent to the ear. I just propose so high bitrate to retain as details as possible without using a lossless codec. That's the real purpose of Musepack, and sadly it doesn't support Multichannel, otherwise it would be a quite good alternative to the DTS/AC3 codecs. :-\

And... yes, is pretty cool that Musepack is flexible, you can adjust the options as you want. Anyway, it's only useful above 160kbps, below that bitrate other codecs are much better. Below 100kbps Musepack quality is seriously a huge problem.

Two additional notes:
A "problem" is that Musepack is quite unpredictable... or for make it clear, it's too variable depending what's the material to encode, you can check it with some samples posted here and there in HydrogenAudio. So, maybe you will need to have a set of some "transparent" presets to choose the best for some files.
The other problem is that Musepack is poor for pure tones, as Opus. Isn't an important problem for real things (music, voice, etc), but I let it as a small notice.

Re: Musepack highest possible "singled-out" bitrate

Reply #10
Btw that's a link to SV7 spec, which is not the latest. But it must be the same in SV8, or else lossless conversion sv7->8 wouldn't be possible.
Must be the same or more  ;)


sadly it doesn't support Multichannel, otherwise it would be a quite good alternative to the DTS/AC3 codecs. :-\
Technically maybe, but practically not. Lack of momentum and userbase is a big thing for a lossy codec. For a lossless codec ... if support wanes, you can ditch it, losslessly.

If your portable device supports Musepack, it is good for your own disposable transcodes. Be prepared to ditch them when you retire the playback device.

Re: Musepack highest possible "singled-out" bitrate

Reply #11
Most audio codecs - including Musepack - encode multiple samples in each frame, and they do it in a way that makes it impossible to decode individual samples without decoding the entire frame, so you can't really measure bitrate on units smaller than whole frames.

Musepack encodes 1152 samples in each frame. With a 44.1kHz sample rate, that means about 38.3 frames per second.
Thank you for that!
All of this kept me wondering if the reported 10-milissecond encoding/decoding latency would only add up to the aforementioned bitrate's accuracy not being that "accurate".

Btw that's a link to SV7 spec, which is not the latest. But it must be the same in SV8, or else lossless conversion sv7->8 wouldn't be possible.
The link to SV8's is just a character-replacement away:

http://trac.musepack.net/musepack/wiki/SV8Specification
How I stopped worrying and returned to loving lossy encoding again?
By listening to music, not the media it's on.

"União e reconstrução"

 

Re: Musepack highest possible "singled-out" bitrate

Reply #12
I only have a vague and imprecise understanding of some of them, but sadly not the 3rd column.
Thanks. That's food for thought anyway. (edit: as per GPT's take on it, they're parameters for the psychoacoustic model - which in fact doesn't say much, does it?)


Quote
I didn't write any of this code,
Unless you are Andree Buschmann or Frank Klemm we all knew that.  ;)


Quote
spent only very little time trying to make sense of some parts of it.
Me too. Though I got as far as putting some of it through its paces on ChatGPT (which impressed me as how clarifying it actually was)
How I stopped worrying and returned to loving lossy encoding again?
By listening to music, not the media it's on.

"União e reconstrução"