FFmpeg
Macros | Typedefs | Functions
int128.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <limits.h>
#include "config.h"
#include "integer.h"

Go to the source code of this file.

Macros

#define AV_INT128_NATIVE   0
 
#define av_add128(a, b)   av_add_i(a, b)
 
#define av_sub128(a, b)   av_sub_i(a, b)
 
#define av_mul128(a, b)   av_mul_i(a, b)
 
#define av_div128(a, b)   av_div_i(a, b)
 
#define av_cmp128(a, b)   av_cmp_i(a, b)
 
#define av_min128(a, b)   (av_cmp_i(a, b) > 0 ? (b) : (a))
 
#define av_max128(a, b)   (av_cmp_i(a, b) > 0 ? (a) : (b))
 
#define av_eq128(a, b)   (av_cmp_i(a, b) == 0)
 
#define av_mod128(a, b)   av_mod_i(NULL, a, b)
 
#define av_shr128(a, b)   av_shr_i(a, b)
 
#define av_to128i(a)   av_int2i(a)
 
#define av_from128i(a)   av_i2int(a)
 
#define av_from128u(a)   ((uint64_t) av_i2int(a))
 
#define av_test128(a)   (!av_eq128(a, av_to128u(0)))
 

Typedefs

typedef AVInteger av_uint128
 
typedef AVInteger av_int128
 

Functions

static av_always_inline av_uint128 av_to128u (uint64_t a)
 

Detailed Description

128-bit integers, falling back to integer.h if necessary

Author
Niklas Haas

Definition in file int128.h.

Macro Definition Documentation

◆ AV_INT128_NATIVE

#define AV_INT128_NATIVE   0

Definition at line 47 of file int128.h.

◆ av_add128

#define av_add128 (   a,
  b 
)    av_add_i(a, b)

Definition at line 71 of file int128.h.

◆ av_sub128

#define av_sub128 (   a,
  b 
)    av_sub_i(a, b)

Definition at line 72 of file int128.h.

◆ av_mul128

#define av_mul128 (   a,
  b 
)    av_mul_i(a, b)

Definition at line 73 of file int128.h.

◆ av_div128

#define av_div128 (   a,
  b 
)    av_div_i(a, b)

Definition at line 74 of file int128.h.

◆ av_cmp128

#define av_cmp128 (   a,
  b 
)    av_cmp_i(a, b)

Definition at line 75 of file int128.h.

◆ av_min128

#define av_min128 (   a,
  b 
)    (av_cmp_i(a, b) > 0 ? (b) : (a))

Definition at line 76 of file int128.h.

◆ av_max128

#define av_max128 (   a,
  b 
)    (av_cmp_i(a, b) > 0 ? (a) : (b))

Definition at line 77 of file int128.h.

◆ av_eq128

#define av_eq128 (   a,
  b 
)    (av_cmp_i(a, b) == 0)

Definition at line 78 of file int128.h.

◆ av_mod128

#define av_mod128 (   a,
  b 
)    av_mod_i(NULL, a, b)

Definition at line 79 of file int128.h.

◆ av_shr128

#define av_shr128 (   a,
  b 
)    av_shr_i(a, b)

Definition at line 80 of file int128.h.

◆ av_to128i

#define av_to128i (   a)    av_int2i(a)

Definition at line 81 of file int128.h.

◆ av_from128i

#define av_from128i (   a)    av_i2int(a)

Definition at line 82 of file int128.h.

◆ av_from128u

#define av_from128u (   a)    ((uint64_t) av_i2int(a))

Definition at line 83 of file int128.h.

◆ av_test128

#define av_test128 (   a)    (!av_eq128(a, av_to128u(0)))

Definition at line 84 of file int128.h.

Typedef Documentation

◆ av_uint128

Definition at line 48 of file int128.h.

◆ av_int128

Definition at line 49 of file int128.h.

Function Documentation

◆ av_to128u()

static av_always_inline av_uint128 av_to128u ( uint64_t  a)
static

Definition at line 86 of file int128.h.

Referenced by reduce64().