summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
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 */