[FFmpeg-devel] Resubmit patch01 - RE: [patch 2/4] Fix bug for POWERLE: libavcodec/ppc/me_cmp.c

Michael Niedermayer michaelni at gmx.at
Mon Nov 10 15:53:42 CET 2014


On Mon, Nov 10, 2014 at 05:01:56PM +0800, rongyan wrote:
> Hi,
>  New patch please find in the attachment. There are two patches to re-submit, this is the first.
>  The fate test result is here:
>  
>  Rong Yan
[...]

> -        vector unsigned char pix2l  = vec_ld(0,  pix2);
> -        vector unsigned char pix2r  = vec_ld(16, pix2);
> -        vector unsigned char pix2v  = vec_perm(pix2l, pix2r, perm1);
> -        vector unsigned char pix2iv = vec_perm(pix2l, pix2r, perm2);
> +        vector unsigned char pix2v  = VEC_LD(0,  pix2);
> +        vector unsigned char pix2iv = VEC_LD(1,  pix2);

this doubles the number of vec_ld() on big endian


[...]
> @@ -356,11 +168,8 @@ static int sad16_xy2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
>           * pix1v: pix1[0] - pix1[15]
>           * pix3v: pix3[0] - pix3[15]      pix3iv: pix3[1] - pix3[16] */
>          pix1v  = vec_ld(0, pix1);
> -
> -        pix2l  = vec_ld(0, pix3);
> -        pix2r  = vec_ld(16, pix3);
> -        pix3v  = vec_perm(pix2l, pix2r, perm1);
> -        pix3iv = vec_perm(pix2l, pix2r, perm2);
> +        pix3v  = VEC_LD(0, pix3);
> +        pix3iv = VEC_LD(1, pix3);
>  
>          /* Note that AltiVec does have vec_avg, but this works on vector pairs
>           * and rounds up. We could do avg(avg(a, b), avg(c, d)), but the

this also doubles the number of vec_ld() on big endian

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141110/886a4c2b/attachment.asc>


More information about the ffmpeg-devel mailing list