FFmpeg
Loading...
Searching...
No Matches
output_lsx.c File Reference

Go to the source code of this file.

Macros

#define r_b   ((target == AV_PIX_FMT_RGB24) ? r : b)
 
#define b_r   ((target == AV_PIX_FMT_RGB24) ? b : r)
 
#define WRITE_YUV2RGB_LSX(vec_y1, vec_y2, vec_u, vec_v, t1, t2, t3, t4)
 
#define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha)
 
#define YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha)
 
#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha)
 
#define A_DITHER(u, v)
 
#define X_DITHER(u, v)
 
#define YUVTORGB_SETUP_LSX
 
#define YUVTORGB_LSX(y, u, v, R, G, B, offset, coeff, y_temp, v2r, v2g, u2g, u2b)
 
#define WRITE_FULL_A_LSX(r, g, b, a, t1, s)
 
#define WRITE_FULL_LSX(r, g, b, t1, s)
 

Functions

static av_always_inline void yuv2rgb_write (uint8_t *_dest, int i, int Y1, int Y2, unsigned A1, unsigned A2, const void *_r, const void *_g, const void *_b, int y, enum AVPixelFormat target, int hasAlpha)
 
static void yuv2rgb_X_template_lsx (SwsInternal *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha)
 
static void yuv2rgb_2_template_lsx (SwsInternal *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
 
static void yuv2rgb_1_template_lsx (SwsInternal *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
 
static av_always_inline void yuv2rgb_write_full (SwsInternal *c, uint8_t *dest, int i, int R, int A, int G, int B, int y, enum AVPixelFormat target, int hasAlpha, int err[4])
 
static void yuv2rgb_full_X_template_lsx (SwsInternal *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha)
 
static void yuv2rgb_full_2_template_lsx (SwsInternal *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
 
static void yuv2rgb_full_1_template_lsx (SwsInternal *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum AVPixelFormat target, int hasAlpha)
 
av_cold void ff_sws_init_output_lsx (SwsInternal *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, yuv2interleavedX_fn *yuv2nv12cX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX, yuv2anyX_fn *yuv2anyX)
 

Macro Definition Documentation

◆ r_b

#define r_b   ((target == AV_PIX_FMT_RGB24) ? r : b)

◆ b_r

#define b_r   ((target == AV_PIX_FMT_RGB24) ? b : r)

◆ WRITE_YUV2RGB_LSX

#define WRITE_YUV2RGB_LSX ( vec_y1,
vec_y2,
vec_u,
vec_v,
t1,
t2,
t3,
t4 )
Value:
{ \
Y1 = __lsx_vpickve2gr_w(vec_y1, t1); \
Y2 = __lsx_vpickve2gr_w(vec_y2, t2); \
U = __lsx_vpickve2gr_w(vec_u, t3); \
V = __lsx_vpickve2gr_w(vec_v, t4); \
r = c->table_rV[V]; \
g = (c->table_gU[U] + c->table_gV[V]); \
b = c->table_bU[U]; \
yuv2rgb_write(dest, count, Y1, Y2, 0, 0, \
r, g, b, y, target, 0); \
count++; \
}
#define U(x)
Definition vpx_arith.h:37
#define V
Definition avdct.c:32
#define r
Definition input.c:42
#define b
Definition input.c:43
const char * g
Definition vf_curves.c:128
static double c[64]

Definition at line 136 of file output_lsx.c.

Referenced by yuv2rgb_1_template_lsx(), yuv2rgb_2_template_lsx(), and yuv2rgb_X_template_lsx().

◆ YUV2RGBWRAPPERX

#define YUV2RGBWRAPPERX ( name,
base,
ext,
fmt,
hasAlpha )
Value:
static void name ## ext ## _X_lsx(SwsInternal *c, const int16_t *lumFilter, \
const int16_t **lumSrc, int lumFilterSize, \
const int16_t *chrFilter, const int16_t **chrUSrc, \
const int16_t **chrVSrc, int chrFilterSize, \
const int16_t **alpSrc, uint8_t *dest, int dstW, \
int y) \
{ \
name ## base ## _X_template_lsx(c, lumFilter, lumSrc, lumFilterSize, \
chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
alpSrc, dest, dstW, y, fmt, hasAlpha); \
}
const char * name
Definition qsvenc.c:142
uint8_t base
Definition vp3data.h:128

Definition at line 720 of file output_lsx.c.

◆ YUV2RGBWRAPPERX2

