+ int horizontal_factor = 1;
+ if (n > 0) {
+ AVPixFmtDescriptor const * d = av_pix_fmt_desc_get (_pixel_format);
+ if (!d) {
+ throw PixelFormatError ("sample_size()", _pixel_format);
+ }
+ horizontal_factor = pow (2.0f, d->log2_chroma_w);
+ }
+
+ return dcp::Size (
+ lrint (ceil (static_cast<double>(size().width) / horizontal_factor)),
+ lrint (ceil (static_cast<double>(size().height) / line_factor (n)))
+ );