[FFmpeg-devel] Fix bug for POWER LE:libswscale/ppc/swscale_altivec.c

Michael Niedermayer michaelni at gmx.at
Wed Oct 22 05:08:49 CEST 2014

On Wed, Oct 22, 2014 at 09:23:43AM +0800, rongyan wrote:
> Michael,
> Do you have any suggestion on this patch?

yes, please remove the code duplication (this also applies to already
commited code)

instead of

#if X
 code a
 code c
 code a
 code c

you can write

#if X
#define B b1
#define B b2

 code a
 code c

You can also take a look at our x86 asm, which also generates
code for different cpu feature sets, 32 and 64bit from single
implementations generally without any duplication of code

code duplication makes maintaince harder as bug fixes and updates
need to be done to all copies
code duplication also makes reading the code harder as its not
immedeatly obvious what parts are identical and what differences
there are


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- 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/20141022/f7749079/attachment.asc>

More information about the ffmpeg-devel mailing list