Add PixelQuanta to VideoContent.
[dcpomatic.git] / src / lib / ffmpeg_examiner.cc
index 853db90be3e3ef1ec36cc834a51f0ff6754468e9..0a236d836be46b4f5baacdee175201e154de6cab 100644 (file)
@@ -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 };
+}
+