#define YUV2RGBWRAPPERX2 ( name,
base,
ext,
fmt,
hasAlpha )
Value:
YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
static void name ## ext ## _2_lsx(SwsInternal *c, const int16_t *buf[2], \
const int16_t *ubuf[2], const int16_t *vbuf[2], \
const int16_t *abuf[2], uint8_t *dest, int dstW, \
int yalpha, int uvalpha, int y) \
{ \
name ## base ## _2_template_lsx(c, buf, ubuf, vbuf, abuf, dest, \
dstW, yalpha, uvalpha, y, fmt, hasAlpha); \
}
#define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha)

Definition at line 733 of file output_lsx.c.

◆ YUV2RGBWRAPPER

#define YUV2RGBWRAPPER ( name,
base,
ext,
fmt,
hasAlpha )
Value:
YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \
static void name ## ext ## _1_lsx(SwsInternal *c, const int16_t *buf0, \
const int16_t *ubuf[2], const int16_t *vbuf[2], \
const int16_t *abuf0, uint8_t *dest, int dstW, \
int uvalpha, int y) \
{ \
name ## base ## _1_template_lsx(c, buf0, ubuf, vbuf, abuf0, dest, \
dstW, uvalpha, y, fmt, hasAlpha); \
}
#define YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha)

Definition at line 744 of file output_lsx.c.

◆ A_DITHER

#define A_DITHER ( u,
v )
Value:
(((((u)+((v)*236))*119)&0xff))
#define u(width, name, range_min, range_max)
Definition cbs_apv.c:68

Referenced by yuv2rgb_write_full().

◆ X_DITHER

#define X_DITHER ( u,
v )
Value:
(((((u)^((v)*237))*181)&0x1ff)/2)

Referenced by yuv2rgb_write_full().

◆ YUVTORGB_SETUP_LSX

#define YUVTORGB_SETUP_LSX
Value:
int y_offset = c->yuv2rgb_y_offset; \
int y_coeff = c->yuv2rgb_y_coeff; \
int v2r_coe = c->yuv2rgb_v2r_coeff; \
int v2g_coe = c->yuv2rgb_v2g_coeff; \
int u2g_coe = c->yuv2rgb_u2g_coeff; \
int u2b_coe = c->yuv2rgb_u2b_coeff; \
__m128i offset = __lsx_vreplgr2vr_w(y_offset); \
__m128i coeff = __lsx_vreplgr2vr_w(y_coeff); \
__m128i v2r = __lsx_vreplgr2vr_w(v2r_coe); \
__m128i v2g = __lsx_vreplgr2vr_w(v2g_coe); \
__m128i u2g = __lsx_vreplgr2vr_w(u2g_coe); \
__m128i u2b = __lsx_vreplgr2vr_w(u2b_coe); \
unsigned offset
Definition libaomenc.c:763
static const double coeff[2][5]

Definition at line 904 of file output_lsx.c.

Referenced by yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_template_lsx(), and yuv2rgb_full_X_template_lsx().

◆ YUVTORGB_LSX

#define YUVTORGB_LSX ( y,
u,
v,
R,
G,
B,
offset,
coeff,
y_temp,
v2r,
v2g,
u2g,
u2b )
Value:
{ \
y = __lsx_vsub_w(y, offset); \
y = __lsx_vmul_w(y, coeff); \
y = __lsx_vadd_w(y, y_temp); \
R = __lsx_vmadd_w(y, v, v2r); \
v = __lsx_vmadd_w(y, v, v2g); \
G = __lsx_vmadd_w(v, u, u2g); \
B = __lsx_vmadd_w(y, u, u2b); \
}
#define B
Definition huffyuv.h:42
#define R
Definition huffyuv.h:44
#define G
Definition huffyuv.h:43

Definition at line 918 of file output_lsx.c.

Referenced by yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_template_lsx(), and yuv2rgb_full_X_template_lsx().

◆ WRITE_FULL_A_LSX

#define WRITE_FULL_A_LSX ( r,
g,
b,
a,
t1,
s )
Value:
{ \
R = __lsx_vpickve2gr_w(r, t1); \
G = __lsx_vpickve2gr_w(g, t1); \
B = __lsx_vpickve2gr_w(b, t1); \
A = __lsx_vpickve2gr_w(a, t1); \
if (A & 0x100) \
yuv2rgb_write_full(c, dest, i + s, R, A, G, B, y, target, hasAlpha, err);\
dest += step; \
}
#define A(x)
Definition vpx_arith.h:28
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define av_clip_uint8
Definition common.h:106
int a

