Go to the documentation of this file.
39 #define AVUTIL_AVASSERT_H
41 #define AVUTIL_MACROS_H
43 #define av_assert0(cond) assert(cond)
44 #define av_malloc(s) malloc(s)
45 #define av_mallocz(s) calloc(1, s)
46 #define av_realloc(p, s) realloc(p, s)
47 #define av_strdup(s) strdup(s)
48 #define av_free(p) free(p)
49 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
50 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
51 #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
52 #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
56 void **pptr = (
void **) ptr;
79 const uint8_t *elem_data)
81 uint8_t *tab_elem_data =
NULL;
84 tab_elem_data = (uint8_t *)*tab_ptr + (*nb_ptr) * elem_size;
86 memcpy(tab_elem_data, elem_data, elem_size);
114 #define ENTRY(fname, ...) { .name = #fname, .params = __VA_ARGS__ },
123 #define IMPL_PRIV(s) a64op_off(s->impl, offsetof_impl_priv)
153 if (
p->block_size == 16) {
154 i_movi(
r, bitmask_vec.
b16,
IMM(1));
CMT(
"v128 bitmask_vec = {1 <repeats 16 times>};");
156 i_movi(
r, bitmask_vec.
b8,
IMM(1));
CMT(
"v128 bitmask_vec = {1 <repeats 8 times>, 0 <repeats 8 times>};");
166 rasm_annotate_next(
r,
"v128 nibble_mask = {0xf <repeats 8 times>, 0x0 <repeats 8 times>};");
187 uint32_t mask_val[4] = { 0 };
192 uint32_t
val = (1
u <<
p->par.pack.pattern[
i]) - 1;
193 for (
int j = 0; j < 4; j++) {
194 if (mask_val[j] ==
val) {
195 mask_val[
i] = mask_val[j];
206 if (
val <= 0xff ||
val == 0xffff) {
230 bool load_priv =
false;
232 if (!((
p->par.clear.zero |
p->par.clear.one) &
SWS_COMP(
i)))
293 case 1: coeff_veclist =
vv_1(vc[0]);
break;
294 case 2: coeff_veclist =
vv_2(vc[0], vc[1]);
break;
295 case 3: coeff_veclist =
vv_3(vc[0], vc[1], vc[2]);
break;
296 case 4: coeff_veclist =
vv_4(vc[0], vc[1], vc[2], vc[3]);
break;
307 bool overwritten[4] = {
false,
false,
false,
false };
310 for (
int j = 0; j < 5; j++) {
311 bool is_offset = (j == 0);
312 int src_j = is_offset ? 4 : (j - 1);
315 uint8_t vc_i = i_coeff / 4;
316 uint8_t vc_j = i_coeff & 3;
319 if (!is_offset && overwritten[src_j])
321 overwritten[
i] =
true;
333 LOOP (save_mask,
i) { sl[
i] = tl[
i]; }
489 i_ldr(
r,
s->op0_func, impl_cont);
CMT(
"SwsFuncPtr op0_func = impl->cont;");
494 i_mov(
r,
s->impl,
s->op1_impl);
CMT(
"impl = op1_impl;");
504 bool is_read =
false;
505 bool is_write =
false;
531 size_t total_size =
p->block_size * el_size;
533 s->vec_size =
FFMIN(total_size, 16);
534 s->use_vh = (
s->vec_size != total_size);
536 s->el_size = el_size;
537 s->el_count =
s->vec_size / el_size;
605 i_ldr(
r,
s->cont, impl_post);
CMT(
"SwsFuncPtr cont = (impl++)->cont;");
635 while (entries->
name) {
644 printf(
"#include \"libavutil/aarch64/asm.S\"\n");
649 fputs(bp.str, stdout);
658 int main(
int argc,
char *argv[])
661 _setmode(_fileno(stdout), _O_BINARY);
static void error(const char *err)
#define FF_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, av_success, av_failure)
Add an element to a dynamic array.
#define AV_BPRINT_SIZE_UNLIMITED
RasmContext * rasm_alloc(void)
static void asmgen_setup_read_nibble(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
__device__ int printf(const char *,...)
#define i_ld1(rctx, op0, op1)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static RasmOp a64op_base(RasmOp op)
static void init_vectors_cps(SwsAArch64Context *s, SwsAArch64OpRegs *regs)
static RasmOp a64op_gpx(uint8_t n)
static RasmOp a64op_w(RasmOp op)
void rasm_free(RasmContext **prctx)
RasmNode * rasm_set_current_node(RasmContext *rctx, RasmNode *node)
#define u(width, name, range_min, range_max)
This helper structure is used to mimic the assembler syntax for vector register modifiers.
RasmNode * rasm_get_current_node(RasmContext *rctx)
static RasmOp a64op_gpw(uint8_t n)
static RasmOp vv_2(RasmOp op0, RasmOp op1)
static void asmgen_op_read_bit(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static RasmOp vv_3(RasmOp op0, RasmOp op1, RasmOp op2)
static void asmgen_setup_scale(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_setup_write_bit(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void reshape_temp_vectors(SwsAArch64OpRegs *regs, int el_count, int el_size)
#define i_dup(rctx, op0, op1)
static void asmgen_op_write_nibble(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void reshape_const_vectors(SwsAArch64OpRegs *regs, int el_count, int el_size)
static void asmgen_op_write_bit(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
Runtime assembler for AArch64.
Implementation parameters for all exported functions.
static void asmgen_setup_read_bit(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_op_convert(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static double val(void *priv, double ch)
#define SWS_COMP_ELEMS(N)
#define i_ld1r(rctx, op0, op1)
static void * av_memdup(const void *p, size_t size)
static RasmOp vv_1(RasmOp op0)
static RasmOp a64op_elem(RasmOp op, uint8_t idx)
static void * av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data)
static void asmgen_op_lshift(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_setup_unpack(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
#define offsetof_impl_cont
static void asmgen_op_rshift(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
uint8_t SwsCompMask
Bit-mask of components.
static void asmgen_op_swap_bytes(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
#define i_ldr(rctx, op0, op1)
static void reshape_io_vectors(SwsAArch64OpRegs *regs, int el_count, int el_size)
static av_const int ff_sws_pixel_type_size(SwsPixelType type)
static void asmgen_op_write_packed(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_setup_linear(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
SwsAArch64OpImplParams params
static void asmgen_process_cps(SwsAArch64Context *s, SwsCompMask mask)
static void asmgen_op_read_planar(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static RasmOp a64op_post(RasmOp op, int16_t imm)
void int rasm_print(RasmContext *rctx, AVBPrint *bp)
#define LOOP_VH(s, mask, idx)
static void asmgen_setup_min(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_op_clear(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
#define i_add(rctx, op0, op1, op2)
static void asmgen_op_pack(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_setup_max(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_setup_clear(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_op_frame(SwsAArch64Context *s, SwsCompMask imask, SwsCompMask omask)
static void asmgen_op_min(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define LOOP_MASK(p, idx)
static void asmgen_setup_dither(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
#define i(width, name, range_min, range_max)
static void asmgen_set_load_cont_node(SwsAArch64Context *s)
Set node where the continuation address will be loaded and impl will be incremented.
static void av_freep(void *ptr)
static RasmOp a64op_off(RasmOp op, int16_t imm)
static void asmgen_op_dither(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
AArch64VecViews a64op_vec_views(RasmOp op)
static void asmgen_op_move(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_op_max(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static RasmOp vv_4(RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3)
void rasm_annotate_next(RasmContext *rctx, const char *comment)
static const int rw_gprs[]
Register assignment for CPS functions.
static const SwsAArch64OpEntry ops_entries[]
#define offsetof_impl_priv
RasmOp linear_vcoeff[4][5]
static void asmgen_op_unpack(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_op_scale(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static RasmOp a64op_vec(uint8_t n)
static void asmgen_op_expand(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_process_frame(SwsAArch64Context *s, SwsCompMask imask, SwsCompMask omask)
static void asmgen_common_frame(SwsAArch64Context *s, SwsCompMask imask, SwsCompMask omask)
int rasm_func_begin(RasmContext *rctx, const char *name, bool export, bool jumpable)
static void asmgen_op_cps(SwsAArch64Context *s, const SwsAArch64OpEntry *entry)
#define i_mov16b(rctx, op0, op1)
static void asmgen_op_linear(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static void asmgen_process(SwsAArch64Context *s, SwsCompMask imask, SwsCompMask omask)
static RasmOp v_16b(RasmOp op)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
SwsAArch64OpImplParams describes the parameters for an SwsUOpType operation.
#define i_movi(rctx, op0, op1)
int main(int argc, char *argv[])
static void asmgen_op_write_planar(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
static uint16_t nibble_mask(SwsCompMask mask)
static int linear_num_vregs(const SwsAArch64OpImplParams *params)
static void asmgen_op_read_nibble(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)
RasmNode * rasm_add_comment(RasmContext *rctx, const char *comment)
#define i_mov(rctx, op0, op1)
static RasmOp v_q(RasmOp op)
static void asmgen_op_read_packed(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, SwsAArch64OpRegs *regs)