HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: thinksloth on 2011-07-07 03:38:14

Title: Bit rate changed when ape to flac
Post by: thinksloth on 2011-07-07 03:38:14
hi,

  Since my portable audio player not support ape, thus I converted to flac. I use foobar2000 do the stuff.

  Here are my fb2k configuration:
  fb2k latest version
  flac-1.2.1
  FLAC level 5

  But the problem is, I test 20 different ape files+ to flac, but after convertion the flac bit rate is not the same as original ape file

  My question is, since both format are "loseless", why the ape bit rate and flace bit rate are not the same?

  Some "component" is missing? Or something's wrong..?

  Hope I can figure what's going on

thanks for help~
Title: Bit rate changed when ape to flac
Post by: benski on 2011-07-07 03:48:02
hi,

  Since my portable audio player not support ape, thus I converted to flac. I use foobar2000 do the stuff.

  Here are my fb2k configuration:
  fb2k latest version
  flac-1.2.1
  FLAC level 5

  But the problem is, I test 20 different ape files+ to flac, but after convertion the flac bit rate is not the same as original ape file

  My question is, since both format are "loseless", why the ape bit rate and flace bit rate are not the same?

  Some "component" is missing? Or something's wrong..?

  Hope I can figure what's going on

thanks for help~


the "bitrate" of a lossless file represents the size-per-second after the lossless compression has been done.  It does not represent the size of the audio data after it is decompressed (which will always be the same).  APE and FLAC use different lossless compression technologies and therefore will have different sizes.  APE tends to produce very slightly smaller sizes, at the expense of requiring more CPU time to decode.  The audio data is always the same though!
Title: Bit rate changed when ape to flac
Post by: DigitalMan on 2011-07-07 03:50:49
The bitrate is the compressed bitrate, not the uncompressed rate which will be bit identical / equal.  APE and FLAC have different algorithms and I would expect some differences in the amount of compression each can achieve and therefore the bit rate would change.  Use FLAC level 1 and you'll get a higher bit rate than FLAC level 8 - but they will produce bit-identical outputs after decoding.  IIRC, APE compresses more than FLAC typically so I would expect a larger file for FLAC and hence a higher bit rate reported, although the decoded output will be identical between APE and FLAC.
Title: Bit rate changed when ape to flac
Post by: thinksloth on 2011-07-07 04:29:11
The bitrate is the compressed bitrate, not the uncompressed rate which will be bit identical / equal.  APE and FLAC have different algorithms and I would expect some differences in the amount of compression each can achieve and therefore the bit rate would change.  Use FLAC level 1 and you'll get a higher bit rate than FLAC level 8 - but they will produce bit-identical outputs after decoding.  IIRC, APE compresses more than FLAC typically so I would expect a larger file for FLAC and hence a higher bit rate reported, although the decoded output will be identical between APE and FLAC.


Thanks~

that make me know the details~
Title: Bit rate changed when ape to flac
Post by: thinksloth on 2011-07-11 08:04:05
and one more questions...
i use fb2k, media info, those are display the 'compressed bitrate'
then how can i know the original cd bitrate..?

thanks~
Title: Bit rate changed when ape to flac
Post by: trout on 2011-07-11 08:50:10

how can i know the original cd bitrate..?

That's easy. The bitrate of an audio CD (CDDA) is always 1411.2 kbit/s (http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29).

Channels x Sample rate x Bits per sample = bits per second

Title: Bit rate changed when ape to flac
Post by: odyssey on 2011-07-11 12:50:33
You probably confuse bitrate with lossy compressed files.

When a file is compressed "lossy", you often choose CBR (constant bit rate) to restrict the file to be within a specific size.

A lossless compressed file cannot be restricted to a specific bitrate, as it wouldn't be lossless if you threw away any bits.
Title: Bit rate changed when ape to flac
Post by: db1989 on 2011-07-11 17:18:11
A lossless compressed file cannot be restricted to a specific bitrate, as it wouldn't be lossless if you threw away any bits.
To add, though: it can have a mean (often reported using the term average, but anyone who’s studied a tiny bit of statistics knows to frown upon that!) bitrate, which will be what thinksloth saw. The reason the mean bitrate differs between formats is that, for any given waveform, the encoders will be of differing efficiencies; one will compress it to a smaller total file size than the other.
Title: Bit rate changed when ape to flac
Post by: thinksloth on 2011-07-12 10:52:48
A lossless compressed file cannot be restricted to a specific bitrate, as it wouldn't be lossless if you threw away any bits.
To add, though: it can have a mean (often reported using the term average, but anyone who’s studied a tiny bit of statistics knows to frown upon that!) bitrate, which will be what thinksloth saw. The reason the mean bitrate differs between formats is that, for any given waveform, the encoders will be of differing efficiencies; one will compress it to a smaller total file size than the other.


oh, i think i am confused when thinking the questions but now make it clear, thanks all of yours answer.

Because as yours said loseless mean exactly the same as the cd.

And i also interested to know why some ape/flac files have such a low compressed bitrate, e.g. 290 kbps
I know when such a low bitrate require more cpu work when decode, but it can save the portable media player storage.
Title: Bit rate changed when ape to flac
Post by: kornchild2002 on 2011-07-12 11:20:43
You should go back and read the replies in this thread again as they clearly state how FLAC and APE (along with other non-CBR lossless formats) can produce files with varying bitrates.  There are many aspects that influence bitrate and, in my experience, lossless files with extremely low bitrates tend to contain a large portion of mono audio (or be completely mono), are comprised of simple low beats, or have long lengths of silence thus bringing down their overall average bitrate.  There are other things as well.  Either way, as previously pointed out, you shouldn't be focused on the bitrate of lossless files as that doesn't matter.  You can encode at FLAC level 1 and get a different bitrate than at FLAC level 8 yet both files will be exactly the same.
Title: Bit rate changed when ape to flac
Post by: odyssey on 2011-07-12 13:00:25
And i also interested to know why some ape/flac files have such a low compressed bitrate, e.g. 290 kbps

Because the final bitrate depends on the content. If you have a pure silence file, it can be compressed to almost nothing, even if it's several hours long - Because it's simple, there is nothing to encode, really. The more complex the music (/waveform) are, the harder it can be to encode.

If you encode white noise, you will see that it's almost impossible to compress, because it's complex (there are no patterns).

A typical example of this, is recent music (which are almost per definition subject to the "loudness war") is boosting the waveform so much that it is more like the white noise example, whereas older music is much quiter and easier for the encoder to compress. So typically you will see older music being able to compress to lower bitrates than newer music.

If you are familar with zip-archives, it's pretty much the same. Nothing within is changed, but a large collection of text-documents is easy to compress, while complex files, as videos, images etc are harder to compress.

I know when such a low bitrate require more cpu work when decode, but it can save the portable media player storage.

No it doesn't. Some efficient encoders (e.g. APE) that uses complex algorithms to reduce the bitrate, also requires complex decoding techniques - THAT takes up CPU power.