Slashdot Mirror


Bitrate Peeling with Ogg Vorbis

Yort writes "Thought this might be interesting to some audiophile /.ers - there's been some discussion on the Ogg Vorbis lists, summarized in the most recent Ogg Traffic, about "bitrate peeling". In short, it's where you can simply "peel off" the high resolution data from the ends of an audio stream packet to come up with a smaller, lower quality stream. Brings up a number of geek-cool opportunities."

22 of 378 comments (clear)

  1. Re:Wow by hero · · Score: 5, Funny

    That may be true if it were peeling off the copyright instead of the bitrate.

    Though it does sound like a pretty cool way to downsample a stream.

    -hero.

  2. Handy for porting your music to a portable player by Anonymous Coward · · Score: 4, Insightful

    I don't know of any that play Vorbis files yet, but it would be very handy if I could take an OGG I had encoded at a high bitrate (for playback on my nice home stereo) and make it smaller for use on a walkman-type player for the gym or whatever.

  3. good idea, but... by ameoba · · Score: 4, Informative

    Bitrate peeling is a briliant idea, and would be a major win for Vorbis if they ever actually provide an implementation of it. It's something that the format supposedly supports, but right now it's still just a hypothetical application.

    Let me know when they've got something working THEN I'll be impressed

    --
    my sig's at the bottom of the page.
  4. And one more small improvement on that... by Eric_Cartman_South_P · · Score: 4, Insightful
    ...having the Sync app automatically put the space saving lower bitrate file on the portable! Sweet. Of course, iPod'ers with 20 gig drives wouldn't lose sleep over it, but anyone with a Palm T or Sony NVxx would LOVE this.

  5. Audiophiles? by Pinball+Wizard · · Score: 4, Informative
    So who out there is an audiophile and listens to compressed streams of music?

    Lately I've been finding all I can download off P2P programs like Direct Connect and Furthurnet. Its mostly live shows, and they are all in .shn format, which is a lossless compression format that restores to the original .wav file.

    These communities shun both compressed files like .mp3 and trading anything that has been released commercially. What you do get is great recordings of live music from bands like U2, DMB, Grateful Dead, etc., all ethically traded and in their full audio glory.

    The audiophiles I know pretty much don't listen to mp3, ever.

    --

    No, Thursday's out. How about never - is never good for you?

    1. Re:Audiophiles? by Pieroxy · · Score: 5, Interesting

      Well, you should try then one simple test, that I did for myself and my friends. I just ripped a track of one of my favorites CD and encoded it with my favorite MP3 encoder (lame) to 160, 192, 256 kbps. I then burned a new CD-R with four tracks (original, 160, 192 and 256) in a random order. Since then, I'm looking for someone to be able to put those tracks in the right order.

      No one has been able to until then, and I'm not only talking (only) about average people. I have some friends which (unlike me) have a decent equipment.

      Usually these guys were able to clearly distinguish 160kbps from the set. With 2-3 pass they detected the 192kbps track and they couldn't tell the difference between the 256kbps and the original.

      Maybe I could send you guys some samples...

      Just keep in mind also that MP3 is the same type of compression than DTS & AC3 (Dolby Digital) and I've never heard someone complain about those (especially DTS). If you're unhappy with quality, just increase bitrate. And if those guys in the MPEG consortium felt that 320kbps should be the maximum, It should mean something.

      Lossless compressors have such a poor ratio!

    2. Re:Audiophiles? by Monkelectric · · Score: 5, Informative
      I am a certified audiophile... High bit rate mp3 are very difficult to tell from the original... however most mp3s are made by amateurs with bad encoders that are *crap*.

      Before encoding my cd collection I spent a month playing with different encoders and settings to find what might satisfy my ears. I eventually settled on lame with the "new vbr method" and the highest quality settings and I've been very happy with the results. If something better comes along, I'll get my CDs out from under my bed and re-encode :) The only time I've been able to tell one of my mp3s from the CD is on albums I am intimately familiar with, i.e. the Steely Dan Box set. I have easily heard it 500 times, and every once in awhile you notice the timbre of a cymbal is just a little bit different then you remembered it.

      However, something no one ever thinks about is your mp3 *player* and sound card. An internal sound card is worthless for listening to music (I use a M-Audio Delta1010 which is part of my studio setup). Also the mp3 player makes a *huge* difference. It will probably come as no surprise that Winamp is shit. I like CoolPlayer which is based on libmad -- a 24 bit integer only mp3 decoder. The extra bits are important because they reduce quantization errors during decoding, there is a noticeable difference in clarity between coolplayer and winamp. Also, standalone MP3 players tend to have better mp3 decoding because they (usually) use a DSP to decode the and DSP programmers are well aware of accuracy issues.

      My point is, mp3 is tolerable for casual listening even to an audiophile *IF* it's done correctly. The problem of course is that the computer is about the *worst* place to be listening to music because its at such a disadvantage (poor quality signals, noisy electronics, bad DACs, shitty speakers).

      However, your need for a higher quality signal is directly proportional to the cost of your stereo. If you have a small portable stereo, the radio is about the best quality you can reproduce anyways. The quality of mp3's is superior to what the average computer can reproduce. But If you have a 30,000$ stereo as some obsessive audiophiles do, its pretty silly to listen to mp3s on it (but you're gobbling up dvd-audio discs as fast as they are made anyways).

      --

      Religion is a gateway psychosis. -- Dave Foley

  6. Stripping data, eh? by radiumhahn · · Score: 5, Funny

    I always kind of felt the first and third bit of every byte were kind of unnecessary. I'm not to fond of the F6 key either!

  7. Alternative use.. by irc.goatse.cx+troll · · Score: 5, Interesting

    "Beni Cherniavsky mentioned a very intriguing counterpart to bitrate peeling. If you have a peeler that saves the bits it chopped off, you could reconstitute the higher quality files by adding the missing bits to the lower quality file. This idea could lead to a music download service where you can download a low quality preview version of a song, and if you are interested, download the missing bits to make it a high quality version."

    Or, Slightly modified, You could share all your high quality oggs on a P2P network, and have your client peel it down to 'future-legal-to-share' low quality files.

    --
    Pain lasts, kid. Its how you know you're alive. Sometimes I think this growing up thing is just pain management-TheMaxx
    1. Re:Alternative use.. by david.given · · Score: 5, Insightful
      "Beni Cherniavsky mentioned a very intriguing counterpart to bitrate peeling. If you have a peeler that saves the bits it chopped off, you could reconstitute the higher quality files by adding the missing bits to the lower quality file. This idea could lead to a music download service where you can download a low quality preview version of a song, and if you are interested, download the missing bits to make it a high quality version."

      Or, even more interesting: peel a Vorbis file all the way down to the minimum quality. Concatenate the bits together in order. Now you have a file that you can play back, in its entirety, when it's only 10% downloaded. All you have to do is wait for the minimum quality version to download; from then on, the entire file is playable. It's just that the longer you wait, the more peels get added, the higher the quality... holographic audio downloading.

    2. Re:Alternative use.. by Jahf · · Score: 5, Informative


      Holographic? No. Progressive (similar to progressive JPEG)? Yes.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
  8. Handy? Nah, Perfect! by donutz · · Score: 5, Insightful

    This is exactly the killer app that Ogg needs for acceptance: a program that syncs songs to your portable player at a lower (user adjustable) bitrate. Even better: You pick out X number of songs. Each time you add a song, it re-calculates what bitrate to shave them all to, to maximize the bitrate used, thereby using all the RAM on the player but getting all your songs in.

    I can't wait til this one hits.

    1. Re:Handy? Nah, Perfect! by rseuhs · · Score: 4, Informative
      this is not an ogg specific killer app... substitue ogg_to_bitrate(); with mp3_to_bitrate(); and your killer app will work for the 'competition'

      No, mp3 would have to be reencoded, which would make the quality much worse and would take a lot of time.

      When I want to put music into my player, I want it now, I don't want to wait 1-2 hours.

  9. Audiophiles? by usr122122121 · · Score: 5, Funny

    Musi withou hig frequenc is lik wods mising leters.

    --

    -braxton
  10. This reminds me... by dubious9 · · Score: 5, Funny

    of a Slashdotter comment that twisted an old expression...

    "Those who sacrafice sound quality for hard disk space deserve neither."

    Cool idea to throw around though.

    --
    Why, o why must the sky fall when I've learned to fly?
  11. Peeling! by Emmettfish · · Score: 5, Interesting
    Okay, I'm biased in this discussion: I am the CEO of Xiph.org and I'm also a musician.

    One thing that hasn't been discussed here is that a lot of people feel that Vorbis is transparent at something like quality setting 4. Other people think it's transparent at quality setting 3. Others think it's great at 1. I release my stuff at 4, but bitrate peeling will let people peel those down to what sounds good to them. Maybe they want to monkey with it, and maybe they don't, but the option to do this without re-encoding is sexy.

    It's not just a 'chop it down for modem folks' thing, it's also a letting people choose for themselves situation that I think is more important.

    Features are cool, but features that give people options apart from 'use it or not' are even cooler.

    That's it for me. Please donate to Xiph.org, and then go listen to some tunes. Enjoy!

    1. Re:Peeling! by Jucius+Maximus · · Score: 5, Informative
      "Please donate [vorbis.com] to Xiph.org, and then go listen [diff-eng.net] to some tunes. Enjoy!"

      I really would like to donate, but not through PayPal. Could you please offer some other method of payment like the Amazon Honour System or Element5?

  12. Cool, but not unique by benwaggoner · · Score: 5, Interesting

    Scalable techniques like this are very cool, but hardly novel.

    MPEG-4's scalable profiles provide a similar effect (albeit in the other direction, with enhancement layers). Some of the higher end audio codecs (beyond CELP and AAC), like ER BSAC (Error Resistant Bit Sliced Arithmetic Coding) do exactly this. The idea in this case is that the server will in real-time only provide as many bits as the connection can currently provide. Very nice for wireless.

    QDesign's QDX format does almost exactly what is described for Ogg, with arbitrary bitrate peeling down to the 1 Kbps level. The idea is that you could copy as much data as you want to your mobile player, and it'd dynamically thin to the data rate that would fill up your device.

    And still image codecs like JPEG have used progressive modes for years, where additional data adds more detail to the image.

  13. All these anti-peeling posters are retarded! by Ayanami+Rei · · Score: 5, Interesting

    There aren't ANY free lossy codecs that can do bit-peeling right now. Some non-free codecs allow you to overlay data (like progressive JPEG), which is NOT the same thing. That's just like transmitting deltas at higher compression rates, which could be done with a simple side-band for any existing method, MP3 even.
    The only option is transcoding, which compounds compression errors (decode, reencode). I often wished the MPEG group would have been more intelligent in the design of their bit-allocater so that you could "thin out" the quantization of the power bands by looking at the "right parts" of the MP3 frame. Alas, this is not possible.

    But the Vorbis designers have made this possible, thus making it possible to have high-quality and low-quality versions derived from the same source file without additional processing. I imagine you have certain restricted choices, due to how quantization information is bundled up/packeted. But it isn't just sexy, it would be stupid to NOT DO IT. It takes just a little forethought on how to lay out the information in a hierarchial fashion. What makes anyone think that this is any harder then decoding/reencoding. I guarantee it has a time complexity on the order of a straight copy.

    Hell, formats like SHN and FLAC can do it, just substitute short codes for long codes at a certain rate; it'll add a bit of wide-band energy on decode, raising the noise floor in proportion to the space savings you gain.

    So anyway, "poop on you" to all these wanna-be audiophiles/slashdot-know-it-alls who don't no a good thing when they see it.

    Don't like it, keep sucking on that Layer III.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  14. Yes, it is a very good idea. by HopeOS · · Score: 5, Insightful

    There are a number of problems with the parent post.

    1. Keeping hundreds, or even ten separate files as described, each half the size of the previous, is not plausible. I'd assume the author was a troll, but since no one else has mentioned it, perhaps the obvious fallacy with that idea is slipping past even the sharper readers. A 10MB file can be split in half at most 23 times before it is only 1 byte long, far fewer before the quality level is unacceptable. Secondly, the idea described in the article, provides for dynamic bitrates, not simply half the original bitrate. To provide even similar functionality, one would need files in ranges from 1MB to 10MB in relatively small increments, totaling well in excess the "twice the size of the largest file" as suggested. Even so, this would be deficient in that the bandwidth could not be throttled mid-stream.

    2. Second, decoding and re-encoding the same file with a different bit rate will almost certainly result in poorer quality than the technique described. The safer, more straightforward solution, is to perform reduction operations on the transformed data, rather than the decompressed waveform. Otherwise, amplified artifacts from the original compression will be present in the new file.

    3. Third, the strength of the poster's argument lies entirely in the choice of ratios. Downloading a 5MB file rather than a 10MB file leaves only 5MB remaining. To paraphrase, are you really going to opt to download the 10MB complete version when your software can download the remaining 5MB in half the time?

    There are a number of problems which bitrate peeling address, not the least of which are 1) reduction of storage space as described previously, 2) dynamic bandwidth regulation of audio streams for streaming radio, future cellular phones, VOIP, and network appliances running on congested networks, 3) file size reduction without transcoding, 4) user-specified bandwidth on demand, 5) automatic preview generation from source without any extra administrative overhead.

    I'll even add my own... the ability to download a very high quality file and start listening to it immediately at lower quality without interruption. By the time the file has played through, the download may be only 50% complete. If I decide not to continue with the download, I have wasted no more time than that necessary to listen to the file. If I want the file, I have only 50% remaining.

    In some ways, this is similar to the rationale behind interleaved images, except that it is unlikely that you will need to listen to the same file repeatedly at progressively higher bitrates. Nothing prevents this of course.

    -Hope

  15. Re:audiophile /.er's? by topham · · Score: 5, Insightful

    Look, it's simple.

    audio enthusiasts listen to music.

    audiophiles listen to equipment.

    Me, I'll take the music.

  16. DTS has similar system by nedron · · Score: 4, Informative
    The home theatre version of DTS uses a similar mechanism, allowing DTS to continue to add discreet channels and additional features while remaining compatible with older DTS decoders. Basically, the decoder ignores any information in the stream header that it doesn't understand.

    That's how DTS was able to add a discrete surround channel (DTS ES) without causing problems with older receivers. Dolby can't change their header without breaking backward compatibility, which is why their extra surround channel (DD EX) is matrix encoded.

    --


    * As is generally the case, my opinions do not reflect those of my employer.