LIBJXL
Typedefs | Functions
butteraugli.h File Reference

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"
Include dependency graph for butteraugli.h:
This graph shows which files directly or indirectly include this file:

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 JxlButteraugliApiJxlButteraugliApiCreate (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 JxlButteraugliResultJxlButteraugliCompute (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)
 

Detailed Description

Butteraugli API for JPEG XL.

Typedef Documentation

◆ JxlButteraugliApi

typedef struct JxlButteraugliApiStruct JxlButteraugliApi

Opaque structure that holds a butteraugli API.

Allocated and initialized with JxlButteraugliApiCreate(). Cleaned up and deallocated with JxlButteraugliApiDestroy().

◆ JxlButteraugliResult

typedef struct JxlButteraugliResultStruct JxlButteraugliResult

Opaque structure that holds intermediary butteraugli results.

Allocated and initialized with JxlButteraugliCompute(). Cleaned up and deallocated with JxlButteraugliResultDestroy().

Function Documentation

◆ JxlButteraugliApiCreate()

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.

Parameters
memory_managercustom allocator function. It may be NULL. The memory manager will be copied internally.
Returns
NULL if the instance can not be allocated or initialized
pointer to initialized JxlEncoder otherwise

◆ JxlButteraugliApiDestroy()

JXL_EXPORT void JxlButteraugliApiDestroy ( JxlButteraugliApi api)

Deinitializes and frees JxlButteraugliApi instance.

Parameters
apiinstance to be cleaned up and deallocated.

◆ JxlButteraugliApiSetHFAsymmetry()

JXL_EXPORT void JxlButteraugliApiSetHFAsymmetry ( JxlButteraugliApi api,
float  v 
)

Set the hf_asymmetry option for butteraugli.

Parameters
apiapi instance.
vnew hf_asymmetry value.

◆ JxlButteraugliApiSetIntensityTarget()

JXL_EXPORT void JxlButteraugliApiSetIntensityTarget ( JxlButteraugliApi api,
float  v 
)

Set the intensity_target option for butteraugli.

Parameters
apiapi instance.
vnew intensity_target value.

◆ JxlButteraugliApiSetParallelRunner()

JXL_EXPORT void JxlButteraugliApiSetParallelRunner ( JxlButteraugliApi api,
JxlParallelRunner  parallel_runner,
void *  parallel_runner_opaque 
)

Set the parallel runner for multithreading.

Parameters
apiapi instance.
parallel_runnerfunction pointer to runner for multithreading. A multithreaded runner should be set to reach fast performance.
parallel_runner_opaqueopaque pointer for parallel_runner.

◆ JxlButteraugliCompute()

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.

Parameters
apiapi instance for this computation.
xsizewidth of the compared images.
ysizeheight of the compared images.
pixel_format_origpixel format for original image.
buffer_origpixel data for original image.
size_origsize of buffer_orig in bytes.
pixel_format_distpixel format for distortion.
buffer_distpixel data for distortion.
size_distsize of buffer_dist in bytes.
Returns
NULL if the results can not be computed or initialized.
pointer to initialized and computed intermediary result.

◆ JxlButteraugliResultDestroy()

JXL_EXPORT void JxlButteraugliResultDestroy ( JxlButteraugliResult result)

Deinitializes and frees JxlButteraugliResult instance.

Parameters
resultinstance to be cleaned up and deallocated.

◆ JxlButteraugliResultGetDistance()

JXL_EXPORT float JxlButteraugliResultGetDistance ( const JxlButteraugliResult result,
float  pnorm 
)

Computes a butteraugli distance based on an intermediary butteraugli result.

Parameters
resultintermediary result instance.
pnormpnorm to calculate.
Returns
distance using the given pnorm.

◆ JxlButteraugliResultGetDistmap()

JXL_EXPORT void JxlButteraugliResultGetDistmap ( const JxlButteraugliResult result,
const float **  buffer,
uint32_t *  row_stride 
)

Get a pointer to the distmap in the result.

Parameters
resultintermediary result instance.
bufferwill be set to the distmap. The distance value for (x,y) will be available at buffer + y * row_stride + x.
row_stridewill be set to the row stride of the distmap.

◆ JxlButteraugliResultGetMaxDistance()

JXL_EXPORT float JxlButteraugliResultGetMaxDistance ( const JxlButteraugliResult result)

Computes butteraugli max distance based on an intermediary butteraugli result.

Parameters
resultintermediary result instance.
Returns
max distance.