projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c7013a2
)
Support auto-crop for YUV422P10LE.
author
Carl Hetherington
<cth@carlh.net>
Fri, 13 May 2022 11:56:11 +0000
(13:56 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 13 May 2022 11:56:11 +0000
(13:56 +0200)
src/lib/guess_crop.cc
patch
|
blob
|
history
diff --git
a/src/lib/guess_crop.cc
b/src/lib/guess_crop.cc
index 7ee7a72860c4051bf632841a8b92f4e72f1d89a6..3538f14dee4356ebec6bb52aa8e59b9862c7cb41 100644
(file)
--- a/
src/lib/guess_crop.cc
+++ b/
src/lib/guess_crop.cc
@@
-61,6
+61,16
@@
guess_crop (shared_ptr<const Image> image, double threshold)
}
break;
}
}
break;
}
+ case AV_PIX_FMT_YUV422P10LE:
+ {
+ uint16_t const* data = reinterpret_cast<uint16_t*>(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<double>(*data) / 1024);
+ data += rows ? 1 : (image->stride()[0] / 2);
+ }
+ break;
+ }
default:
throw PixelFormatError("guess_crop()", image->pixel_format());
}
default:
throw PixelFormatError("guess_crop()", image->pixel_format());
}