[FFmpeg-devel] [PATCH] wmadec.c: SIMD optimization using float_to_int16_interleave

Michael Niedermayer michaelni
Tue Mar 9 16:41:25 CET 2010


On Tue, Mar 09, 2010 at 08:15:23PM +0800, Zhou Zongyi wrote:
> > ive not reviewed the patch as iam waiting for a clean version without 
> > cosmetic changes, but nothing of this size that makes a codec 10% can 
> > be too hackish
> 
> Well it seems C version of float_to_int16_interleave does different job from SIMD versions,
> so I have to keep the original av_clip_int16(lrintf()) method.
> 
> Here is a patch without cosmetics.
> 
> Index: libavcodec/wmadec.c 
> =================================================================== 
> --- libavcodec/wmadec.c (revision 22281) 
> +++ libavcodec/wmadec.c (working copy) 
> @@ -790,17 +790,28 @@ 
>      /* convert frame to integer */ 
>      n = s->frame_len; 
>      incr = s->nb_channels; 
> -    for(ch = 0; ch < s->nb_channels; ch++) { 
> -        ptr = samples + ch; 
> -        iptr = s->frame_out[ch]; 
[...]
> +            ptr = samples + ch; 
> +            iptr = s->frame_out[ch]; 

cosmetics


>   
> -        for(i=0;i-            *ptr = av_clip_int16(lrintf(*iptr++)); 
> -            ptr += incr; 
> +            for(i=0;i+                *ptr = av_clip_int16(lrintf(*iptr++)); 
> +                ptr += incr; 
> +            } 

looks odd

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100309/dec76897/attachment.pgp>



More information about the ffmpeg-devel mailing list