From ba67e5506bd93eef064d72883ff94dbadee14082 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Aug 2017 00:03:44 +0200 Subject: Add support for skipping conversion to CIEXYZ (not complete) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/blind-set-saturation.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/blind-set-saturation.c') diff --git a/src/blind-set-saturation.c b/src/blind-set-saturation.c index 2c30377..c7e6ebf 100644 --- a/src/blind-set-saturation.c +++ b/src/blind-set-saturation.c @@ -41,10 +41,10 @@ USAGE("[-w] saturation-stream") }\ } while (0) -static void process_xyza (struct stream *colour, struct stream *satur, size_t n) {PROCESS(double);} -static void process_xyza_w (struct stream *colour, struct stream *satur, size_t n) {PROCESS_W(double);} -static void process_xyzaf (struct stream *colour, struct stream *satur, size_t n) {PROCESS(float);} -static void process_xyzaf_w(struct stream *colour, struct stream *satur, size_t n) {PROCESS_W(float);} +static void process_lf (struct stream *colour, struct stream *satur, size_t n) {PROCESS(double);} +static void process_lf_w(struct stream *colour, struct stream *satur, size_t n) {PROCESS_W(double);} +static void process_f (struct stream *colour, struct stream *satur, size_t n) {PROCESS(float);} +static void process_f_w (struct stream *colour, struct stream *satur, size_t n) {PROCESS_W(float);} int main(int argc, char *argv[]) @@ -67,10 +67,12 @@ main(int argc, char *argv[]) eopen_stream(&colour, NULL); eopen_stream(&satur, argv[0]); - if (!strcmp(colour.pixfmt, "xyza")) - process = whitepoint ? process_xyza_w : process_xyza; - else if (!strcmp(colour.pixfmt, "xyza f")) - process = whitepoint ? process_xyzaf_w : process_xyzaf; + CHECK_COLOUR_SPACE(&colour, CIEXYZ); + CHECK_CHANS(&colour, == 3, == 1); + if (colour.encoding == DOUBLE) + process = whitepoint ? process_lf_w : process_lf; + else if (colour.encoding == FLOAT) + process = whitepoint ? process_f_w : process_f; else eprintf("pixel format %s is not supported, try xyza\n", colour.pixfmt); -- cgit v1.2.3-70-g09d2