diff mbox

[FFmpeg-devel,1/2] avutil: Rename RSHIFT macro to ROUNDED_RSHIFT

Message ID 2d3e9fe16bfe6fc51a47582ea53deaaf20727f38.1548091116.git.ferdnyc@gmail.com
State Superseded
Headers show

Commit Message

Frank Dana Jan. 21, 2019, 5:38 p.m. UTC
libavutil/common.h contains a pair of macros on lines 54-55, which
the comment on line 53 describes as "rounded division & shift".

The division macro is named ROUNDED_DIV. The shift macro is named
RSHIFT. Since "RSHIFT" is a common name for a bitwise right-shift
operation without rounding (see e.g. FORTRAN, IBM XL C/C++), this
seems needlessly confusing.

This change renames RSHIFT to ROUNDED_RSHIFT, matching the naming
style of the ROUNDED_DIV macro.

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
---
 libavutil/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavutil/common.h b/libavutil/common.h
index 8db0291170..0bff7f8f72 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -51,7 +51,7 @@ 
 #endif
 
 //rounded division & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
+#define ROUNDED_RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
 /* assume b>0 */
 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
 /* Fast a/(1<<b) rounded toward +inf. Assume a>=0 and b>=0 */