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

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Mar 16 18:52:34 EET 2020


Am Mo., 16. März 2020 um 17:21 Uhr schrieb numberwolf <porschegt23 at foxmail.com>:
>
> 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

I don't maintain this file but this looks like an improvement to me.

Carl Eugen


More information about the ffmpeg-devel mailing list