FFmpeg
Macros | Functions
hpeldsp_alpha.c File Reference
#include "libavutil/attributes.h"
#include "libavcodec/hpeldsp.h"
#include "hpeldsp_alpha.h"
#include "asm.h"

Go to the source code of this file.

Macros

#define OP(LOAD, STORE)
 
#define OP_X2(LOAD, STORE)
 
#define OP_Y2(LOAD, STORE)
 
#define OP_XY2(LOAD, STORE)
 
#define MAKE_OP(OPNAME, SUFF, OPKIND, STORE)
 
#define PIXOP(OPNAME, STORE)
 
#define AVG2   avg2
 
#define AVG4   avg4
 
#define AVG4_ROUNDER   BYTE_VEC(0x02)
 
#define STORE(l, b)   stq(l, b)
 
#define STORE(l, b)   stq(AVG2(l, ldq(b)), b);
 
#define AVG2   avg2_no_rnd
 
#define AVG4   avg4_no_rnd
 
#define AVG4_ROUNDER   BYTE_VEC(0x01)
 
#define STORE(l, b)   stq(l, b)
 
#define STORE(l, b)   stq(AVG2(l, ldq(b)), b);
 

Functions

static uint64_t avg2_no_rnd (uint64_t a, uint64_t b)
 
static uint64_t avg2 (uint64_t a, uint64_t b)
 
 PIXOP (put, STORE)
 
 PIXOP (avg, STORE)
 
 PIXOP (put_no_rnd, STORE)
 
 PIXOP (avg_no_rnd, STORE)
 
static void put_pixels16_axp_asm (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
 
av_cold void ff_hpeldsp_init_alpha (HpelDSPContext *c, int flags)
 

Macro Definition Documentation

◆ OP

#define OP (   LOAD,
  STORE 
)
Value:
do { \
STORE(LOAD(pixels), block); \
pixels += line_size; \
block += line_size; \
} while (--h)

Definition at line 55 of file hpeldsp_alpha.c.

◆ OP_X2

#define OP_X2 (   LOAD,
  STORE 
)
Value:
do { \
uint64_t pix1, pix2; \
\
pix1 = LOAD(pixels); \
pix2 = pix1 >> 8 | ((uint64_t) pixels[8] << 56); \
STORE(AVG2(pix1, pix2), block); \
pixels += line_size; \
block += line_size; \
} while (--h)

Definition at line 62 of file hpeldsp_alpha.c.

◆ OP_Y2

#define OP_Y2 (   LOAD,
  STORE 
)
Value:
do { \
uint64_t pix = LOAD(pixels); \
do { \
uint64_t next_pix; \
\
pixels += line_size; \
next_pix = LOAD(pixels); \
STORE(AVG2(pix, next_pix), block); \
block += line_size; \
pix = next_pix; \
} while (--h); \
} while (0)

Definition at line 73 of file hpeldsp_alpha.c.

◆ OP_XY2

#define OP_XY2 (   LOAD,
  STORE 
)
Value:
do { \
uint64_t pix1 = LOAD(pixels); \
uint64_t pix2 = pix1 >> 8 | ((uint64_t) pixels[8] << 56); \
uint64_t pix_l = (pix1 & BYTE_VEC(0x03)) \
+ (pix2 & BYTE_VEC(0x03)); \
uint64_t pix_h = ((pix1 & ~BYTE_VEC(0x03)) >> 2) \
+ ((pix2 & ~BYTE_VEC(0x03)) >> 2); \
\
do { \
uint64_t npix1, npix2; \
uint64_t npix_l, npix_h; \
uint64_t avg; \
\
pixels += line_size; \
npix1 = LOAD(pixels); \
npix2 = npix1 >> 8 | ((uint64_t) pixels[8] << 56); \
npix_l = (npix1 & BYTE_VEC(0x03)) \
+ (npix2 & BYTE_VEC(0x03)); \
npix_h = ((npix1 & ~BYTE_VEC(0x03)) >> 2) \
+ ((npix2 & ~BYTE_VEC(0x03)) >> 2); \
avg = (((pix_l + npix_l + AVG4_ROUNDER) >> 2) & BYTE_VEC(0x03)) \
+ pix_h + npix_h; \
STORE(avg, block); \
\
block += line_size; \
pix_l = npix_l; \
pix_h = npix_h; \
} while (--h); \
} while (0)

Definition at line 87 of file hpeldsp_alpha.c.

◆ MAKE_OP

#define MAKE_OP (   OPNAME,
  SUFF,
  OPKIND,
  STORE 
)
Value:
static void OPNAME ## _pixels ## SUFF ## _axp \
(uint8_t *restrict block, const uint8_t *restrict pixels, \
ptrdiff_t line_size, int h) \
{ \
if ((size_t) pixels & 0x7) { \
OPKIND(uldq, STORE); \
} else { \
OPKIND(ldq, STORE); \
} \
} \
\
static void OPNAME ## _pixels16 ## SUFF ## _axp \
(uint8_t *restrict block, const uint8_t *restrict pixels, \
ptrdiff_t line_size, int h) \
{ \
OPNAME ## _pixels ## SUFF ## _axp(block, pixels, line_size, h); \
OPNAME ## _pixels ## SUFF ## _axp(block + 8, pixels + 8, line_size, h); \
}