Definition at line 930 of file output_lsx.c.

Referenced by yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_template_lsx(), and yuv2rgb_full_X_template_lsx().

◆ WRITE_FULL_LSX

#define WRITE_FULL_LSX ( r,
g,
b,
t1,
s )
Value:
{ \
R = __lsx_vpickve2gr_w(r, t1); \
G = __lsx_vpickve2gr_w(g, t1); \
B = __lsx_vpickve2gr_w(b, t1); \
yuv2rgb_write_full(c, dest, i + s, R, 0, G, B, y, target, hasAlpha, err); \
dest += step; \
}

Definition at line 942 of file output_lsx.c.

Referenced by yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_template_lsx(), and yuv2rgb_full_X_template_lsx().

Function Documentation

◆ yuv2rgb_write()

static av_always_inline void yuv2rgb_write ( uint8_t * _dest,
int i,
int Y1,
int Y2,
unsigned A1,
unsigned A2,
const void * _r,
const void * _g,
const void * _b,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

◆ yuv2rgb_X_template_lsx()

static void yuv2rgb_X_template_lsx ( SwsInternal * c,
const int16_t * lumFilter,
const int16_t ** lumSrc,
int lumFilterSize,
const int16_t * chrFilter,
const int16_t ** chrUSrc,
const int16_t ** chrVSrc,
int chrFilterSize,
const int16_t ** alpSrc,
uint8_t * dest,
int dstW,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 151 of file output_lsx.c.

◆ yuv2rgb_2_template_lsx()

static void yuv2rgb_2_template_lsx ( SwsInternal * c,
const int16_t * buf[2],
const int16_t * ubuf[2],
const int16_t * vbuf[2],
const int16_t * abuf[2],
uint8_t * dest,
int dstW,
int yalpha,
int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 479 of file output_lsx.c.

◆ yuv2rgb_1_template_lsx()

static void yuv2rgb_1_template_lsx ( SwsInternal * c,
const int16_t * buf0,
const int16_t * ubuf[2],
const int16_t * vbuf[2],
const int16_t * abuf0,
uint8_t * dest,
int dstW,
int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 586 of file output_lsx.c.

◆ yuv2rgb_write_full()

static av_always_inline void yuv2rgb_write_full ( SwsInternal * c,
uint8_t * dest,
int i,
int R,
int A,
int G,
int B,
int y,
enum AVPixelFormat target,
int hasAlpha,
int err[4] )
static

◆ yuv2rgb_full_X_template_lsx()

static void yuv2rgb_full_X_template_lsx ( SwsInternal * c,
const int16_t * lumFilter,
const int16_t ** lumSrc,
int lumFilterSize,
const int16_t * chrFilter,
const int16_t ** chrUSrc,
const int16_t ** chrVSrc,
int chrFilterSize,
const int16_t ** alpSrc,
uint8_t * dest,
int dstW,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 952 of file output_lsx.c.

◆ yuv2rgb_full_2_template_lsx()

static void yuv2rgb_full_2_template_lsx ( SwsInternal * c,
const int16_t * buf[2],
const int16_t * ubuf[2],
const int16_t * vbuf[2],
const int16_t * abuf[2],
uint8_t * dest,
int dstW,
int yalpha,
int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 1131 of file output_lsx.c.

◆ yuv2rgb_full_1_template_lsx()

static void yuv2rgb_full_1_template_lsx ( SwsInternal * c,
const int16_t * buf0,
const int16_t * ubuf[2],
const int16_t * vbuf[2],
const int16_t * abuf0,
uint8_t * dest,
int dstW,
int uvalpha,
int y,
enum AVPixelFormat target,
int hasAlpha )
static

Definition at line 1320 of file output_lsx.c.

◆ ff_sws_init_output_lsx()

av_cold void ff_sws_init_output_lsx ( SwsInternal * c,
yuv2planar1_fn * yuv2plane1,
yuv2planarX_fn * yuv2planeX,
yuv2interleavedX_fn * yuv2nv12cX,
yuv2packed1_fn * yuv2packed1,
yuv2packed2_fn * yuv2packed2,
yuv2packedX_fn * yuv2packedX,
yuv2anyX_fn * yuv2anyX )

Definition at line 1612 of file output_lsx.c.

Referenced by ff_sws_init_output_lsx(), and ff_sws_init_swscale_loongarch().