FFmpeg
Loading...
Searching...
No Matches
int128.h File Reference

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

#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_add128(a, b)
 
#define av_sub128(a, b)
 
#define av_mul128(a, b)
 
#define av_div128(a, b)
 
#define av_cmp128(a, b)
 
#define av_min128(a, b)
 
#define av_max128(a, b)
 
#define av_eq128(a, b)
 
#define av_mod128(a, b)
 
#define av_shr128(a, b)
 
#define av_to128i(a)
 
#define av_from128i(a)
 
#define av_from128u(a)
 
#define av_test128(a)
 

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_add128

#define av_add128 ( a,
b )
Value:
int a
#define b
Definition input.c:43
AVInteger av_add_i(AVInteger a, AVInteger b)
Definition integer.c:36

Definition at line 71 of file int128.h.

Referenced by av_add_q64(), and reduce64().

◆ av_sub128

#define av_sub128 ( a,
b )
Value:
AVInteger av_sub_i(AVInteger a, AVInteger b)
Definition integer.c:46

Definition at line 72 of file int128.h.

Referenced by av_sub_q64(), and reduce64().

◆ av_mul128

#define av_mul128 ( a,
b )
Value:
AVInteger av_mul_i(AVInteger a, AVInteger b)
Definition integer.c:66

Definition at line 73 of file int128.h.

Referenced by av_add_q64(), av_cmp_q64(), av_mul_q64(), av_sub_q64(), and reduce64().

◆ av_div128

#define av_div128 ( a,
b )
Value:
AVInteger av_div_i(AVInteger a, AVInteger b)
Return a/b.
Definition integer.c:143

Definition at line 74 of file int128.h.

Referenced by reduce64().

◆ av_cmp128

#define av_cmp128 ( a,
b )
Value:
int av_cmp_i(AVInteger a, AVInteger b)
Return 0 if a==b, 1 if a>b and -1 if a<b.
Definition integer.c:87

Definition at line 75 of file int128.h.

Referenced by av_cmp_q64(), and reduce64().

◆ av_min128

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

Definition at line 76 of file int128.h.

Referenced by reduce64().

◆ av_max128

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

Definition at line 77 of file int128.h.

◆ av_eq128

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

Definition at line 78 of file int128.h.

◆ av_mod128

#define av_mod128 ( a,
b )
Value:
#define NULL
Definition coverity.c:32
AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b)
Return a % b.
Definition integer.c:113

Definition at line 79 of file int128.h.

Referenced by gcd128().

◆ av_shr128

#define av_shr128 ( a,
b )
Value:
AVInteger av_shr_i(AVInteger a, int s)
bitwise shift
Definition integer.c:99

Definition at line 80 of file int128.h.

◆ av_to128i

#define av_to128i ( a)
Value:
AVInteger av_int2i(int64_t a)
Convert the given int64_t to an AVInteger.
Definition integer.c:149

Definition at line 81 of file int128.h.

Referenced by av_add_q64(), av_cmp_q64(), av_mul_q64(), av_sub_q64(), and reduce64().

◆ av_from128i

#define av_from128i ( a)
Value:
int64_t av_i2int(AVInteger a)
Convert the given AVInteger to an int64_t.
Definition integer.c:160

Definition at line 82 of file int128.h.

Referenced by reduce64().

◆ av_from128u

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

Definition at line 83 of file int128.h.

◆ av_test128

#define av_test128 ( a)
Value:
#define av_eq128(a, b)
Definition int128.h:78
static av_always_inline av_uint128 av_to128u(uint64_t a)
Definition int128.h:86

Definition at line 84 of file int128.h.

Referenced by gcd128(), and reduce64().

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().