This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit ae6f3ce02cd60deb7076222a3f385a8170b50729 Author: Niklas Haas <[email protected]> AuthorDate: Tue Apr 7 17:33:51 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Mon Jun 8 18:29:02 2026 +0200 swscale/uops: split off from ops.h Forming what will be the start of a larger helper file for backend-internal translation of higher-level ops into lower level kernels. This header file needs to be includable from independent source files, as it will be used to provide definitions for build-time code generation (e.g. ops_asmgen.c), so it must be self-contained. Pulling in all of ops.h from uops.h would be too large dependency, since ops.h pulls in graph.h, refstruct, bprint, etc. It's easier to start from a fresh file that is documented as being usable at compile time. For now, just declare the common types that will be needed by the uops layer. Signed-off-by: Niklas Haas <[email protected]> --- libswscale/ops.h | 32 +--------------------------- libswscale/uops.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/libswscale/ops.h b/libswscale/ops.h index 24eccacc79..9ef43addc2 100644 --- a/libswscale/ops.h +++ b/libswscale/ops.h @@ -29,19 +29,7 @@ #include "graph.h" #include "filters.h" - -typedef enum SwsPixelType { - SWS_PIXEL_NONE = 0, - SWS_PIXEL_U8, - SWS_PIXEL_U16, - SWS_PIXEL_U32, - SWS_PIXEL_F32, - SWS_PIXEL_TYPE_NB -} SwsPixelType; - -const char *ff_sws_pixel_type_name(SwsPixelType type); -int ff_sws_pixel_type_size(SwsPixelType type) av_const; -bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const; +#include "uops.h" typedef enum SwsOpType { SWS_OP_INVALID = 0, @@ -78,24 +66,6 @@ typedef enum SwsOpType { const char *ff_sws_op_type_name(SwsOpType op); -/** - * Bit-mask of components. Exact meaning depends on the usage context. - */ -typedef uint8_t SwsCompMask; -enum { - SWS_COMP_NONE = 0, - SWS_COMP_ALL = 0xF, -#define SWS_COMP(X) (1 << (X)) -#define SWS_COMP_TEST(mask, X) (!!((mask) & SWS_COMP(X))) -#define SWS_COMP_INV(mask) ((mask) ^ SWS_COMP_ALL) -#define SWS_COMP_ELEMS(N) ((1 << (N)) - 1) -#define SWS_COMP_MASK(X, Y, Z, W) \ - (((X) ? SWS_COMP(0) : 0) | \ - ((Y) ? SWS_COMP(1) : 0) | \ - ((Z) ? SWS_COMP(2) : 0) | \ - ((W) ? SWS_COMP(3) : 0)) -}; - /* Compute SwsCompMask from values with denominator != 0 */ SwsCompMask ff_sws_comp_mask_q4(const AVRational q[4]); diff --git a/libswscale/uops.h b/libswscale/uops.h new file mode 100644 index 0000000000..07958a6b62 --- /dev/null +++ b/libswscale/uops.h @@ -0,0 +1,64 @@ +/** + * 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 + */ + +#ifndef SWSCALE_UOPS_H +#define SWSCALE_UOPS_H + +#include <stdbool.h> +#include <stdint.h> + +/*************************************************************************** + * Note: This header must be usable at build time, to generate asm sources * + ***************************************************************************/ + +#include "libavutil/attributes.h" + +typedef enum SwsPixelType { + SWS_PIXEL_NONE = 0, + SWS_PIXEL_U8, + SWS_PIXEL_U16, + SWS_PIXEL_U32, + SWS_PIXEL_F32, + SWS_PIXEL_TYPE_NB +} SwsPixelType; + +const char *ff_sws_pixel_type_name(SwsPixelType type); +int ff_sws_pixel_type_size(SwsPixelType type) av_const; +bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const; + +/** + * Bit-mask of components. Exact meaning depends on the usage context. + */ +typedef uint8_t SwsCompMask; +enum { + SWS_COMP_NONE = 0, + SWS_COMP_ALL = 0xF, +#define SWS_COMP(X) (1 << (X)) +#define SWS_COMP_TEST(mask, X) (!!((mask) & SWS_COMP(X))) +#define SWS_COMP_INV(mask) ((mask) ^ SWS_COMP_ALL) +#define SWS_COMP_ELEMS(N) ((1 << (N)) - 1) +#define SWS_COMP_MASK(X, Y, Z, W) \ + (((X) ? SWS_COMP(0) : 0) | \ + ((Y) ? SWS_COMP(1) : 0) | \ + ((Z) ? SWS_COMP(2) : 0) | \ + ((W) ? SWS_COMP(3) : 0)) +}; + +#endif _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
