summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-06 00:19:24 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-06 00:19:24 +0000
commit4c306639a3cebe1600ad0d869eec084d8c6acf7a (patch)
tree9f1dd703d1b0e692979b2d0559847cf9e87af27c /src/lib
parentbb911c462ab6e04d399bfc68c2d331b0d4e9ef97 (diff)
Unwrap loop and remove lots of calls to OpenJPEGImage::data.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/j2k_image_proxy.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc
index 52b6f34f0..1ef00d946 100644
--- a/src/lib/j2k_image_proxy.cc
+++ b/src/lib/j2k_image_proxy.cc
@@ -170,12 +170,15 @@ J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_siz
int const width = _decompressed->size().width;
int p = 0;
+ int* decomp_0 = _decompressed->data (0);
+ int* decomp_1 = _decompressed->data (1);
+ int* decomp_2 = _decompressed->data (2);
for (int y = 0; y < _decompressed->size().height; ++y) {
uint16_t* q = (uint16_t *) (image->data()[0] + y * image->stride()[0]);
for (int x = 0; x < width; ++x) {
- for (int c = 0; c < 3; ++c) {
- *q++ = _decompressed->data(c)[p] << 4;
- }
+ *q++ = decomp_0[p] << 4;
+ *q++ = decomp_1[p] << 4;
+ *q++ = decomp_2[p] << 4;
++p;
}
}