|
LIBJXL
|
Butteraugli API for JPEG XL. More...
#include "jxl/jxl_export.h"#include "jxl/memory_manager.h"#include "jxl/parallel_runner.h"#include "jxl/types.h"

Go to the source code of this file.
Typedefs | |
| typedef struct JxlButteraugliApiStruct | JxlButteraugliApi |
| typedef struct JxlButteraugliResultStruct | JxlButteraugliResult |
Functions | |
| JXL_EXPORT void | JxlButteraugliResultDestroy (JxlButteraugliResult *result) |
| JXL_EXPORT JxlButteraugliApi * | JxlButteraugliApiCreate (const JxlMemoryManager *memory_manager) |
| JXL_EXPORT void | JxlButteraugliApiSetParallelRunner (JxlButteraugliApi *api, JxlParallelRunner parallel_runner, void *parallel_runner_opaque) |
| JXL_EXPORT void | JxlButteraugliApiSetHFAsymmetry (JxlButteraugliApi *api, float v) |
| JXL_EXPORT void | JxlButteraugliApiSetIntensityTarget (JxlButteraugliApi *api, float v) |
| JXL_EXPORT void | JxlButteraugliApiDestroy (JxlButteraugliApi *api) |
| JXL_EXPORT JxlButteraugliResult * | JxlButteraugliCompute (const JxlButteraugliApi *api, uint32_t xsize, uint32_t ysize, const JxlPixelFormat *pixel_format_orig, const void *buffer_orig, size_t size_orig, const JxlPixelFormat *pixel_format_dist, const void *buffer_dist, size_t size_dist) |
| JXL_EXPORT float | JxlButteraugliResultGetMaxDistance (const JxlButteraugliResult *result) |
| JXL_EXPORT float | JxlButteraugliResultGetDistance (const JxlButteraugliResult *result, float pnorm) |
| JXL_EXPORT void | JxlButteraugliResultGetDistmap (const JxlButteraugliResult *result, const float **buffer, uint32_t *row_stride) |
Butteraugli API for JPEG XL.
| typedef struct JxlButteraugliApiStruct JxlButteraugliApi |
Opaque structure that holds a butteraugli API.
Allocated and initialized with JxlButteraugliApiCreate(). Cleaned up and deallocated with JxlButteraugliApiDestroy().
| typedef struct JxlButteraugliResultStruct JxlButteraugliResult |
Opaque structure that holds intermediary butteraugli results.
Allocated and initialized with JxlButteraugliCompute(). Cleaned up and deallocated with JxlButteraugliResultDestroy().
| JXL_EXPORT JxlButteraugliApi * JxlButteraugliApiCreate | ( | const JxlMemoryManager * | memory_manager | ) |
Creates an instance of JxlButteraugliApi and initializes it.
memory_manager will be used for all the library dynamic allocations made from this instance. The parameter may be NULL, in which case the default allocator will be used. See jxl/memory_manager.h for details.
| memory_manager | custom allocator function. It may be NULL. The memory manager will be copied internally. |
NULL if the instance can not be allocated or initialized | JXL_EXPORT void JxlButteraugliApiDestroy | ( | JxlButteraugliApi * | api | ) |
Deinitializes and frees JxlButteraugliApi instance.
| api | instance to be cleaned up and deallocated. |
| JXL_EXPORT void JxlButteraugliApiSetHFAsymmetry | ( | JxlButteraugliApi * | api, |
| float | v | ||
| ) |
Set the hf_asymmetry option for butteraugli.
| api | api instance. |
| v | new hf_asymmetry value. |
| JXL_EXPORT void JxlButteraugliApiSetIntensityTarget | ( | JxlButteraugliApi * | api, |
| float | v | ||
| ) |
Set the intensity_target option for butteraugli.
| api | api instance. |
| v | new intensity_target value. |
| JXL_EXPORT void JxlButteraugliApiSetParallelRunner | ( | JxlButteraugliApi * | api, |
| JxlParallelRunner | parallel_runner, | ||
| void * | parallel_runner_opaque | ||
| ) |
Set the parallel runner for multithreading.
| api | api instance. |
| parallel_runner | function pointer to runner for multithreading. A multithreaded runner should be set to reach fast performance. |
| parallel_runner_opaque | opaque pointer for parallel_runner. |
| JXL_EXPORT JxlButteraugliResult * JxlButteraugliCompute | ( | const JxlButteraugliApi * | api, |
| uint32_t | xsize, | ||
| uint32_t | ysize, | ||
| const JxlPixelFormat * | pixel_format_orig, | ||
| const void * | buffer_orig, | ||
| size_t | size_orig, | ||
| const JxlPixelFormat * | pixel_format_dist, | ||
| const void * | buffer_dist, | ||
| size_t | size_dist | ||
| ) |
Computes intermediary butteraugli result between an original image and a distortion.
| api | api instance for this computation. |
| xsize | width of the compared images. |
| ysize | height of the compared images. |
| pixel_format_orig | pixel format for original image. |
| buffer_orig | pixel data for original image. |
| size_orig | size of buffer_orig in bytes. |
| pixel_format_dist | pixel format for distortion. |
| buffer_dist | pixel data for distortion. |
| size_dist | size of buffer_dist in bytes. |
NULL if the results can not be computed or initialized. | JXL_EXPORT void JxlButteraugliResultDestroy | ( | JxlButteraugliResult * | result | ) |
Deinitializes and frees JxlButteraugliResult instance.
| result | instance to be cleaned up and deallocated. |
| JXL_EXPORT float JxlButteraugliResultGetDistance | ( | const JxlButteraugliResult * | result, |
| float | pnorm | ||
| ) |
Computes a butteraugli distance based on an intermediary butteraugli result.
| result | intermediary result instance. |
| pnorm | pnorm to calculate. |
| JXL_EXPORT void JxlButteraugliResultGetDistmap | ( | const JxlButteraugliResult * | result, |
| const float ** | buffer, | ||
| uint32_t * | row_stride | ||
| ) |
Get a pointer to the distmap in the result.
| result | intermediary result instance. |
| buffer | will be set to the distmap. The distance value for (x,y) will be available at buffer + y * row_stride + x. |
| row_stride | will be set to the row stride of the distmap. |
| JXL_EXPORT float JxlButteraugliResultGetMaxDistance | ( | const JxlButteraugliResult * | result | ) |
Computes butteraugli max distance based on an intermediary butteraugli result.
| result | intermediary result instance. |