[FFmpeg-devel] [PATCH 2/2] avcodec/smacker: Optimize constant 16bit audio output

Tomas Härdin tjoppen at acc.umu.se
Wed Jul 6 21:26:12 EEST 2022


ons 2022-07-06 klockan 19:11 +0200 skrev Michael Niedermayer:
> On Wed, May 04, 2022 at 11:39:54AM +0200, Tomas Härdin wrote:
> > tis 2022-05-03 klockan 18:30 +0200 skrev Michael Niedermayer:
> > > 
> > > +        } else if (stereo) {
> > > +            val  = 256*values[1] + values[0];
> > > +            val2 = 256*values[3] + values[2];
> > > +            for(; i < unp_size; i+=2) {
> > > +                pred[0] += val;
> > > +                pred[1] += val2;
> > > +                *samples++ = pred[0];
> > > +                *samples++ = pred[1];
> > > +            }
> > > +        } else {
> > > +            val = 256*values[1] + values[0];
> > > +            for(; i < unp_size; i++) {
> > > +                pred[0] += val;
> > > +                *samples++ = pred[0];
> > > +            }
> > > +        }
> > 
> > Got any numbers on how much faster this is? Just out of curiosity
> 
> With the fuzzed sample:
> before:
> 3263902379 decicycles in ABBB,     128 runs,      0 skips
> 
> after:
> 398977744 decicycles in ABBB,    1024 runs,      0 skips
> 
> the first times out after 128 runs which is why the runs differ

Cool. Well, looks good

/Tomas



More information about the ffmpeg-devel mailing list