projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
83c16ca
)
Make horizontal_factor look the same as vertical_factor.
author
Carl Hetherington
<cth@carlh.net>
Sat, 30 Dec 2017 00:20:10 +0000
(
00:20
+0000)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 30 Dec 2017 00:20:10 +0000
(
00:20
+0000)
src/lib/image.cc
patch
|
blob
|
history
diff --git
a/src/lib/image.cc
b/src/lib/image.cc
index da1bb86ee36d7e592971a549480a4e2924e8e67c..92c1ab9a227575273641f4725552205d0697d885 100644
(file)
--- a/
src/lib/image.cc
+++ b/
src/lib/image.cc
@@
-68,15
+68,16
@@
Image::vertical_factor (int n) const
int
Image::horizontal_factor (int n) const
{
int
Image::horizontal_factor (int n) const
{
- i
nt 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
);
+ i
f (n == 0) {
+ return 1;
+ }
+
+
AVPixFmtDescriptor const * d = av_pix_fmt_desc_get(
_pixel_format);
+ if (!d) {
+
throw PixelFormatError ("sample_size()", _pixel_format
);
}
}
- return horizontal_factor;
+
+ return pow (2.0f, d->log2_chroma_w);
}
/** @param n Component index.
}
/** @param n Component index.