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."

39 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 FauxPasIII · · Score: 3

      > I dont want to hear my symphony, or even my phish for that matter, sampled down to lower rates

      That's all well and good that you know what you want. Me, I want a format that can be downloaded in at least realtime (1 second of music in 1 second of download time) on a normal, lightly used network connection, and which takes up only reasonable amounts of space on disk.

      But hey, what do I know, I just do professional network consulting and system administration to pay my way through school. =D

      --
      25% Funny, 25% Insightful, 25% Informative, 25% Troll
    2. 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!

    3. Re:Audiophiles? by pthisis · · Score: 3, Informative

      Shorten (.shn) is not a free program (libre--it is gratis). It also doesn't compress as well as some of the other lossless codecs and as far as I know there aren't any hardware devices that support it.

      I use FLAC to compress my music, which is free and lossless. It outperforms shorten on average (smaller compressed files), and is also supported by some hardware playback devices (Rio, Phatbox, some Kenwood stuff) unlike Shorten.

      I play back through a Hoontech card with digital output and use an offboard MSB Link DAC III (the computer is acoustically isolated from the listening room) which feeds into a Creek 5350 integrated amp driving Vandersteen 2ce Signature loudspeakers.

      I also use lossy compression for my car mp3 player--the stereo there isn't audiophile quality anyway.

      Sumner

      --
      rage, rage against the dying of the light
    4. Re:Audiophiles? by usr122122121 · · Score: 3, Funny
      An yo pint is wha?
      Cookie Dough. or Mint Chocolate Chip.
      --

      -braxton
    5. Re:Audiophiles? by NineNine · · Score: 3, Informative

      play back through a Hoontech card with digital output and use an offboard MSB Link DAC III (the computer is acoustically isolated from the listening room) which feeds into a Creek 5350 integrated amp driving Vandersteen 2ce Signature loudspeakers.


      And we should care about this, why?

    6. Re:Audiophiles? by renard · · Score: 3, Funny
      hey you can't polish a turd.

      True story:

      Jerry Lewis sits at an editing console, editing his latest film. Unfortunately he is not happy with the way it is going. Stanley Kubrick stops in, asks is he can watch. Jerry says sure.

      Jerry Lewis (coining the phrase): You can't polish a turd.

      Stanley Kubrick (without missing a beat): You can if you freeze it.

      -renard

    7. 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

    8. Re:Audiophiles? by Bronster · · Score: 3, Insightful

      Another thing... with high bitrate mp3.. when comparing between an original and the compressed version in a blind test, someone will be able to tell you they are different, but not which one is the original... becasue both sound good.

      Well duh, then what's the problem? If they both sound good then you'll enjoy either one, so listen to the one that uses less bandwidth.

      *sigh*

    9. Re:Audiophiles? by NickSD · · Score: 3, Informative

      First of all, for the best quality out of the LAME MP3 encoder, you shouldn't be using those CBR modes (160, 192, etc). Use either --alt-preset standard or --alt-preset extreme for best quality. Those presets are better in many ways than the CBR modes you mentioned.

      Secondly, I understand that it is hard (and sometimes impossible) to hear the differences between a properly-encoded MP3 and the original, but that does not mean it will be true for all cases. Music varies greatly, and while you may not be able to hear a difference on certain songs, there may be others where it is quite apparent. I don't think anyone can debate (anymore) that a properly-encoded MP3 using --alt-preset standard with LAME is easy to pick out. Most of the time, to most people, it will be transparent. However, arguing that people should use MP3 over lossless is a whole different ballgame.

      One nice thing about lossless is that you always have the choice of converting it back to the original WAV and using that as source data for further processing. Once you've converted something to MP3 (or any lossy format) you can't go back. There are applications for lossy and applications for lossless, but I think comparing the filesizes and claiming MP3 is the way to go isn't really appropriate. Just IMHO, of course. I am speaking from the point of view that your intent is to archive your audio or something similar.

    10. Re:Audiophiles? by Sycraft-fu · · Score: 3, Interesting

      Interestingly enough I find that MP3 can even give superior sound to CD if encoded and decoded properly. MP3s don't have a set word size like PCM audio does, they just take the data they are given. Good encoders, like LAME, are perfectly capable of taking 24-bit files as input. At high bitrates (256-320k) I find that the compressed MP3 sounds superior to a 16-bit PCM file when taken from a 24-bit source, despite being smaller.

      By the way, you might want to check out the MAD Winamp plugin at http://www.mars.org/home/rob/proj/mpeg/mad-plugin/ . It offers good 24-bit decoding in Winamp, which I happen to really like as a player.

    11. Re:Audiophiles? by topham · · Score: 3, Insightful


      Actually, they are chasing precision.

      None of them have a FUCKING CLUE as to how accurate their system is, or isn't.

    12. Re:Audiophiles? by tswinzig · · Score: 3, Informative

      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).

      Yes I've heard Dolby Digital compression is similar to MP3 compression. However, DTS uses very little compression, which is why it sounds better and takes up more space on your DVD disc. Check out the DTS FAQ.

      --

      "And like that ... he's gone."
    13. Re:Audiophiles? by Tim+Browse · · Score: 3, Funny
      Do you always take things people say to ridiculous extremes?

      Er, why do I need to do that, when you say things like this:

      Of course a sound card is useless for listening to music.

      This may come as a shock to you, but the vast majority of people who listen to music on their computers would consider that a ridiculous statement. No extrapolation is necessary on my part - that's a direct quote.

      Note the word listening.

      Wow, I'm so confused as to why I've been playing mp3s on my PC up to now...I thought I was listening to music. Guess not.

      Nice troll yourself :)

      Tim

  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. Re:not impressed by Qwijib0 · · Score: 3, Insightful

    I don't think that's how it works.. from what I understand, it simply removes bits... ie:

    I = one bit

    ----A 128k stream----
    IIIIIIIIIIIIIIIIIIIIIII

    ----A 96k stream-----
    IIII IIII IIII IIII IIII

    It simply removes some of the bits, not any specific freqency of the high/low/mid.

    and it looks to be an impressive streaming method

  8. 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.
  9. Is this really such a useful idea? by Tsar · · Score: 3, Insightful
    This feature is unique to Ogg Vorbis...Bitrate peeling is not actually implemented yet.

    Sounds more like it would be unique to OV, if they implemented it.

    The point is, nobody does it now. Perhaps this is because there's really no need for it. Consider the list of "very sexy applications:"
    • In a streaming situation, the server would store only one high quality stream, and dynamically peel it down to the client's bandwidth. Not useful. If you instead stored a hundred separate files, each optimized for its bitrate, with each being half the bitrate of the previous one, you'd still have a set of files less than twice the size of the largest file. Plus, you'd have no bit-peeling overhead. If you're streaming 100GB audio files, maybe there's a benefit, but if you're doing that, you can probably afford a second 100GB file for all the smaller files.
    • You could store high quality Ogg Vorbis files on your PC for your Audiophile home theater setup, and peel them down to "good enough for lousy headphones on a noisy train" portable files. You can do that now, without this high-tech. Such low-quality files could be easily made from the original OV high-quality files, without much extra artifacting due to the re-encoding. And again, how low a quality are you willing to accept, if you're going this far anyway? Wouldn't you just buy a higher-cap memory card?
    • 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. Another non-benefit. Suppose the full file is 10 meg, and you download a 1 meg sample. Are you really going to opt to download the 9 meg "patch" file, rather than the 10 meg complete version?
    A clever idea, and it sounds cool on the outset, but it seems to me that this is a solution seeking a problem.
  10. 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.

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

    Musi withou hig frequenc is lik wods mising leters.

    --

    -braxton
  12. 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?
  13. 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?

  14. 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.

  15. A spurious example by benwaggoner · · Score: 3, Interesting

    Okay, if each one is double the one before, that means you'll have a 2^100 ratio between lowest and highest data rate. Thus, if your lowest is 1 Kbps, the highest would be... Not going to happen that way.

    Also, you assume the sweet spots are 2x the one before. In fact, jumps of more like 1.25 are likely to be optimal (albeit with a lot fewer jumps!).

  16. Progressive Ogg? by Luke-Jr · · Score: 3, Interesting

    Could it possibly be used to progressively download an Ogg file and begin listening to it before it's 100% done? For example, have the 32kbit quality at the start of the file, then next have the next 32kbit (starting at the end of the file), then the next 64kbit, etc...

    --
    Luke-Jr
  17. 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
  18. 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

  19. 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.

  20. 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.
  21. iPod seems to do this anyway by Richard_J_N · · Score: 3, Interesting

    I think that the iPod does a very bad attempt at this. MP3s, encoded at 320k play back really badly on the iPod, far worse than 128/192k ones. I suspect that the iPod hardware hasn't enough horsepower - and it is discarding bits that it cannot decode fast enough. The MP3s sound fine on the pc, or decoded to wav and then played back on the iPod. But played back (as MP3) on the iPod, the result is dismal - there's a 5Hz "wobbling", rather like a steel band, and lots of distortion. (Apple won't help, but I have replicated this problem on multiple setups both Linux and OSX - it would be interesting to see if any /.ers have seen the same thing. You need a good recording of a classical CD with very large dynamic range eg Mahler 8, part II to demonstrate it - listen to the quiet bits.) [I have some demo files, but can't link them - I'll get slashdotted off the net !]

  22. Why stop there? by Kwil · · Score: 3, Interesting

    Peel layers from a data file thin enough that no layer is independantly recognizable. Scatter the layers throughout a P2P system. Now no individual user possesses the whole file, but all users can reconstruct a working copy when they want to play it.

    --

    That Jesus Christ guy is getting some terrible lag... it took him 3 days to respawn! -NJ CoolBreeze