From: Carl Hetherington Date: Fri, 13 May 2022 11:56:11 +0000 (+0200) Subject: Support auto-crop for YUV422P10LE. X-Git-Tag: v2.16.12~7 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f84bcfc26ca1ccd2f395bc1bf259b5b9662b468a Support auto-crop for YUV422P10LE. --- diff --git a/src/lib/guess_crop.cc b/src/lib/guess_crop.cc index 7ee7a7286..3538f14de 100644 --- a/src/lib/guess_crop.cc +++ b/src/lib/guess_crop.cc @@ -61,6 +61,16 @@ guess_crop (shared_ptr image, double threshold) } break; } + case AV_PIX_FMT_YUV422P10LE: + { + uint16_t const* data = reinterpret_cast(image->data()[0] + (start_x * 2) + (start_y * image->stride()[0])); + for (int p = 0; p < pixels; ++p) { + /* Just using Y */ + brightest = std::max(brightest, static_cast(*data) / 1024); + data += rows ? 1 : (image->stride()[0] / 2); + } + break; + } default: throw PixelFormatError("guess_crop()", image->pixel_format()); }