FFmpeg
Macros | Functions | Variables
ops.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/bswap.h"
#include "libavutil/mem.h"
#include "libavutil/rational.h"
#include "libavutil/refstruct.h"
#include "ops.h"
#include "ops_internal.h"

Go to the source code of this file.

Macros

#define RET(x)
 
#define PRINTQ(q)   print_q(q, (char[32]){0}, sizeof(char[32]) - 1)
 

Functions

const char * ff_sws_pixel_type_name (SwsPixelType type)
 
int ff_sws_pixel_type_size (SwsPixelType type)
 
bool ff_sws_pixel_type_is_int (SwsPixelType type)
 
SwsPixelType ff_sws_pixel_type_to_uint (SwsPixelType type)
 
static AVRational av_min_q (AVRational a, AVRational b)
 
static AVRational av_max_q (AVRational a, AVRational b)
 
void ff_sws_apply_op_q (const SwsOp *op, AVRational x[4])
 Apply an operation to an AVRational. More...
 
static void op_uninit (SwsOp *op)
 
SwsOpListff_sws_op_list_alloc (void)
 
void ff_sws_op_list_free (SwsOpList **p_ops)
 
SwsOpListff_sws_op_list_duplicate (const SwsOpList *ops)
 Returns a duplicate of ops, or NULL on OOM. More...
 
void ff_sws_op_list_remove_at (SwsOpList *ops, int index, int count)
 
int ff_sws_op_list_insert_at (SwsOpList *ops, int index, SwsOp *op)
 
int ff_sws_op_list_append (SwsOpList *ops, SwsOp *op)
 These will take over ownership of op and set it to {0}, even on failure. More...
 
int ff_sws_op_list_max_size (const SwsOpList *ops)
 Returns the size of the largest pixel type used in ops. More...
 
uint32_t ff_sws_linear_mask (const SwsLinearOp c)
 
static const char * describe_lin_mask (uint32_t mask)
 
static char describe_comp_flags (unsigned flags)
 
static const char * print_q (const AVRational q, char buf[], int buf_len)
 
void ff_sws_op_list_print (void *log, int lev, const SwsOpList *ops)
 Print out the contents of an operation list. More...
 

Variables

const SwsOpBackend backend_c
 Copyright (C) 2025 Niklas Haas. More...
 
const SwsOpBackend backend_murder
 
const SwsOpBackend backend_x86
 
const SwsOpBackend *const ff_sws_op_backends []
 

Macro Definition Documentation

◆ RET

#define RET (   x)
Value:
do { \
if ((ret = (x)) < 0) \
return ret; \
} while (0)

Definition at line 43 of file ops.c.

◆ PRINTQ

#define PRINTQ (   q)    print_q(q, (char[32]){0}, sizeof(char[32]) - 1)

Definition at line 409 of file ops.c.

Function Documentation

◆ ff_sws_pixel_type_name()

const char* ff_sws_pixel_type_name ( SwsPixelType  type)

◆ ff_sws_pixel_type_size()

int ff_sws_pixel_type_size ( SwsPixelType  type)

◆ ff_sws_pixel_type_is_int()

bool ff_sws_pixel_type_is_int ( SwsPixelType  type)

◆ ff_sws_pixel_type_to_uint()

SwsPixelType ff_sws_pixel_type_to_uint ( SwsPixelType  type)

Definition at line 96 of file ops.c.

◆ av_min_q()

static AVRational av_min_q ( AVRational  a,
AVRational  b 
)
static

Definition at line 112 of file ops.c.

Referenced by ff_sws_apply_op_q().

◆ av_max_q()

static AVRational av_max_q ( AVRational  a,
AVRational  b 
)
static

Definition at line 117 of file ops.c.

Referenced by ff_sws_apply_op_q().

◆ ff_sws_apply_op_q()

void ff_sws_apply_op_q ( const SwsOp op,
AVRational  x[4] 
)

Apply an operation to an AVRational.

No-op for read/write operations.

Definition at line 122 of file ops.c.

Referenced by ff_sws_op_list_optimize(), and ff_sws_op_list_update_comps().

◆ op_uninit()

static void op_uninit ( SwsOp op)
static

Definition at line 223 of file ops.c.

Referenced by ff_sws_op_list_free(), ff_sws_op_list_insert_at(), and ff_sws_op_list_remove_at().

◆ ff_sws_op_list_alloc()

SwsOpList* ff_sws_op_list_alloc ( void  )

Definition at line 234 of file ops.c.

◆ ff_sws_op_list_free()

void ff_sws_op_list_free ( SwsOpList **  p_ops)

Definition at line 245 of file ops.c.

◆ ff_sws_op_list_duplicate()

SwsOpList* ff_sws_op_list_duplicate ( const SwsOpList ops)

Returns a duplicate of ops, or NULL on OOM.

Definition at line 259 of file ops.c.

◆ ff_sws_op_list_remove_at()

void ff_sws_op_list_remove_at ( SwsOpList ops,
int  index,
int  count 
)

Definition at line 288 of file ops.c.

Referenced by ff_sws_op_list_optimize().

◆ ff_sws_op_list_insert_at()

int ff_sws_op_list_insert_at ( SwsOpList ops,
int  index,
SwsOp op 
)

Definition at line 298 of file ops.c.

Referenced by ff_sws_op_list_append(), and ff_sws_op_list_optimize().

◆ ff_sws_op_list_append()

int ff_sws_op_list_append ( SwsOpList ops,
SwsOp op 
)

These will take over ownership of op and set it to {0}, even on failure.

Definition at line 312 of file ops.c.

◆ ff_sws_op_list_max_size()

int ff_sws_op_list_max_size ( const SwsOpList ops)

Returns the size of the largest pixel type used in ops.

Definition at line 317 of file ops.c.

Referenced by compile().

◆ ff_sws_linear_mask()

uint32_t ff_sws_linear_mask ( const SwsLinearOp  c)

Definition at line 328 of file ops.c.

Referenced by extract_swizzle(), and ff_sws_op_list_optimize().

◆ describe_lin_mask()

static const char* describe_lin_mask ( uint32_t  mask)
static

Definition at line 340 of file ops.c.

Referenced by ff_sws_op_list_print().

◆ describe_comp_flags()

static char describe_comp_flags ( unsigned  flags)
static

Definition at line 381 of file ops.c.

Referenced by ff_sws_op_list_print().

◆ print_q()

static const char* print_q ( const AVRational  q,
char  buf[],
int  buf_len 
)
static

Definition at line 393 of file ops.c.

◆ ff_sws_op_list_print()

void ff_sws_op_list_print ( void *  log,
int  lev,
const SwsOpList ops 
)

Print out the contents of an operation list.

Definition at line 411 of file ops.c.

Variable Documentation

◆ backend_c

const SwsOpBackend backend_c

Copyright (C) 2025 Niklas Haas.

This file is part of FFmpeg.

FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 106 of file ops_backend.c.

◆ backend_murder

const SwsOpBackend backend_murder

Definition at line 129 of file ops_memcpy.c.

◆ backend_x86

const SwsOpBackend backend_x86

Definition at line 720 of file ops.c.

◆ ff_sws_op_backends

const SwsOpBackend* const ff_sws_op_backends[]
Initial value:

Definition at line 34 of file ops.c.

Referenced by check_ops().

backend_c
const SwsOpBackend backend_c
Copyright (C) 2025 Niklas Haas.
Definition: ops_backend.c:106
NULL
#define NULL
Definition: coverity.c:32
ret
ret
Definition: filter_design.txt:187
backend_murder
const SwsOpBackend backend_murder
Definition: ops_memcpy.c:129