summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-03 23:21:01 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-04 00:42:36 +0100
commite5eec6c5e7b96cc6e7697bbf42d3f27546c5ad52 (patch)
treecc9e17bc41d50a5b63b561513627cd4e49164a78 /src/lib/image.cc
parent18d58dc6984fb2adde029131a7b2e141a5daddbf (diff)
Allow build with the Ubuntu 16.04 version of FFmpeg.
Diffstat (limited to 'src/lib/image.cc')
-rw-r--r--src/lib/image.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 7ccb9906e..49cb20a61 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -581,6 +581,18 @@ Image::bytes_per_pixel (int c) const
float bpp[4] = { 0, 0, 0, 0 };
+#ifdef DCPOMATIC_HAVE_AVCOMPONENTDESCRIPTOR_DEPTH_MINUS1
+ bpp[0] = floor ((d->comp[0].depth_minus1 + 8) / 8);
+ if (d->nb_components > 1) {
+ bpp[1] = floor ((d->comp[1].depth_minus1 + 8) / 8) / pow (2.0f, d->log2_chroma_w);
+ }
+ if (d->nb_components > 2) {
+ bpp[2] = floor ((d->comp[2].depth_minus1 + 8) / 8) / pow (2.0f, d->log2_chroma_w);
+ }
+ if (d->nb_components > 3) {
+ bpp[3] = floor ((d->comp[3].depth_minus1 + 8) / 8) / pow (2.0f, d->log2_chroma_w);
+ }
+#else
bpp[0] = floor ((d->comp[0].depth + 7) / 8);
if (d->nb_components > 1) {
bpp[1] = floor ((d->comp[1].depth + 7) / 8) / pow (2.0f, d->log2_chroma_w);
@@ -591,6 +603,7 @@ Image::bytes_per_pixel (int c) const
if (d->nb_components > 3) {
bpp[3] = floor ((d->comp[3].depth + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
+#endif
if ((d->flags & AV_PIX_FMT_FLAG_PLANAR) == 0) {
/* Not planar; sum them up */