#include "avif/internal.h"
#include <assert.h>
#include <stdint.h>
#include <string.h>
#if defined(_WIN32)
#include <process.h>
#include <windows.h>
#else
#include <pthread.h>
#endif
struct YUVBlock
{ … };
avifBool avifGetRGBColorSpaceInfo(const avifRGBImage * rgb, avifRGBColorSpaceInfo * info)
{ … }
avifBool avifGetYUVColorSpaceInfo(const avifImage * image, avifYUVColorSpaceInfo * info)
{ … }
static avifBool avifPrepareReformatState(const avifImage * image, const avifRGBImage * rgb, avifReformatState * state)
{ … }
static int avifYUVColorSpaceInfoYToUNorm(avifYUVColorSpaceInfo * info, float v)
{ … }
static int avifYUVColorSpaceInfoUVToUNorm(avifYUVColorSpaceInfo * info, float v)
{ … }
avifResult avifImageRGBToYUV(avifImage * image, const avifRGBImage * rgb)
{ … }
static avifBool avifCreateYUVToRGBLookUpTables(float ** unormFloatTableY, float ** unormFloatTableUV, uint32_t depth, const avifReformatState * state)
{ … }
static void avifFreeYUVToRGBLookUpTables(float ** unormFloatTableY, float ** unormFloatTableUV)
{ … }
#define RGB565(R, G, B) …
static void avifStoreRGB8Pixel(avifRGBFormat format, uint8_t R, uint8_t G, uint8_t B, uint8_t * ptrR, uint8_t * ptrG, uint8_t * ptrB)
{ … }
static void avifGetRGB565(const uint8_t * ptrR, uint8_t * R, uint8_t * G, uint8_t * B)
{ … }
static avifResult avifImageYUVAnyToRGBAnySlow(const avifImage * image,
avifRGBImage * rgb,
const avifReformatState * state,
avifAlphaMultiplyMode alphaMultiplyMode)
{ … }
static avifResult avifImageYUV16ToRGB16Color(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV16ToRGB16Mono(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV16ToRGB8Color(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV16ToRGB8Mono(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV8ToRGB16Color(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV8ToRGB16Mono(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageIdentity8ToRGB8ColorFullRange(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV8ToRGB8Color(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
static avifResult avifImageYUV8ToRGB8Mono(const avifImage * image, avifRGBImage * rgb, avifReformatState * state)
{ … }
#define F16_MULTIPLIER …
avifF16;
static avifResult avifRGBImageToF16(avifRGBImage * rgb)
{ … }
static avifResult avifImageYUVToRGBImpl(const avifImage * image, avifRGBImage * rgb, avifReformatState * state, avifAlphaMultiplyMode alphaMultiplyMode)
{ … }
YUVToRGBThreadData;
#if defined(_WIN32)
static unsigned int __stdcall avifImageYUVToRGBThreadWorker(void * arg)
#else
static void * avifImageYUVToRGBThreadWorker(void * arg)
#endif
{ … }
static avifBool avifCreateYUVToRGBThread(YUVToRGBThreadData * tdata)
{ … }
static avifBool avifJoinYUVToRGBThread(YUVToRGBThreadData * tdata)
{ … }
avifResult avifImageYUVToRGB(const avifImage * image, avifRGBImage * rgb)
{ … }
#define LIMITED_TO_FULL(MINLIMITEDY, MAXLIMITEDY, FULLY) …
#define FULL_TO_LIMITED(MINLIMITEDY, MAXLIMITEDY, FULLY) …
int avifLimitedToFullY(uint32_t depth, int v)
{ … }
int avifLimitedToFullUV(uint32_t depth, int v)
{ … }
int avifFullToLimitedY(uint32_t depth, int v)
{ … }
int avifFullToLimitedUV(uint32_t depth, int v)
{ … }
static inline uint16_t avifFloatToF16(float v)
{ … }
static inline float avifF16ToFloat(uint16_t v)
{ … }
void avifGetRGBAPixel(const avifRGBImage * src, uint32_t x, uint32_t y, const avifRGBColorSpaceInfo * info, float rgbaPixel[4])
{ … }
void avifSetRGBAPixel(const avifRGBImage * dst, uint32_t x, uint32_t y, const avifRGBColorSpaceInfo * info, const float rgbaPixel[4])
{ … }