[FFmpeg-devel] [PATCH] adpcm: Clarify a comment
Martin Storsjö
martin
Thu Nov 4 13:07:55 CET 2010
On Wed, 3 Nov 2010, Michael Niedermayer wrote:
> On Wed, Nov 03, 2010 at 09:07:26PM +0200, Martin Storsjo wrote:
> > ---
> > libavcodec/adpcm.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> > index 455b477..f298ef5 100644
> > --- a/libavcodec/adpcm.c
> > +++ b/libavcodec/adpcm.c
> > @@ -354,7 +354,7 @@ static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,
> > int sample = samples[i*stride];
> > memset(nodes_next, 0, frontier*sizeof(TrellisNode*));
> > for(j=0; j<frontier && nodes[j]; j++) {
> > - // higher j have higher ssd already, so they're unlikely to use a suboptimal next sample too
> > + // higher j have higher ssd already, so they're likely to yield a suboptimal next sample too
>
> how much is gained without that assumtion?
Current code:
stddev: 31.99 PSNR: 66.23 MAXDIFF: 2643 bytes: 2646016/ 2649218
Runtime 16.6 s
range = 1 for all nodes:
stddev: 31.97 PSNR: 66.23 MAXDIFF: 2112 bytes: 2646016/ 2649218
Runtime 19.3 s
So I think the general idea of the assumption is quite good as such, since
it gives quite a big gain in performance compared to the. With this patch
in place, the comment says what the code actually does.
// Martin
More information about the ffmpeg-devel
mailing list