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 A207D43524 for ; Fri, 14 Oct 2022 23:45:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B34DD68BD88; Sat, 15 Oct 2022 02:45:03 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BAAAB68BCC8 for ; Sat, 15 Oct 2022 02:44:57 +0300 (EEST) Received: from b3f2f4f02429fd693cede1faeaf102ce ([1.145.200.216]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 29ENioUu016719 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Fri, 14 Oct 2022 23:44:54 GMT Date: Sat, 15 Oct 2022 10:44:44 +1100 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <5781e37ed86f8c9554a5754103d6a7ea5dcd6661.1665728570.git.pross@xvid.org> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/jpegtables: remove duplicate luma and chroma quantization tables 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="===============7082112172094883790==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7082112172094883790== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iptKi/akNISaDxzJ" Content-Disposition: inline --iptKi/akNISaDxzJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 14, 2022 at 05:19:44PM +0200, Andreas Rheinhardt wrote: > Peter Ross: > > Duplicates of the standard JPEG quantization tables were found in the > > AGM, MSS34(dsp), NUV and VP31 codecs. This patch elimates those duplicates, > > placing a single copy in jpegtables. > > --- > 1. mss34dsp now uses jpegtables, yet it does not have a dependency on > it. Instead you seem to rely on all the users of mss34dsp to have a > dependency on jpegtables, yet this is not true for all of them. You will > get linking failures with --disable-everything --enable-decoder=msa1. there is a OBJS-$(CONFIG_JPEGTABLES) += line in avcodec/Makefile that takes care of this. i tested this patch under few different configurations and observed no build errors. > 2. The fact that you need to add jpegtables to configure for almost all > components that use the jpeg quant tables means that it is not really > appropriate to put the jpeg quant tables into the same files as the jpeg > huff tables. > 3. The jpeg huff tables are duplicated into libavformat for shared > builds (because the overhead of exporting them exceeds the size gains > from not duplicating them); yet when one uses --enable-shared and > --enable-static at the same time, it might be that libavformat.a is > linked to libavcodec.so and therefore has no access to libavcodec's > internal symbols like the jpegtables, so we have to duplicate the > jpegtables into libavformat.a in this case. But if one links using > libavformat.a and libavcodec.a with both containing the jpeg huffman > tables, then one will get a linker error with this patch: The jpeg > huffman tables in libavformat will be pulled in by the libavformat > component needing them. With this patch libavcodec/jpegtables.o will > also be pulled in. But it also contains the jpeg tables already provided > by lavf/jpegtables.o, so you will get a multiple definition error. > In contrast to this, before this patch, lavc/jpegtables.o would not be > pulled in, because all dependencies to the mjpeg huffman tables will be > satisfied by lavf/jpegtabes.o. > So to summarize: If one duplicates stuff in multiple libraries, the > object files must really provide the exact same symbols; not more, not less. wasn't aware jpegtabs.h was duplicated into libavformat. > The last two points imply that these tables should be moved to a file of > their own. Btw: I don't think that a configure subsystem is appropriate > for this (a single file with some tables is not really a subsystem); > actually I don't think that the current jpegtables subsystem is > appropriate at all. will do -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --iptKi/akNISaDxzJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCY0n0aAAKCRBnYHnFrEDd a7wjAJoDlX/8rP7y2enyd3P4da2dcMGWdgCdGTY/RFtXZqK3MLAZS/+lwlWlOSM= =/dDz -----END PGP SIGNATURE----- --iptKi/akNISaDxzJ-- --===============7082112172094883790== 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". --===============7082112172094883790==--