aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-invert-luma.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-08-05 00:03:44 +0200
committerMattias Andrée <maandree@kth.se>2017-08-05 00:03:44 +0200
commitba67e5506bd93eef064d72883ff94dbadee14082 (patch)
tree2c3c77cc1d9e951d8f59f778e1c3f9226ed03f56 /src/blind-invert-luma.c
parentfix typo and alphabetical order of commands (diff)
downloadblind-ba67e5506bd93eef064d72883ff94dbadee14082.tar.gz
blind-ba67e5506bd93eef064d72883ff94dbadee14082.tar.bz2
blind-ba67e5506bd93eef064d72883ff94dbadee14082.tar.xz
Add support for skipping conversion to CIEXYZ (not complete)
Some tools are colour space agnostic or even encoding agnostic, by skipping conversion to CIEXYZ when these tools are used, the rendering time can be significantly reduced. The video can also be split horizontally and vertically, and latted merged back, so it is not necessary to convert the entire video if only parts of it actually need it. Because some tools are less agnostic than other tools, partial conversion to CIEXYZ is also added. blind-convert must be updated, and all tools most be test Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-invert-luma.c')
-rw-r--r--src/blind-invert-luma.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/blind-invert-luma.c b/src/blind-invert-luma.c
index d26f081..e6b8a34 100644
--- a/src/blind-invert-luma.c
+++ b/src/blind-invert-luma.c
@@ -41,14 +41,14 @@ USAGE("[-iw] mask-stream")
}\
} while (0)
-static void process_xyza (struct stream *colour, struct stream *mask, size_t n) {PROCESS(double,);}
-static void process_xyza_i (struct stream *colour, struct stream *mask, size_t n) {PROCESS(double, 1 -);}
-static void process_xyza_w (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(double,);}
-static void process_xyza_iw (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(double, 1 -);}
-static void process_xyzaf (struct stream *colour, struct stream *mask, size_t n) {PROCESS(float,);}
-static void process_xyzaf_i (struct stream *colour, struct stream *mask, size_t n) {PROCESS(float, 1 -);}
-static void process_xyzaf_w (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(float,);}
-static void process_xyzaf_iw(struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(float, 1 -);}
+static void process_lf (struct stream *colour, struct stream *mask, size_t n) {PROCESS(double,);}
+static void process_lf_i (struct stream *colour, struct stream *mask, size_t n) {PROCESS(double, 1 -);}
+static void process_lf_w (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(double,);}
+static void process_lf_iw(struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(double, 1 -);}
+static void process_f (struct stream *colour, struct stream *mask, size_t n) {PROCESS(float,);}
+static void process_f_i (struct stream *colour, struct stream *mask, size_t n) {PROCESS(float, 1 -);}
+static void process_f_w (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(float,);}
+static void process_f_iw (struct stream *colour, struct stream *mask, size_t n) {PROCESS_W(float, 1 -);}
int
main(int argc, char *argv[])
@@ -74,12 +74,14 @@ main(int argc, char *argv[])
eopen_stream(&colour, NULL);
eopen_stream(&mask, argv[0]);
- if (!strcmp(colour.pixfmt, "xyza"))
- process = invert ? whitepoint ? process_xyza_iw : process_xyza_i
- : whitepoint ? process_xyza_w : process_xyza;
- else if (!strcmp(colour.pixfmt, "xyza f"))
- process = invert ? whitepoint ? process_xyzaf_iw : process_xyzaf_i
- : whitepoint ? process_xyzaf_w : process_xyzaf;
+ CHECK_ALPHA(&colour);
+ CHECK_COLOUR_SPACE(&colour, CIEXYZ);
+ if (colour.encoding == DOUBLE)
+ process = invert ? whitepoint ? process_lf_iw : process_lf_i
+ : whitepoint ? process_lf_w : process_lf;
+ else if (colour.encoding == FLOAT)
+ process = invert ? whitepoint ? process_f_iw : process_f_i
+ : whitepoint ? process_f_w : process_f;
else
eprintf("pixel format %s is not supported, try xyza\n", colour.pixfmt);