[FFmpeg-soc] [soc]: r2021 - in eac3:?ac3dec.h?ac3dec_data.c?ac3dec_data.h eac3dec.c
Bartlomiej Wolowiec
bartek.wolowiec at gmail.com
Wed Mar 26 19:42:59 CET 2008
On środa, 26 marca 2008, Michael Niedermayer wrote:
> > while (buf_size > 0) {
> > int size_needed= s->frame_size ? s->frame_size : s->header_size;
> > len = s->inbuf_ptr - s->inbuf;
> >
> > @@ -56,7 +64,14 @@
> > memmove(s->inbuf, s->inbuf + 1, s->header_size - 1);
> > s->inbuf_ptr--;
> > } else {
> > - s->frame_size = len;
> > + if(!s->stream_type) {
> > + if(s->inbuf != s->inbuf_tab) {
> > + *poutbuf = s->inbuf_tab;
> > + *poutbuf_size = s->inbuf - s->inbuf_tab;
> > + s->inbuf_ptr = s->inbuf_tab;
> > + s->frame_size = 0;
> > + break;
> > + }
>
> this is VERY hackish, stream_type has from the point of view of a
> generic (AAC+AC3+EAC3) parser no relation to the number of frames over
> which channels are split.
>
> > /* update codec info */
> > avctx->sample_rate = s->sample_rate;
> > /* allow downmixing to stereo (or mono for AC3) */
> > @@ -71,15 +86,18 @@
> > }
> > avctx->bit_rate = s->bit_rate;
> > avctx->frame_size = s->samples;
> > + } else {
> > + //TODO update bit_rate
> > + avctx->frame_size += s->samples;
> > + }
> > + s->frame_size = len;
> > }
> > }
> > } else {
> >
> > if(s->inbuf_ptr - s->inbuf == s->frame_size){
> > - *poutbuf = s->inbuf;
> > - *poutbuf_size = s->frame_size;
> > + s->inbuf += s->frame_size;
> > s->inbuf_ptr = s->inbuf;
> > s->frame_size = 0;
> > - break;
> > }
>
> this causes additional copying and delay i think for normal AC3 & AAC
Hi,
Maybe this:
if(eac3 stream){
// new code
}else{
// existing code
}
will be a good solution for these problems?
--
Bartlomiej Wolowiec
More information about the FFmpeg-soc
mailing list