FFmpeg
Functions
libjxl.c File Reference
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include <jxl/memory_manager.h>
#include "libjxl.h"

Go to the source code of this file.

Functions

size_t ff_libjxl_get_threadcount (int threads)
 Transform threadcount in ffmpeg to one used by libjxl. More...
 
static void * libjxl_av_malloc (void *opaque, size_t size)
 Wrapper around av_malloc used as a jpegxl_alloc_func. More...
 
static void libjxl_av_free (void *opaque, void *address)
 Wrapper around av_free used as a jpegxl_free_func. More...
 
void ff_libjxl_init_memory_manager (JxlMemoryManager *manager)
 Initialize and populate a JxlMemoryManager with av_malloc() and av_free() so libjxl will use these functions. More...
 

Detailed Description

JPEG XL via libjxl common support implementation

Definition in file libjxl.c.

Function Documentation

◆ ff_libjxl_get_threadcount()

size_t ff_libjxl_get_threadcount ( int  threads)

Transform threadcount in ffmpeg to one used by libjxl.

Parameters
threadsffmpeg's threads AVOption
Returns
thread count for libjxl's parallel runner

Definition at line 33 of file libjxl.c.

Referenced by libjxl_decode_init(), and libjxl_encode_init().

◆ libjxl_av_malloc()

static void* libjxl_av_malloc ( void *  opaque,
size_t  size 
)
static

Wrapper around av_malloc used as a jpegxl_alloc_func.

Parameters
opaqueopaque pointer for jpegxl_alloc_func, always ignored
sizeSize in bytes for the memory block to be allocated
Returns
Pointer to the allocated block, or NULL if it cannot be allocated

Definition at line 49 of file libjxl.c.

Referenced by ff_libjxl_init_memory_manager().

◆ libjxl_av_free()

static void libjxl_av_free ( void *  opaque,
void *  address 
)
static

Wrapper around av_free used as a jpegxl_free_func.

Parameters
opaqueopaque pointer for jpegxl_free_func, always ignored
addressPointer to the allocated block, to free. NULL permitted as a no-op.

Definition at line 60 of file libjxl.c.

Referenced by ff_libjxl_init_memory_manager().

◆ ff_libjxl_init_memory_manager()

void ff_libjxl_init_memory_manager ( JxlMemoryManager *  manager)

Initialize and populate a JxlMemoryManager with av_malloc() and av_free() so libjxl will use these functions.

Parameters
managera pointer to a JxlMemoryManager struct

Definition at line 65 of file libjxl.c.

Referenced by libjxl_decode_init(), and libjxl_encode_init().