xiph / xiph/flac

The compress data size is bigger than the original pcm data?

Open
#841 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.4k
Forks
363
PR merge metrics
No merged PRs in 30d

Description

Hello,everyone:
Our product use flac codec for serveal years,it worked well.Now we notice that some times the compress data data size is bigger than the original pcm data,we are very confused. Is it the compress data absolutely has less size than the original pcm data,if not, what is the maximum size of the compress data.

Here is the details:
1. Our flac version is 1,3,3
2. frame size is 1024 samples,that is we encode 1024 samples one time.
3. other parameters are: 2 channels, int16 format,set compression to 5; sample rate is 48000.
4.We use FLAC__stream_encoder_init_stream api and set the write_callback function.
use FLAC__stream_encoder_process_interleaved api for encode,and in the write callback function to get the compress data and size.
5. our raw pcm data size is 4096 bytes (for 2 channel,int16 format).but some times the compress data is a little bigger than 4096.
6. kylin os

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FLAC__stream_encoder_init_stream and FLAC__stream_encoder_process_interleaved entry points, then inspect how the write_callback receives encoded data for the stated frame and format parameters. Compare the reported 4096-byte PCM input with the callback output and determine whether the size increase is expected; done means the behavior and maximum size question are answered clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.