From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 23C7F41143 for ; Sun, 14 Aug 2022 19:32:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 36D9868B8EF; Sun, 14 Aug 2022 22:32:31 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7546468B737 for ; Sun, 14 Aug 2022 22:32:25 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 7396020002 for ; Sun, 14 Aug 2022 19:32:24 +0000 (UTC) Date: Sun, 14 Aug 2022 21:32:23 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220814193223.GP2088045@pb2> References: <20220810204712.3123-1-timo@rothenpieler.org> <20220810204712.3123-8-timo@rothenpieler.org> <20220811204616.GF2088045@pb2> <20220811211659.GH2088045@pb2> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 08/11] avutil/half2float: move non-inline init code out of header X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============7993292045129476592==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7993292045129476592== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MCBkylF/aX/f/TlX" Content-Disposition: inline --MCBkylF/aX/f/TlX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 11, 2022 at 11:31:32PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Thu, Aug 11, 2022 at 10:50:10PM +0200, Andreas Rheinhardt wrote: > >> Michael Niedermayer: > >>> On Wed, Aug 10, 2022 at 10:47:09PM +0200, Timo Rothenpieler wrote: > >>>> --- > >>>> libavcodec/Makefile | 8 +++--- > >>>> libavcodec/exr.c | 2 +- > >>>> libavcodec/exrenc.c | 2 +- > >>>> libavcodec/float2half.c | 19 +++++++++++++ > >>>> libavcodec/half2float.c | 19 +++++++++++++ > >>>> libavcodec/pnmdec.c | 2 +- > >>>> libavcodec/pnmenc.c | 2 +- > >>>> libavutil/float2half.c | 53 ++++++++++++++++++++++++++++++++++ > >>>> libavutil/float2half.h | 36 ++--------------------- > >>>> libavutil/half2float.c | 63 ++++++++++++++++++++++++++++++++++++++= +++ > >>>> libavutil/half2float.h | 46 ++---------------------------- > >>>> 11 files changed, 166 insertions(+), 86 deletions(-) > >>>> create mode 100644 libavcodec/float2half.c > >>>> create mode 100644 libavcodec/half2float.c > >>>> create mode 100644 libavutil/float2half.c > >>>> create mode 100644 libavutil/half2float.c > >>>> > >>>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile > >>>> index 029f1bad3d..cb80f73d99 100644 > >>>> --- a/libavcodec/Makefile > >>>> +++ b/libavcodec/Makefile > >>>> @@ -337,8 +337,8 @@ OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) +=3D 8svx= =2Eo > >>>> OBJS-$(CONFIG_ESCAPE124_DECODER) +=3D escape124.o > >>>> OBJS-$(CONFIG_ESCAPE130_DECODER) +=3D escape130.o > >>>> OBJS-$(CONFIG_EVRC_DECODER) +=3D evrcdec.o acelp_vectors= =2Eo lsp.o > >>>> -OBJS-$(CONFIG_EXR_DECODER) +=3D exr.o exrdsp.o > >>>> -OBJS-$(CONFIG_EXR_ENCODER) +=3D exrenc.o > >>>> +OBJS-$(CONFIG_EXR_DECODER) +=3D exr.o exrdsp.o half2flo= at.o > >>>> +OBJS-$(CONFIG_EXR_ENCODER) +=3D exrenc.o float2half.o > >>>> OBJS-$(CONFIG_FASTAUDIO_DECODER) +=3D fastaudio.o > >>>> OBJS-$(CONFIG_FFV1_DECODER) +=3D ffv1dec.o ffv1.o > >>>> OBJS-$(CONFIG_FFV1_ENCODER) +=3D ffv1enc.o ffv1.o > >>>> @@ -570,8 +570,8 @@ OBJS-$(CONFIG_PGMYUV_DECODER) +=3D pnmd= ec.o pnm.o > >>>> OBJS-$(CONFIG_PGMYUV_ENCODER) +=3D pnmenc.o > >>>> OBJS-$(CONFIG_PGSSUB_DECODER) +=3D pgssubdec.o > >>>> OBJS-$(CONFIG_PGX_DECODER) +=3D pgxdec.o > >>>> -OBJS-$(CONFIG_PHM_DECODER) +=3D pnmdec.o pnm.o > >>>> -OBJS-$(CONFIG_PHM_ENCODER) +=3D pnmenc.o > >>>> +OBJS-$(CONFIG_PHM_DECODER) +=3D pnmdec.o pnm.o half2flo= at.o > >>>> +OBJS-$(CONFIG_PHM_ENCODER) +=3D pnmenc.o float2half.o > >>>> OBJS-$(CONFIG_PHOTOCD_DECODER) +=3D photocd.o > >>>> OBJS-$(CONFIG_PICTOR_DECODER) +=3D pictordec.o cga_data.o > >>>> OBJS-$(CONFIG_PIXLET_DECODER) +=3D pixlet.o > >>>> diff --git a/libavcodec/exr.c b/libavcodec/exr.c > >>>> index 825354873d..a3582bfdd6 100644 > >>>> --- a/libavcodec/exr.c > >>>> +++ b/libavcodec/exr.c > >>>> @@ -2208,7 +2208,7 @@ static av_cold int decode_init(AVCodecContext = *avctx) > >>>> float one_gamma =3D 1.0f / s->gamma; > >>>> avpriv_trc_function trc_func =3D NULL; > >>>> =20 > >>>> - init_half2float_tables(&s->h2f_tables); > >>>> + ff_init_half2float_tables(&s->h2f_tables); > >>> [...] > >>>> diff --git a/libavutil/float2half.c b/libavutil/float2half.c > >>>> new file mode 100644 > >>>> index 0000000000..dba14cef5d > >>>> --- /dev/null > >>>> +++ b/libavutil/float2half.c > >>> [...] > >>>> +void ff_init_float2half_tables(float2half_tables *t) > >>> > >>> this will need avpriv or break linking with shared libs > >>> > >> > >> No, because this code is duplicated into all libraries that need it. > >> (In case of static linking, only one of the variants will be used > >> (namely the first one encountered in the link.) > >=20 > > libswscale/libswscale.so: undefined reference to `ff_init_half2float_ta= bles' > > libswscale/libswscale.so: undefined reference to `ff_init_half2float_ta= bles' > > clang: error: linker command failed with exit code 1 (use -v to see inv= ocation) > > Makefile:131: recipe for target 'ffplay_g' failed > > make: *** [ffplay_g] Error 1 > > make: *** Waiting for unfinished jobs.... > > clang: error: linker command failed with exit code 1 (use -v to see inv= ocation) > > libswscale/libswscale.so: undefined reference to `ff_init_half2float_ta= bles' > > Makefile:131: recipe for target 'ffprobe_g' failed > > make: *** [ffprobe_g] Error 1 > > clang: error: linker command failed with exit code 1 (use -v to see inv= ocation) > > Makefile:131: recipe for target 'ffmpeg_g' failed > > make: *** [ffmpeg_g] Error 1 > >=20 >=20 > That is with the whole patchset applied, isn't it!? Duplicating the init > stuff into swscale has been forgotten. Ive tried the new latest patchset and this still happens make distclean ; ../configure --enable-shared --cc=3D'ccache clang-6.0' --= enable-pthreads --samples=3Dfate/fate-suite/ --enable-version3 --extra-cfl= ags=3D'-O1 -fno-omit-frame-pointer' && make -j32 LD ffmpeg_g LD ffplay_g LD ffprobe_g libswscale/libswscale.so: undefined reference to `ff_init_half2float_tables' clang: error: linker command failed with exit code 1 (use -v to see invocat= ion) Makefile:131: recipe for target 'ffprobe_g' failed make: *** [ffprobe_g] Error 1 make: *** Waiting for unfinished jobs.... libswscale/libswscale.so: undefined reference to `ff_init_half2float_tables' clang: error: linker command failed with exit code 1 (use -v to see invocat= ion) Makefile:131: recipe for target 'ffplay_g' failed make: *** [ffplay_g] Error 1 libswscale/libswscale.so: undefined reference to `ff_init_half2float_tables' clang: error: linker command failed with exit code 1 (use -v to see invocat= ion) Makefile:131: recipe for target 'ffmpeg_g' failed make: *** [ffmpeg_g] Error 1 git grep ff_init_half2float_tables libavcodec/exr.c: ff_init_half2float_tables(&s->h2f_tables); libavcodec/pnmdec.c: ff_init_half2float_tables(&s->h2f_tables); libavutil/half2float.c:void ff_init_half2float_tables(Half2FloatTables *t) libavutil/half2float.h:void ff_init_half2float_tables(Half2FloatTables *t); libswscale/slice.c: ff_init_half2float_tables(c->h2f_tables); libavcodec/half2float.c:#include "libavutil/half2float.c" libswscale/half2float.c:#include "libavutil/half2float.c" git grep half2float.o libavcodec/Makefile:OBJS-$(CONFIG_EXR_DECODER) +=3D exr.o exrds= p.o half2float.o libavcodec/Makefile:OBJS-$(CONFIG_PHM_DECODER) +=3D pnmdec.o pn= m.o half2float.o libavutil/Makefile: half2float.o = \ also i tried this: -#include "libavutil/half2float.c" +#inklude "libavutil/half2float.c" and still it fails at linking stage not compile, really impressive the comp= iler speaks german C too Heres the patches applied: 46e36b5371 swscale/input: add rgbaf16 input support 34446f3971 swscale: add opaque parameter to input functions 88cf148514 avutil/half2float: use native _Float16 if available af6c41450c avutil/half2float: move non-inline init code out of header 2f2ac4c8c9 avutil/half2float: move tables to header-internal structs 19ac9a570e avutil/half2float: adjust conversion of NaN 45180741cd avutil: move half-precision float helper to avutil (some more unrelated patches) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle --MCBkylF/aX/f/TlX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYvlNwgAKCRBhHseHBAsP qyNLAJ9Ccxjd8luJXsTramZFAeVGBNdhCgCeLMWbTsAyUCdtlzN2wjxVMIttnq8= =NNQe -----END PGP SIGNATURE----- --MCBkylF/aX/f/TlX-- --===============7993292045129476592== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============7993292045129476592==--