#8022 closed defect (invalid)
Enhance performance of FFMAX macro
Reported by: | Ulf Zibis | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
FFMAX is often used in this scenario:
original = FFMAX(original , limit);
If the original equals limit, with the current implementation limit is copied to original, which is superfluous.
So I suggest to implement FFMAX equivalent to FFMIN.
Current:
#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
Proposed:
#define FFMAX(a,b) ((a) < (b) ? (b) : (a)) #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
Change History (3)
comment:1 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 5 years ago
comment:3 by , 5 years ago
Replying to heleppkes:
If you want to claim this is faster, then show generated assembly and performance numbers. Because I'm doubtful its going to change anything whatsoever.
I've checked that out. You are right at least with my compiler. It optimizes equivalent for both variants, don't know if this is true for any compiler.
Anyway I think my proposal would show more consistence between FFMAX and FFMIN.
If you want to claim this is faster, then show generated assembly and performance numbers. Because I'm doubtful its going to change anything whatsoever.
Also, patches should be submitted to the ffmpeg-devel mailing list.