chromium/third_party/libavif/src/src/utils.c

// Copyright 2019 Joe Drago. All rights reserved.
// SPDX-License-Identifier: BSD-2-Clause

#include "avif/internal.h"

#include <assert.h>
#include <math.h>
#include <string.h>

float avifRoundf(float v)
{}

// Thanks, Rob Pike! https://commandcenter.blogspot.nl/2012/04/byte-order-fallacy.html

uint16_t avifHTONS(uint16_t s)
{}

uint16_t avifNTOHS(uint16_t s)
{}

uint16_t avifCTOHS(uint16_t s)
{}

uint32_t avifHTONL(uint32_t l)
{}

uint32_t avifNTOHL(uint32_t l)
{}

uint32_t avifCTOHL(uint32_t l)
{}

uint64_t avifHTON64(uint64_t l)
{}

uint64_t avifNTOH64(uint64_t l)
{}

AVIF_ARRAY_DECLARE(avifArrayInternal, uint8_t, } ;

// On error, this function must set arr->ptr to NULL and both arr->count and arr->capacity to 0.
avifBool avifArrayCreate(void * arrayStruct, uint32_t elementSize, uint32_t initialCapacity)
{}

void * avifArrayPush(void * arrayStruct)
{}

void avifArrayPop(void * arrayStruct)
{}

void avifArrayDestroy(void * arrayStruct)
{}

// |a| and |b| hold int32_t values. The int64_t type is used so that we can negate INT32_MIN without
// overflowing int32_t.
static int64_t calcGCD(int64_t a, int64_t b)
{}

void avifFractionSimplify(avifFraction * f)
{}

static avifBool overflowsInt32(int64_t x)
{}

avifBool avifFractionCD(avifFraction * a, avifFraction * b)
{}

avifBool avifFractionAdd(avifFraction a, avifFraction b, avifFraction * result)
{}

avifBool avifFractionSub(avifFraction a, avifFraction b, avifFraction * result)
{}

static avifBool avifDoubleToUnsignedFractionImpl(double v, uint32_t maxNumerator, uint32_t * numerator, uint32_t * denominator)
{}

avifBool avifDoubleToSignedFraction(double v, int32_t * numerator, uint32_t * denominator)
{}

avifBool avifDoubleToUnsignedFraction(double v, uint32_t * numerator, uint32_t * denominator)
{}