summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2014-07-03 09:15:13 +0000
committerAntonin Descampe <antonin@gmail.com>2014-07-03 09:15:13 +0000
commit7d21871ed8124e8e3056e4d81618485596f952df (patch)
tree2920334cbaef19976eff1bc0e5311622978d58cf /src/lib
parenta38b97fae0c9f66ff5c7f152d9ce88f6ee73a5b4 (diff)
[trunk] fixes issue #357. MCT is automatically disabled when
subsamppling is detected.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/j2k.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index 95553735..d06dc05e 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -6453,6 +6453,15 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
opj_j2k_setup_mct_encoding(tcp,image);
}
else {
+ if(tcp->mct==1 && image->numcomps == 3) { // RGB->YCC MCT is enabled
+ if ((image->comps[0].dx != image->comps[1].dx) ||
+ (image->comps[0].dx != image->comps[2].dx) ||
+ (image->comps[0].dy != image->comps[1].dy) ||
+ (image->comps[0].dy != image->comps[2].dy)) {
+ opj_event_msg(p_manager, EVT_WARNING, "Cannot perform MCT on components with different sizes. Disabling MCT.\n");
+ tcp->mct = 0;
+ }
+ }
for (i = 0; i < image->numcomps; i++) {
opj_tccp_t *tccp = &tcp->tccps[i];
opj_image_comp_t * l_comp = &(image->comps[i]);