[Ffmpeg-devel] [PATCH] ac3enc fractional frame sizes
Michael Niedermayer
michaelni
Mon Apr 3 00:51:25 CEST 2006
Hi
On Sun, Apr 02, 2006 at 05:27:46PM -0400, Justin Ruggles wrote:
> Michael Niedermayer wrote:
> > Hi
> >
> > On Sun, Apr 02, 2006 at 01:00:51PM -0400, Justin Ruggles wrote:
> >
> >>Hello,
> >>
> >>Seeing the recent post regarding AC3 volume and reading that old thread
> >>brought back some memories. Looking at those patches I sent, it's no
> >>wonder nothing got applied...yikes. I should have just watched the list
> >>for a while and maybe I wouldn't have tried to submit a huge patch with
> >>all sorts of unrelated changes.
> >>
> >>So anyway, I decided to look back at the code to see if there is any
> >>small change I can suggest. Adding encoding support for fractional
> >>frame sizes was pretty simple. So here is my solution.
> >
> >
> > this will output many packets with frame_size_min then output many with
> > frame_size_min+1 and its unneccesary complicated
> >
> > why not:
> >
> > while(bits_written >= bitrate && samples_read >= sample_rate){
> > bits_written -= bitrate;
> > samples_read -= sample_rate;
> > }
> > frame_size= frame_size_min + (bits_written * sample_rate < samples_read * bit_rate);
> > bits_written += frame_size;
> > samples_read += AC3_FRAME_SIZE;
> >
> > maybe i forgot a *2 somewhere though
> >
> > [...]
> >
>
>
> Your solution does work better.
> How does this patch look?
patch looks ok
[...]
--
Michael
More information about the ffmpeg-devel
mailing list