Definition at line 118 of file hpeldsp_alpha.c.

◆ PIXOP

#define PIXOP (   OPNAME,
  STORE 
)
Value:
MAKE_OP(OPNAME, , OP, STORE) \
MAKE_OP(OPNAME, _x2, OP_X2, STORE) \
MAKE_OP(OPNAME, _y2, OP_Y2, STORE) \
MAKE_OP(OPNAME, _xy2, OP_XY2, STORE)

Definition at line 138 of file hpeldsp_alpha.c.

◆ AVG2 [1/2]

#define AVG2   avg2

Definition at line 160 of file hpeldsp_alpha.c.

◆ AVG4 [1/2]

#define AVG4   avg4

Definition at line 161 of file hpeldsp_alpha.c.

◆ AVG4_ROUNDER [1/2]

#define AVG4_ROUNDER   BYTE_VEC(0x02)

Definition at line 162 of file hpeldsp_alpha.c.

◆ STORE [1/4]

#define STORE (   l,
  b 
)    stq(l, b)

Definition at line 167 of file hpeldsp_alpha.c.

◆ STORE [2/4]

#define STORE (   l,
  b 
)    stq(AVG2(l, ldq(b)), b);

Definition at line 167 of file hpeldsp_alpha.c.

◆ AVG2 [2/2]

#define AVG2   avg2_no_rnd

Definition at line 160 of file hpeldsp_alpha.c.

◆ AVG4 [2/2]

#define AVG4   avg4_no_rnd

Definition at line 161 of file hpeldsp_alpha.c.

◆ AVG4_ROUNDER [2/2]

#define AVG4_ROUNDER   BYTE_VEC(0x01)

Definition at line 162 of file hpeldsp_alpha.c.

◆ STORE [3/4]

#define STORE (   l,
  b 
)    stq(l, b)

Definition at line 167 of file hpeldsp_alpha.c.

◆ STORE [4/4]

#define STORE (   l,
  b 
)    stq(AVG2(l, ldq(b)), b);

Definition at line 167 of file hpeldsp_alpha.c.

Function Documentation

◆ avg2_no_rnd()

static uint64_t avg2_no_rnd ( uint64_t  a,
uint64_t  b 
)
inlinestatic

Definition at line 27 of file hpeldsp_alpha.c.

◆ avg2()

static uint64_t avg2 ( uint64_t  a,
uint64_t  b 
)
inlinestatic

Definition at line 32 of file hpeldsp_alpha.c.

◆ PIXOP() [1/4]

PIXOP ( put  ,
STORE   
)

◆ PIXOP() [2/4]

PIXOP ( avg  ,
STORE   
)

◆ PIXOP() [3/4]

PIXOP ( put_no_rnd  ,
STORE   
)

◆ PIXOP() [4/4]

PIXOP ( avg_no_rnd  ,
STORE   
)

◆ put_pixels16_axp_asm()

static void put_pixels16_axp_asm ( uint8_t block,
const uint8_t pixels,
ptrdiff_t  line_size,
int  h 
)
static

Definition at line 170 of file hpeldsp_alpha.c.

Referenced by ff_hpeldsp_init_alpha().

◆ ff_hpeldsp_init_alpha()

av_cold void ff_hpeldsp_init_alpha ( HpelDSPContext c,
int  flags 
)

Definition at line 177 of file hpeldsp_alpha.c.

Referenced by ff_hpeldsp_init().

LOAD
#define LOAD(x)
Definition: vf_hqdn3d.c:45
OP_X2
#define OP_X2(LOAD, STORE)
Definition: hpeldsp_alpha.c:62
ldq
#define ldq(p)
Definition: asm.h:59
OP
#define OP(LOAD, STORE)
Definition: hpeldsp_alpha.c:55
MAKE_OP
#define MAKE_OP(OPNAME, SUFF, OPKIND, STORE)
Definition: hpeldsp_alpha.c:118
AVG4_ROUNDER
#define AVG4_ROUNDER
Definition: hpeldsp_alpha.c:162
avg
#define avg(a, b, c, d)
Definition: colorspacedsp_template.c:28
uldq
#define uldq(a)
Definition: asm.h:85
OP_Y2
#define OP_Y2(LOAD, STORE)
Definition: hpeldsp_alpha.c:73
uint8_t
uint8_t
Definition: audio_convert.c:194
STORE
#define STORE(l, b)
Definition: hpeldsp_alpha.c:167
AVG2
#define AVG2
Definition: hpeldsp_alpha.c:160
BYTE_VEC
static uint64_t BYTE_VEC(uint64_t x)
Definition: asm.h:42
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
OP_XY2
#define OP_XY2(LOAD, STORE)
Definition: hpeldsp_alpha.c:87
h
h
Definition: vp9dsp_template.c:2038