diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-14 21:31:53 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-20 01:03:52 +0200 |
commit | 1ea365082318f06cd42a8b37dd0c7724b599c821 (patch) | |
tree | 4df48a8b9f4614803fd2a88c29ad2ff7f7070294 /tests/checkasm | |
parent | 4b154743163ffbe3fdc50759c0c55dc854636488 (diff) | |
download | ffmpeg-1ea365082318f06cd42a8b37dd0c7724b599c821.tar.gz |
Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'tests/checkasm')
-rw-r--r-- | tests/checkasm/llviddsp.c | 24 | ||||
-rw-r--r-- | tests/checkasm/vf_nlmeans.c | 6 |
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/checkasm/llviddsp.c b/tests/checkasm/llviddsp.c index 4f75ffc459..66e08c8099 100644 --- a/tests/checkasm/llviddsp.c +++ b/tests/checkasm/llviddsp.c @@ -46,8 +46,8 @@ static void check_add_bytes(LLVidDSPContext c, int width) { uint8_t *dst0 = av_mallocz(width); uint8_t *dst1 = av_mallocz(width); - uint8_t *src0 = av_mallocz_array(width, sizeof(uint8_t)); - uint8_t *src1 = av_mallocz_array(width, sizeof(uint8_t)); + uint8_t *src0 = av_calloc(width, sizeof(*src0)); + uint8_t *src1 = av_calloc(width, sizeof(*src1)); declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t w); init_buffer(src0, src1, uint8_t, width); @@ -74,10 +74,10 @@ static void check_add_median_pred(LLVidDSPContext c, int width) { int A0, A1, B0, B1; uint8_t *dst0 = av_mallocz(width); uint8_t *dst1 = av_mallocz(width); - uint8_t *src0 = av_mallocz_array(width, sizeof(uint8_t)); - uint8_t *src1 = av_mallocz_array(width, sizeof(uint8_t)); - uint8_t *diff0 = av_mallocz_array(width, sizeof(uint8_t)); - uint8_t *diff1 = av_mallocz_array(width, sizeof(uint8_t)); + uint8_t *src0 = av_calloc(width, sizeof(*src0)); + uint8_t *src1 = av_calloc(width, sizeof(*src1)); + uint8_t *diff0 = av_calloc(width, sizeof(*diff0)); + uint8_t *diff1 = av_calloc(width, sizeof(*diff1)); declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const uint8_t *src1, const uint8_t *diff, ptrdiff_t w, int *left, int *left_top); @@ -112,8 +112,8 @@ static void check_add_left_pred(LLVidDSPContext c, int width, int acc, const cha int res0, res1; uint8_t *dst0 = av_mallocz(width); uint8_t *dst1 = av_mallocz(width); - uint8_t *src0 = av_mallocz_array(width, sizeof(uint8_t)); - uint8_t *src1 = av_mallocz_array(width, sizeof(uint8_t)); + uint8_t *src0 = av_calloc(width, sizeof(*src0)); + uint8_t *src1 = av_calloc(width, sizeof(*src1)); declare_func_emms(AV_CPU_FLAG_MMX, int, uint8_t *dst, uint8_t *src, ptrdiff_t w, int acc); init_buffer(src0, src1, uint8_t, width); @@ -139,10 +139,10 @@ static void check_add_left_pred(LLVidDSPContext c, int width, int acc, const cha static void check_add_left_pred_16(LLVidDSPContext c, unsigned mask, int width, unsigned acc, const char * report) { int res0, res1; - uint16_t *dst0 = av_mallocz_array(width, sizeof(uint16_t)); - uint16_t *dst1 = av_mallocz_array(width, sizeof(uint16_t)); - uint16_t *src0 = av_mallocz_array(width, sizeof(uint16_t)); - uint16_t *src1 = av_mallocz_array(width, sizeof(uint16_t)); + uint16_t *dst0 = av_calloc(width, sizeof(*dst0)); + uint16_t *dst1 = av_calloc(width, sizeof(*dst1)); + uint16_t *src0 = av_calloc(width, sizeof(*src0)); + uint16_t *src1 = av_calloc(width, sizeof(*src1)); declare_func_emms(AV_CPU_FLAG_MMX, int, uint16_t *dst, uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc); init_buffer(src0, src1, uint16_t, width); diff --git a/tests/checkasm/vf_nlmeans.c b/tests/checkasm/vf_nlmeans.c index 32c6931a4b..87474d6803 100644 --- a/tests/checkasm/vf_nlmeans.c +++ b/tests/checkasm/vf_nlmeans.c @@ -46,12 +46,12 @@ void checkasm_check_nlmeans(void) const int ii_w = w + e*2; const int ii_h = h + e*2; const int ii_lz_32 = FFALIGN(ii_w + 1, 4); - uint32_t *ii_orig_ref = av_mallocz_array(ii_h + 1, ii_lz_32 * sizeof(*ii_orig_ref)); + uint32_t *ii_orig_ref = av_calloc(ii_h + 1, ii_lz_32 * sizeof(*ii_orig_ref)); uint32_t *ii_ref = ii_orig_ref + ii_lz_32 + 1; - uint32_t *ii_orig_new = av_mallocz_array(ii_h + 1, ii_lz_32 * sizeof(*ii_orig_new)); + uint32_t *ii_orig_new = av_calloc(ii_h + 1, ii_lz_32 * sizeof(*ii_orig_new)); uint32_t *ii_new = ii_orig_new + ii_lz_32 + 1; const int src_lz = FFALIGN(w, 16); - uint8_t *src = av_mallocz_array(h, src_lz); + uint8_t *src = av_calloc(h, src_lz); declare_func(void, uint32_t *dst, ptrdiff_t dst_linesize_32, const uint8_t *s1, ptrdiff_t linesize1, |