Go to the documentation of this file.
37 static void error(
const char *err)
39 fprintf(stderr,
"%s", err);
80 static void mapres(
unsigned *r0,
unsigned *r1) {
81 double d = (
double)(*r0*10ll - 9ll*UINT32_MAX) / UINT32_MAX;
82 double a =
exp(d) * 16384 /
exp(1) ;
84 uint64_t maxb = 16384 / ai;
86 *r1 = 1 + (*r1 * maxb) / UINT32_MAX;
90 int srcW= 48, srcH = 48;
91 int dstW= 48, dstH = 48;
92 int srcHShift, srcVShift;
93 int dstHShift, dstVShift;
112 srcW = bytestream2_get_le32(&gbc);
113 srcH = bytestream2_get_le32(&gbc);
114 dstW = bytestream2_get_le32(&gbc);
115 dstH = bytestream2_get_le32(&gbc);
120 flags = bytestream2_get_le32(&gbc);
140 flags64 = bytestream2_get_le64(&gbc);
178 error(
"Failed sws allocation");
void av_force_cpu_flags(int arg)
Disables cpu detection and forces the specified flags.
AVPixelFormat
Pixel format.
int dstW
Width of destination luma/alpha planes.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_VIDEO_MAX_PLANES
Maximum number of planes in any pixel format.
static void free_plane(uint8_t *data[AV_VIDEO_MAX_PLANES])
int attribute_align_arg sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
swscale wrapper, so we don't need to export the SwsContext.
@ AV_PIX_FMT_NB
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
#define SWS_FAST_BILINEAR
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
enum AVPixelFormat srcFormat
Source pixel format.
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
#define AV_CEIL_RSHIFT(a, b)
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
#define av_assert0(cond)
assert() equivalent, that is always enabled.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int alloc_plane(uint8_t *data[AV_VIDEO_MAX_PLANES], int stride[AV_VIDEO_MAX_PLANES], int w, int h, int format, int *hshift, int *vshift)
enum AVPixelFormat dstFormat
Destination pixel format.
int av_image_fill_plane_sizes(size_t sizes[4], enum AVPixelFormat pix_fmt, int height, const ptrdiff_t linesizes[4])
Fill plane sizes for an image with pixel format pix_fmt and height height.
struct SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext.
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int srcH
Height of source luma/alpha planes.
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
static void error(const char *err)
int srcW
Width of source luma/alpha planes.
static av_always_inline av_const double round(double x)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
av_warn_unused_result int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
void sws_freeContext(struct SwsContext *swsContext)
Free the swscaler context swsContext.
static void mapres(unsigned *r0, unsigned *r1)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define flags(name, subs,...)
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int dstH
Height of destination luma/alpha planes.