From c2a17a87868eba87072fc369102b2b3cd8905e5a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 3 Oct 2021 02:02:12 +0200 Subject: Add PixelQuanta to VideoContent. --- src/lib/ffmpeg_examiner.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/ffmpeg_examiner.cc') diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 853db90be..0a236d836 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -480,3 +480,12 @@ FFmpegExaminer::range () const return VideoRange::FULL; } } + + +PixelQuanta +FFmpegExaminer::pixel_quanta () const +{ + auto const desc = av_pix_fmt_desc_get(video_codec_context()->pix_fmt); + return { 1 << desc->log2_chroma_w, 1 << desc->log2_chroma_h }; +} + -- cgit v1.2.3