projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
799639b
)
Tiny optimisation.
author
Carl Hetherington
<cth@carlh.net>
Sat, 18 Dec 2021 22:32:11 +0000
(23:32 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 23 Dec 2021 11:59:56 +0000
(12:59 +0100)
src/lib/image.cc
patch
|
blob
|
history
diff --git
a/src/lib/image.cc
b/src/lib/image.cc
index ad88568cddf5d489a097d070dd71fc8b4b59b6b7..c6d2345a824916e48f341c7a8339bc3962282316 100644
(file)
--- a/
src/lib/image.cc
+++ b/
src/lib/image.cc
@@
-122,15
+122,15
@@
Image::sample_size (int n) const
int
Image::planes () const
{
int
Image::planes () const
{
+ if (_pixel_format == AV_PIX_FMT_PAL8) {
+ return 2;
+ }
+
auto d = av_pix_fmt_desc_get(_pixel_format);
if (!d) {
throw PixelFormatError ("planes()", _pixel_format);
}
auto d = av_pix_fmt_desc_get(_pixel_format);
if (!d) {
throw PixelFormatError ("planes()", _pixel_format);
}
- if (_pixel_format == AV_PIX_FMT_PAL8) {
- return 2;
- }
-
if ((d->flags & AV_PIX_FMT_FLAG_PLANAR) == 0) {
return 1;
}
if ((d->flags & AV_PIX_FMT_FLAG_PLANAR) == 0) {
return 1;
}