[FFmpeg-cvslog] avcodec/mpegvideo: Avoid macro/av_calloc for ordinary allocations

Andreas Rheinhardt git at videolan.org
Sun Jan 9 11:31:21 EET 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jan  1 12:30:19 2022 +0100| [de29d482f9ee8d9cea9c58a1370ab99028adff3f] | committer: Andreas Rheinhardt

avcodec/mpegvideo: Avoid macro/av_calloc for ordinary allocations

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de29d482f9ee8d9cea9c58a1370ab99028adff3f
---

 libavcodec/mpegvideo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index af433153f2..e9f2fb212a 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -632,9 +632,9 @@ int ff_mpv_init_context_frame(MpegEncContext *s)
 
     if (s->out_format == FMT_H263) {
         /* cbp values, cbp, ac_pred, pred_dir */
-        if (!FF_ALLOCZ_TYPED_ARRAY(s->coded_block_base, y_size + (s->mb_height&1)*2*s->b8_stride) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->cbp_table,        mb_array_size)                            ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->pred_dir_table,   mb_array_size))
+        if (!(s->coded_block_base = av_mallocz(y_size + (s->mb_height&1)*2*s->b8_stride)) ||
+            !(s->cbp_table        = av_mallocz(mb_array_size)) ||
+            !(s->pred_dir_table   = av_mallocz(mb_array_size)))
             return AVERROR(ENOMEM);
         s->coded_block = s->coded_block_base + s->b8_stride + 1;
     }
@@ -652,9 +652,9 @@ int ff_mpv_init_context_frame(MpegEncContext *s)
     }
 
     /* which mb is an intra block,  init macroblock skip table */
-    if (!FF_ALLOC_TYPED_ARRAY(s->mbintra_table, mb_array_size) ||
+    if (!(s->mbintra_table = av_mallocz(mb_array_size)) ||
         // Note the + 1 is for a quicker MPEG-4 slice_end detection
-        !FF_ALLOCZ_TYPED_ARRAY(s->mbskip_table,  mb_array_size + 2))
+        !(s->mbskip_table  = av_mallocz(mb_array_size + 2)))
         return AVERROR(ENOMEM);
     memset(s->mbintra_table, 1, mb_array_size);
 



More information about the ffmpeg-cvslog mailing list