avcodec/mpegvideo: Avoid macro/av_calloc for ordinary allocations

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-01-01 12:30:19 +01:00
parent 4fc4cf4931
commit de29d482f9
1 changed files with 5 additions and 5 deletions

View File

@ -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);