Go to the documentation of this file.
21 #ifndef SWSCALE_UOPS_H
22 #define SWSCALE_UOPS_H
61 static_assert(
sizeof(
SwsPixel) ==
sizeof(
char[4]),
"SwsPixel size mismatch");
70 #define SWS_COMP(X) (1 << (X))
71 #define SWS_COMP_TEST(mask, X) (!!((mask) & SWS_COMP(X)))
72 #define SWS_COMP_INV(mask) ((mask) ^ SWS_COMP_ALL)
73 #define SWS_COMP_ELEMS(N) ((1 << (N)) - 1)
74 #define SWS_COMP_MASK(X, Y, Z, W) \
75 (((X) ? SWS_COMP(0) : 0) | \
76 ((Y) ? SWS_COMP(1) : 0) | \
77 ((Z) ? SWS_COMP(2) : 0) | \
78 ((W) ? SWS_COMP(3) : 0))
82 #define ff_sws_comp_mask_str(mask) ff_sws_comp_mask_print(mask, (char[5]){0})
86 for (
int c = 0;
c < 4;
c++) {
168 #define SWS_UOP_MOVE_MAX 6
193 #define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
194 #define SWS_MASK_OFF(I) SWS_MASK(I, 4)
195 #define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
196 #define SWS_MASK_COL(J) (0x8421 << J)
197 #define SWS_MASK_DIAG4 (0x41041)
252 #define SWS_UOP_NAME_MAX 64
static int ff_sws_uop_cmp_v(const void *a, const void *b)
int ff_sws_uop_cmp(const SwsUOp *a, const SwsUOp *b)
Compare two SwsUOps for equality (excluding constant data).
Represents a computed filter kernel.
void ff_sws_uop_list_free(SwsUOpList **ops)
const char * ff_sws_pixel_type_name(SwsPixelType type)
#define SWS_UOP_NAME_MAX
Generate a unique name for a SwsUOp.
#define SWS_COMP_TEST(mask, X)
SwsUOpList * ff_sws_uop_list_alloc(void)
int ff_sws_pixel_type_size(SwsPixelType type) av_const
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const
SwsFilterWeights * kernel
static const uint16_t dither[8][8]
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
static AVFormatContext * ctx
uint8_t SwsCompMask
Bit-mask of components.
int8_t dst[SWS_UOP_MOVE_MAX]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ SWS_UOP_READ_PLANAR_FV_FMA
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
void ff_sws_uop_name(const SwsUOp *op, char buf[SWS_UOP_NAME_MAX])
int ff_sws_uop_list_append(SwsUOpList *uops, SwsUOp *uop)
int ff_sws_ops_translate(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags, SwsUOpList *uops)
Translate a list of operations down to micro-ops, which can be further optimized and then directly ex...
static char * ff_sws_comp_mask_print(SwsCompMask mask, char buf[5])
int8_t src[SWS_UOP_MOVE_MAX]
Helper struct for representing a list of operations.
Main external API structure.
int ff_sws_dither_height(const SwsDitherUOp *dither)
Computes (1 << size_log2) + MAX(y_offset).