[FFmpeg-devel] [PATCH v3 11/18] swscale: expose SwsContext publicly

Michael Niedermayer michael at niedermayer.cc
Wed Oct 23 17:30:18 EEST 2024


On Sun, Oct 20, 2024 at 10:05:20PM +0200, Niklas Haas wrote:
> From: Niklas Haas <git at haasn.dev>
> 
> This commit does the ardous work of splitting the options out of SwsInternal.
> To avoid having to change leaf functions too much in one commit, we simply
> leave behind a pointer to the main context, and replace all references to
> the corresponding options by a simple search-and-replace.
> 
> Only the functions inside swscale.c and utils.c are modified in nontrivial
> ways, since they retain the SwsContext public signature.
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Niklas Haas <git at haasn.dev>
> ---
>  libswscale/aarch64/swscale.c                  |  30 +-
>  libswscale/aarch64/swscale_unscaled.c         |  34 +-
>  libswscale/alphablend.c                       |  16 +-
>  libswscale/arm/swscale_unscaled.c             |  24 +-
>  libswscale/input.c                            |   2 +-
>  libswscale/loongarch/input_lasx.c             |   2 +-
>  libswscale/loongarch/input_lsx.c              |   2 +-
>  libswscale/loongarch/output_lasx.c            |  10 +-
>  libswscale/loongarch/output_lsx.c             |  10 +-
>  libswscale/loongarch/swscale_init_loongarch.c |  32 +-
>  libswscale/loongarch/swscale_lasx.c           |   8 +-
>  libswscale/loongarch/swscale_lsx.c            |   8 +-
>  libswscale/loongarch/yuv2rgb_lasx.c           |   8 +-
>  libswscale/loongarch/yuv2rgb_lsx.c            |  12 +-
>  libswscale/options.c                          |  31 +-
>  libswscale/output.c                           |  24 +-
>  libswscale/ppc/swscale_altivec.c              |   6 +-
>  libswscale/ppc/swscale_vsx.c                  |  18 +-
>  libswscale/ppc/yuv2rgb_altivec.c              |  36 +-
>  libswscale/ppc/yuv2yuv_altivec.c              |  14 +-
>  libswscale/riscv/swscale.c                    |   6 +-
>  libswscale/slice.c                            |  22 +-
>  libswscale/swscale.c                          | 187 ++++----
>  libswscale/swscale.h                          |  98 ++++-
>  libswscale/swscale_internal.h                 |  48 +-
>  libswscale/swscale_unscaled.c                 | 310 ++++++-------
>  libswscale/utils.c                            | 414 +++++++++---------
>  libswscale/vscale.c                           |  12 +-
>  libswscale/x86/output.asm                     |   2 +-
>  libswscale/x86/swscale.c                      |  60 +--
>  libswscale/x86/swscale_template.c             |  20 +-
>  libswscale/x86/yuv2rgb.c                      |  14 +-
>  libswscale/yuv2rgb.c                          |  84 ++--
>  tests/checkasm/sw_gbrp.c                      |  16 +-
>  tests/checkasm/sw_range_convert.c             |  16 +-
>  tests/checkasm/sw_rgb.c                       |  28 +-
>  tests/checkasm/sw_scale.c                     |  22 +-
>  37 files changed, 867 insertions(+), 819 deletions(-)

on ubuntu x86-64

CC	libswscale/alphablend.o
In file included from ./libavutil/internal.h:39,
                 from ./libavutil/common.h:50,
                 from ./libavutil/avutil.h:301,
                 from libswscale/swscale.h:33,
                 from libswscale/swscale_internal.h:28,
                 from libswscale/alphablend.c:21:
libswscale/swscale_internal.h:677:1: error: static assertion failed: "yuv2rgb_y_offset must be updated in x86 asm"
  677 | static_assert(offsetof(SwsInternal, yuv2rgb_y_offset) == 40332,
      | ^~~~~~~~~~~~~
make: *** [ffbuild/common.mak:81: libswscale/alphablend.o] Error 1

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241023/8984b8c9/attachment.sig>


More information about the ffmpeg-devel mailing list