diff options
author | Christian Feldmann <christian.feldmann@gmx.de> | 2022-09-14 18:05:50 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-09-14 19:42:59 +0200 |
commit | 8357d4790fd0f11d7b76e20d321ec8241d80bd05 (patch) | |
tree | 58ba440330d6a642094bcff7b5abdf7cb1720731 /libavfilter | |
parent | 8fc2dedfe6e8fcc58dd052bf3b85cd4754133b17 (diff) | |
download | ffmpeg-8357d4790fd0f11d7b76e20d321ec8241d80bd05.tar.gz |
avfilter/vf_libvmaf: copy all values also for 10 bit input
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_libvmaf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index eee1c280ef..8d5ba4e2d5 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -108,6 +108,7 @@ static enum VmafPixelFormat pix_fmt_map(enum AVPixelFormat av_pix_fmt) static int copy_picture_data(AVFrame *src, VmafPicture *dst, unsigned bpc) { + const int bytes_per_value = bpc > 8 ? 2 : 1; int err = vmaf_picture_alloc(dst, pix_fmt_map(src->format), bpc, src->width, src->height); if (err) @@ -117,7 +118,7 @@ static int copy_picture_data(AVFrame *src, VmafPicture *dst, unsigned bpc) uint8_t *src_data = src->data[i]; uint8_t *dst_data = dst->data[i]; for (unsigned j = 0; j < dst->h[i]; j++) { - memcpy(dst_data, src_data, sizeof(*dst_data) * dst->w[i]); + memcpy(dst_data, src_data, bytes_per_value * dst->w[i]); src_data += src->linesize[i]; dst_data += dst->stride[i]; } |