[FFmpeg-devel] [PATCH v2] Encapsulation macro to get width and height of macroblock

numberwolf porschegt23 at foxmail.com
Mon Mar 16 18:19:43 EET 2020


modify: using the IS_* macros
most of mb's checked oper are defined in mpegutils' marcos, so mb's checked oper about width/height should be put it together with others

Signed-off-by: numberwolf <porschegt23 at foxmail.com>
---
 libavcodec/mpegutils.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegutils.h b/libavcodec/mpegutils.h
index ed59716..bcf604f 100644
--- a/libavcodec/mpegutils.h
+++ b/libavcodec/mpegutils.h
@@ -95,8 +95,8 @@
 #define IS_QUANT(a)      ((a) & MB_TYPE_QUANT)
 #define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list))))
 
-#define MB_SIZE_WIDTH(a)      (((a) & MB_TYPE_8x8) || ((a) & MB_TYPE_8x16)) ? 8 : 16
-#define MB_SIZE_HEIGHT(a)     (((a) & MB_TYPE_8x8) || ((a) & MB_TYPE_16x8)) ? 8 : 16
+#define MB_SIZE_WIDTH(a)      (IS_8X8(a) || IS_8X16(a)) ? 8 : 16
+#define MB_SIZE_HEIGHT(a)     (IS_8X8(a) || IS_16X8(a)) ? 8 : 16
 
 // does this mb use listX, note does not work if subMBs
 #define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list))))
-- 
2.17.2 (Apple Git-113)



More information about the ffmpeg-devel mailing list