diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-08-05 00:03:44 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-08-05 00:03:44 +0200 |
| commit | ba67e5506bd93eef064d72883ff94dbadee14082 (patch) | |
| tree | 2c3c77cc1d9e951d8f59f778e1c3f9226ed03f56 /src/blind-dissolve.c | |
| parent | fix typo and alphabetical order of commands (diff) | |
| download | blind-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-dissolve.c')
| -rw-r--r-- | src/blind-dissolve.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/blind-dissolve.c b/src/blind-dissolve.c index be92c2e..b78121e 100644 --- a/src/blind-dissolve.c +++ b/src/blind-dissolve.c @@ -10,10 +10,10 @@ static int reverse = 0; #define PROCESS(TYPE)\ do {\ - size_t i;\ + size_t i = stream->alpha_chan * stream->chan_size;\ TYPE a = fm ? (TYPE)(reverse ? f : fm - f) / fm_##TYPE : (TYPE)0.5;\ - for (i = 0; i < n; i += stream->pixel_size)\ - ((TYPE *)(stream->buf + i))[3] *= a;\ + for (; i < n; i += stream->pixel_size)\ + *(TYPE *)(stream->buf + i) *= a;\ } while (0) static void process_lf(struct stream *stream, size_t n, size_t f) {PROCESS(double);} @@ -38,10 +38,8 @@ main(int argc, char *argv[]) eopen_stream(&stream, NULL); - if (stream.encoding == DOUBLE) - process = process_lf; - else - process = process_f; + SELECT_PROCESS_FUNCTION(&stream); + CHECK_CHANS(&stream, != -1, == stream.luma_chan); if (!stream.frames) eprintf("video's length is not recorded"); |
