+ AVPixFmtDescriptor const * in_desc = av_pix_fmt_desc_get (_pixel_format);
+ if (!in_desc) {
+ throw PixelFormatError ("crop_scale_window()", _pixel_format);
+ }
+
+ /* Round down so that we crop only the number of pixels that is straightforward
+ * considering any subsampling.
+ */
+ Crop rounded_crop(
+ round_width_for_subsampling(crop.left, in_desc),
+ round_width_for_subsampling(crop.right, in_desc),
+ round_height_for_subsampling(crop.top, in_desc),
+ round_height_for_subsampling(crop.bottom, in_desc)
+ );
+