From c10ba5eb8e62d04ed80cad512cf4863dadee07f1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 31 Oct 2019 13:17:18 +0100 Subject: Use mp_log2() instead of av_log2() --- video/out/bitmap_packer.c | 8 +++----- video/zimg.c | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'video') diff --git a/video/out/bitmap_packer.c b/video/out/bitmap_packer.c index 4f7739f514..a79446d2c2 100644 --- a/video/out/bitmap_packer.c +++ b/video/out/bitmap_packer.c @@ -24,8 +24,6 @@ #include #include -#include - #include "mpv_talloc.h" #include "bitmap_packer.h" #include "common/common.h" @@ -51,7 +49,7 @@ void packer_get_bb(struct bitmap_packer *packer, struct pos out_bb[2]) #define HEIGHT_SORT_BITS 4 static int size_index(int s) { - int n = av_log2_16bit(s); + int n = mp_log2(s); return (n << HEIGHT_SORT_BITS) + ((- 1 - (s << HEIGHT_SORT_BITS >> n)) & ((1 << HEIGHT_SORT_BITS) - 1)); } @@ -148,9 +146,9 @@ int packer_pack(struct bitmap_packer *packer) ymax = MPMAX(ymax, in[i].y); } if (xmax > packer->w) - packer->w = 1 << (av_log2(xmax - 1) + 1); + packer->w = 1 << (mp_log2(xmax - 1) + 1); if (ymax > packer->h) - packer->h = 1 << (av_log2(ymax - 1) + 1); + packer->h = 1 << (mp_log2(ymax - 1) + 1); while (1) { int used_width = 0; int y = pack_rectangles(in, packer->result, packer->count, diff --git a/video/zimg.c b/video/zimg.c index 6e3a72a403..9b4aa0cbaa 100644 --- a/video/zimg.c +++ b/video/zimg.c @@ -15,7 +15,7 @@ * License along with mpv. If not, see . */ -#include +#include #include "common/common.h" #include "common/msg.h" @@ -452,8 +452,8 @@ static bool setup_format(zimg_image_format *zfmt, struct mp_zimg_repack *r, zfmt->width = fmt.w; zfmt->height = fmt.h; - zfmt->subsample_w = av_log2(desc.chroma_w); - zfmt->subsample_h = av_log2(desc.chroma_h); + zfmt->subsample_w = mp_log2(desc.chroma_w); + zfmt->subsample_h = mp_log2(desc.chroma_h); zfmt->color_family = ZIMG_COLOR_YUV; if (desc.num_planes == 1) { -- cgit v1.2.3