On 5/11/2020 12:52 PM, lance.lmw...@gmail.com wrote:
> From: Limin Wang <lance.lmw...@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmw...@gmail.com>
> ---
>  libavcodec/mpegvideo.c | 60 
> ++++++++++++++++++++++----------------------------
>  1 file changed, 26 insertions(+), 34 deletions(-)
> 
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 49fd1c9..6f52e75 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -372,16 +372,13 @@ static int init_duplicate_context(MpegEncContext *s)
>      s->sc.obmc_scratchpad = NULL;
>  
>      if (s->encoding) {
> -        FF_ALLOCZ_OR_GOTO(s->avctx, s->me.map,
> -                          ME_MAP_SIZE * sizeof(uint32_t), fail)
> -        FF_ALLOCZ_OR_GOTO(s->avctx, s->me.score_map,
> -                          ME_MAP_SIZE * sizeof(uint32_t), fail)
> +        FF_ALLOCZ_TYPED_ARRAY_OR_GOTO(s->avctx, s->me.map, ME_MAP_SIZE, fail)
> +        FF_ALLOCZ_TYPED_ARRAY_OR_GOTO(s->avctx, s->me.score_map, 
> ME_MAP_SIZE, fail)

Why not just do FF_ALLOCZ_ARRAY_OR_GOTO(s->avctx, s->me.score_map,
ME_MAP_SIZE, sizeof(*s->me.score_map), fail)
Same for every other case in the patchset.

I don't know if it's worth adding a new macro just to save writing one
argument, but i have no strong feelings about it, so if others are ok
with it then it's fine.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to