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/common.h | |
| 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/common.h')
| -rw-r--r-- | src/common.h | 85 |
1 files changed, 82 insertions, 3 deletions
diff --git a/src/common.h b/src/common.h index 7d253c0..3972389 100644 --- a/src/common.h +++ b/src/common.h @@ -69,10 +69,89 @@ # define PIPE_BUF BUFSIZ #endif +#ifndef DONT_INCLUDE_FLOAT +# define SELECT_PROCESS_FUNCTION_FLOAT(stream) else if ((stream)->encoding == FLOAT) process = process_f +#else +# define SELECT_PROCESS_FUNCTION_FLOAT(stream) else if (0) +#endif + +#ifndef DONT_INCLUDE_DOUBLE +# define SELECT_PROCESS_FUNCTION_DOUBLE(stream) else if ((stream)->encoding == DOUBLE) process = process_lf +#else +# define SELECT_PROCESS_FUNCTION_DOUBLE(stream) else if (0) +#endif + +#ifdef INCLUDE_LONG_DOUBLE +# define SELECT_PROCESS_FUNCTION_LONG_DOUBLE(stream) else if ((stream)->encoding == LONG_DOUBLE) process = process_llf +#else +# define SELECT_PROCESS_FUNCTION_LONG_DOUBLE(stream) else if (0) +#endif + +#ifdef INCLUDE_UINT8 +# define SELECT_PROCESS_FUNCTION_UINT8(stream) else if ((stream)->encoding == UINT8) process = process_u8 +#else +# define SELECT_PROCESS_FUNCTION_UINT8(stream) else if (0) +#endif + +#ifdef INCLUDE_UINT16 +# define SELECT_PROCESS_FUNCTION_UINT16(stream) else if ((stream)->encoding == UINT16) process = process_u16 +#else +# define SELECT_PROCESS_FUNCTION_UINT16(stream) else if (0) +#endif + +#ifdef INCLUDE_UINT32 +# define SELECT_PROCESS_FUNCTION_UINT32(stream) else if ((stream)->encoding == UINT32) process = process_u32 +#else +# define SELECT_PROCESS_FUNCTION_UINT32(stream) else if (0) +#endif + +#ifdef INCLUDE_UINT64 +# define SELECT_PROCESS_FUNCTION_UINT64(stream) else if ((stream)->encoding == UINT64) process = process_u64 +#else +# define SELECT_PROCESS_FUNCTION_UINT64(stream) else if (0) +#endif + #define SELECT_PROCESS_FUNCTION(stream)\ do {\ - if ((stream)->encoding == DOUBLE)\ - process = process_lf;\ + if ((stream)->endian != HOST_ENDIAN)\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + SELECT_PROCESS_FUNCTION_FLOAT(stream);\ + SELECT_PROCESS_FUNCTION_DOUBLE(stream);\ + SELECT_PROCESS_FUNCTION_LONG_DOUBLE(stream);\ + SELECT_PROCESS_FUNCTION_UINT8(stream);\ + SELECT_PROCESS_FUNCTION_UINT16(stream);\ + SELECT_PROCESS_FUNCTION_UINT32(stream);\ + SELECT_PROCESS_FUNCTION_UINT64(stream);\ else\ - process = process_f;\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + } while (0) + +#define CHECK_ALPHA_CHAN(stream)\ + do {\ + if ((stream)->alpha_chan != 3)\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + } while (0) + +#define CHECK_CHANS(stream, ALPHA, LUMA)\ + do {\ + if (!(((stream)->alpha_chan ALPHA) && ((stream)->luma_chan LUMA)))\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + } while (0) + +#define CHECK_ALPHA(stream)\ + do {\ + if ((stream)->alpha != UNPREMULTIPLIED)\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + } while (0) + +#define CHECK_COLOUR_SPACE(stream, colour_space)\ + do {\ + if ((stream)->space != (colour_space))\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ + } while (0) + +#define CHECK_N_CHAN(stream, low, high)\ + do {\ + if ((stream)->n_chan < (low) || (stream)->n_chan > (high))\ + eprintf("pixel format %s is not supported, try xyza\n", (stream)->pixfmt);\ } while (0) |
