comment "/**\n * Copyright (C) 2025 Niklas Haas\n *\n * This file is par"...
preproc_ifdef
#ifndef "#ifndef"
identifier "SWSCALE_OPS_H"
preproc_def
#define "#define"
identifier "SWSCALE_OPS_H"
preproc_include
#include "#include"
system_lib_string "<assert.h>"
preproc_include
#include "#include"
system_lib_string "<stdbool.h>"
preproc_include
#include "#include"
system_lib_string "<stdalign.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "graph.h"
" "\""
type_definition (+29 nodes collapsed)
declaration
type_qualifier
const "const"
primitive_type "char"
pointer_declarator
* "*"
function_declarator
identifier "ff_sws_pixel_type_name"
parameter_list
( "("
parameter_declaration
type_identifier "SwsPixelType"
identifier "type"
) ")"
; ";"
ERROR
primitive_type "int"
function_declarator
identifier "ff_sws_pixel_type_size"
parameter_list
( "("
parameter_declaration
type_identifier "SwsPixelType"
identifier "type"
) ")"
identifier "av_const"
expression_statement
; ";"
ERROR
primitive_type "bool"
function_declarator
identifier "ff_sws_pixel_type_is_int"
parameter_list
( "("
parameter_declaration
type_identifier "SwsPixelType"
identifier "type"
) ")"
identifier "av_const"
expression_statement
; ";"
type_definition (+82 nodes collapsed)
enum_specifier (+42 nodes collapsed)
; ";"
type_definition (+28 nodes collapsed)
expression_statement (+29 nodes collapsed)
type_definition
typedef "typedef"
struct_specifier
struct "struct"
type_identifier "SwsComps"
field_declaration_list
{ "{"
field_declaration
sized_type_specifier
unsigned "unsigned"
array_declarator
field_identifier "flags"
[ "["
number_literal "4"
] "]"
; ";"
comment "/* knowledge about (output) component contents */"
field_declaration
primitive_type "bool"
array_declarator
field_identifier "unused"
[ "["
number_literal "4"
] "]"
; ";"
comment "/* which input components are definitely unused */"
comment "/* Keeps track of the known possible value range, or {0, 0} "...
field_declaration
type_identifier "AVRational"
array_declarator
field_identifier "min"
[ "["
number_literal "4"
] "]"
, ","
array_declarator
field_identifier "max"
[ "["
number_literal "4"
] "]"
; ";"
} "}"
type_identifier "SwsComps"
; ";"
type_definition (+26 nodes collapsed)
type_definition
typedef "typedef"
struct_specifier
struct "struct"
type_identifier "SwsPackOp"
field_declaration_list
{ "{"
comment "/**\n * Packed bits are assumed to be LSB-aligned within "...
field_declaration
primitive_type "uint8_t"
array_declarator
field_identifier "pattern"
[ "["
number_literal "4"
] "]"
; ";"
comment "/* bit depth pattern, from MSB to LSB */"
} "}"
type_identifier "SwsPackOp"
; ";"
type_definition (+47 nodes collapsed)
preproc_function_def
#define "#define"
identifier "SWS_SWIZZLE"
preproc_params
( "("
identifier "X"
, ","
identifier "Y"
, ","
identifier "Z"
, ","
identifier "W"
) ")"
preproc_arg "((SwsSwizzleOp) { .in = {X, Y, Z, W} })"
type_definition
typedef "typedef"
struct_specifier
struct "struct"
type_identifier "SwsConvertOp"
field_declaration_list
{ "{"
field_declaration
type_identifier "SwsPixelType"
field_identifier "to"
; ";"
comment "/* type of pixel to convert to */"
field_declaration
primitive_type "bool"
field_identifier "expand"
; ";"
comment "/* if true, integers are expanded to the full range */"
} "}"
type_identifier "SwsConvertOp"
; ";"
type_definition (+31 nodes collapsed)
type_definition (+28 nodes collapsed)
preproc_function_def
#define "#define"
identifier "SWS_MASK"
preproc_params
( "("
identifier "I"
, ","
identifier "J"
) ")"
preproc_arg "(1 << (5 * (I) + (J)))"
preproc_function_def
#define "#define"
identifier "SWS_MASK_OFF"
preproc_params
( "("
identifier "I"
) ")"
preproc_arg "SWS_MASK(I, 4)"
preproc_function_def
#define "#define"
identifier "SWS_MASK_ROW"
preproc_params
( "("
identifier "I"
) ")"
preproc_arg "(0x1F << (5 * (I)))"
preproc_function_def
#define "#define"
identifier "SWS_MASK_COL"
preproc_params
( "("
identifier "J"
) ")"
preproc_arg "(0x8421 << J)"
enum_specifier (+247 nodes collapsed)
; ";"
comment "/* Helper function to compute the correct mask */"
declaration
primitive_type "uint32_t"
function_declarator
identifier "ff_sws_linear_mask"
parameter_list
( "("
parameter_declaration
type_identifier "SwsLinearOp"
) ")"
; ";"
type_definition (+60 nodes collapsed)
comment "/**\n * Frees any allocations associated with an SwsOp and se"...
declaration
primitive_type "void"
function_declarator
identifier "ff_sws_op_uninit"
parameter_list
( "("
parameter_declaration
type_identifier "SwsOp"
pointer_declarator
* "*"
identifier "op"
) ")"
; ";"
comment "/**\n * Apply an operation to an AVRational. No-op for read/w"...
declaration (+23 nodes collapsed)
comment "/**\n * Helper struct for representing a list of operations.\n"...
type_definition (+39 nodes collapsed)
declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
function_declarator
identifier "ff_sws_op_list_alloc"
parameter_list
( "("
parameter_declaration
primitive_type "void"
) ")"
; ";"
declaration
primitive_type "void"
function_declarator
identifier "ff_sws_op_list_free"
parameter_list
( "("
parameter_declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Returns a duplicate of `ops`, or NULL on OOM.\n */"
declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
function_declarator
identifier "ff_sws_op_list_duplicate"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Returns the input operation for a given op list, or N"...
declaration
type_qualifier
const "const"
type_identifier "SwsOp"
pointer_declarator
* "*"
function_declarator
identifier "ff_sws_op_list_input"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Returns the output operation for a given op list, or "...
declaration
type_qualifier
const "const"
type_identifier "SwsOp"
pointer_declarator
* "*"
function_declarator
identifier "ff_sws_op_list_output"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Returns whether an op list represents a true no-op op"...
declaration
primitive_type "bool"
function_declarator
identifier "ff_sws_op_list_is_noop"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Returns the size of the largest pixel type used in `o"...
declaration
primitive_type "int"
function_declarator
identifier "ff_sws_op_list_max_size"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * These will take over ownership of `op` and set it to "...
declaration
primitive_type "int"
function_declarator
identifier "ff_sws_op_list_append"
parameter_list
( "("
parameter_declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
, ","
parameter_declaration
type_identifier "SwsOp"
pointer_declarator
* "*"
identifier "op"
) ")"
; ";"
declaration (+23 nodes collapsed)
declaration (+21 nodes collapsed)
comment "/**\n * Print out the contents of an operation list.\n */"
declaration (+29 nodes collapsed)
comment "/**\n * Infer + propagate known information about components."...
declaration
primitive_type "void"
function_declarator
identifier "ff_sws_op_list_update_comps"
parameter_list
( "("
parameter_declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
comment "/**\n * Fuse compatible and eliminate redundant operations, a"...
declaration
primitive_type "int"
function_declarator
identifier "ff_sws_op_list_optimize"
parameter_list
( "("
parameter_declaration
type_identifier "SwsOpList"
pointer_declarator
* "*"
identifier "ops"
) ")"
; ";"
enum_specifier
enum "enum"
type_identifier "SwsOpCompileFlags"
enumerator_list
{ "{"
comment "/* Automatically optimize the operations when compiling */"
enumerator
identifier "SWS_OP_FLAG_OPTIMIZE"
= "="
binary_expression
number_literal "1"
<< "<<"
number_literal "0"
, ","
} "}"
; ";"
comment "/**\n * Resolves an operation list to a graph pass. The first"...
declaration (+45 nodes collapsed)
#endif "#endif"