IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Flac Frame size
koliyat raghunat...
post Apr 25 2008, 03:41
Post #1





Group: Members
Posts: 6
Joined: 25-September 06
Member No.: 35583



Hi All,

I am designing flac decoder for an embeded aplication.The flac document gives some information about the maximum size of uncompressed size for the subset(I think present encoder support only 16384 MAX_BLOCK SIZE)(http://flac.sourceforge.net/format.html ).I need to fix the maximum frame size(Compressed data) independent of streamss.


Can any one suggest,How to calculate maximum frame size before decoding



Regards,
Raghunath.K.P
Go to the top of the page
+Quote Post
pdq
post Apr 25 2008, 04:06
Post #2





Group: Members
Posts: 3404
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



Unless I'm mistaken, it is theoretically possible for the lossless compressed data to be larger than the uncompressed. Lossless compression relies on some redundancy in the data to achieve compression. If there is no redundancy then there is no compression. Hopefully nobody is going to compress random data, but theoretically that could happen.
Go to the top of the page
+Quote Post
poochi
post Apr 25 2013, 06:48
Post #3





Group: Banned
Posts: 11
Joined: 12-October 12
Member No.: 103802



QUOTE (pdq @ Apr 25 2008, 04:06) *
Unless I'm mistaken, it is theoretically possible for the lossless compressed data to be larger than the uncompressed. Lossless compression relies on some redundancy in the data to achieve compression. If there is no redundancy then there is no compression. Hopefully nobody is going to compress random data, but theoretically that could happen.


you can refer to ffmpeg s implementation.
here
http://www.ffmpeg.org/doxygen/trunk/flac_8c_source.html
Go to the top of the page
+Quote Post
Porcus
post Apr 25 2013, 11:39
Post #4





Group: Members
Posts: 1842
Joined: 30-November 06
Member No.: 38207



QUOTE (pdq @ Apr 25 2008, 05:06) *
Unless I'm mistaken, it is theoretically possible for the lossless compressed data to be larger than the uncompressed. Lossless compression relies on some redundancy in the data to achieve compression. If there is no redundancy then there is no compression. Hopefully nobody is going to compress random data, but theoretically that could happen.


Bar container or metadata features that would take up some space, a compressed format could have 'uncompressed' as special case. Regarding the OP's question, FLAC can specify a block as VERBATIM (i.e. uncompressed) at size up to 16384.

But there is nothing in the FLAC specification that prevents an encoder to overlook the VERBATIM option and write a predictor+residual block with stream larger than uncompressed? Then the question is, would any (widespread) FLAC encoder actually do this?

This post has been edited by Porcus: Apr 25 2013, 11:40


--------------------
One day in the Year of the Fox came a time remembered well
Go to the top of the page
+Quote Post
ktf
post Apr 25 2013, 14:41
Post #5





Group: Members
Posts: 369
Joined: 22-March 09
From: The Netherlands
Member No.: 68263



QUOTE (Porcus @ Apr 25 2013, 12:39) *
But there is nothing in the FLAC specification that prevents an encoder to overlook the VERBATIM option and write a predictor+residual block with stream larger than uncompressed? Then the question is, would any (widespread) FLAC encoder actually do this?

The official FLAC tools have the undocumented option "--disable-verbatim-subframes" which is used for testing, to force the encoder to encode whatever signal with predictors. I know two similar option that are used by dBpowerAMP, --disable-fixed-subframes and --disable-constant-subframes to generate "uncompressed FLAC" (only to store metadata), which is of course BS, but still, these options are out there and can be used. So, if you need the maximum length to protect against buffer overflows or something like that you might not want to rely on it. If it just chrashes the decoder I wouldn't try to fix it, because if it happens, the user probably tries it on purpose. I can't see a reason to do this.

This post has been edited by ktf: Apr 25 2013, 14:41


--------------------
Music: sounds arranged such that they construct feelings.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th September 2014 - 20:54