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 55A42410B1 for ; Mon, 3 Jan 2022 05:34:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8316168B1E6; Mon, 3 Jan 2022 07:33:59 +0200 (EET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2036.outbound.protection.outlook.com [40.92.91.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B9CFE68A35C for ; Mon, 3 Jan 2022 07:33:52 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n0XZmF3o96p6hN0b70o0HM0d6wCUdNXCnOUauUXMFPbY5Zw86JylQiYfjzSVMg76ZFpIb2k8cTbSpSLQuPZuUi+aFTu8zABwLIKK/h0fxfsEWVuc0r/VbN4aJ6xDrLjszPXSZbHi1L9YrCplvMt3aFgW37wlTGrWCA3uv7tNsxQCaqhNupSr6OiOwxILLY0Tc83B4H6CD9G5h1Rfq9+F7/n/J6PcC/6fY+a9MoplJ1nSUILl0uNyzDT1yhSi1YB6Ae/bdN74uXFjZpck75+MF/+29+9tp0tn/U00tO+CTebnQ9IIbb8RWnbbehxQJgg1sRS1bqULkZLdvqmTEK7Pew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kuYGJqwesmO4KmpsfTr//v0G9THxYfovhJfYsKk+rIQ=; b=eQKrsnxAW+raxxQpkm705V3RYEwFoyZ4ddRBIPUluafXBlwGj+G2EBh72cSxkFvDZgRNp8jKyfOVeDxbWaMdGKkFU0ETx9Ha72i8EtYEXZxRrb2M7gYwEMr5ElVCM+yi44EP+7zr1ZCLY4Lf1NnOJ5eNsgNWdmtDjZMMBHDjdlNktGswWZbu7BCELRG5+QD+JG6CWR/tfKrqE0Sp4YV7ddYYUiJpTTKKhwSjQBYozM24MY/LNBAX6NyTViUL5wImpnYixtfC3Gl6MdSnX/D+/G9McNHCc4BzKHYt3p+BeUc34rUD5mcpmmUwXs4mq97IciFwsW0fQQ7mieNOtd9vHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kuYGJqwesmO4KmpsfTr//v0G9THxYfovhJfYsKk+rIQ=; b=ZNLkku61/3tFprQyzyBVulzSjPc/kkDBYPeu3q5qPENdMtw4hueqLANRSK96mZ7OPIqR5E7uA18cvF9PsfTfPqBemJUviB9lcERoSPlJKE5AQWceblh6CPul5KA4Pp2mYTLvmeWNUzQbp7vPt2f2cZ+KMuxs5m+X375te8vtuRQWsqAIodC1hRgVVLpocrAkIhrKA36gyGyUNh8lyPAi1lODtfmpfFkl24y6T2VMM8eetzFUrAH4S8ph18q4elMe5tXZCmnTwxkhBqBLjZ5T68TgxjSTZyjVjyUhr7isNqRFhMHc+6MG8V78e3MMcdhjDVLDavyQw8rxvgfmT8IEzA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5249.eurprd03.prod.outlook.com (2603:10a6:20b:c9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13; Mon, 3 Jan 2022 05:33:50 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::19fc:be9f:2c9c:53f5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::19fc:be9f:2c9c:53f5%6]) with mapi id 15.20.4844.016; Mon, 3 Jan 2022 05:33:50 +0000 Message-ID: Date: Mon, 3 Jan 2022 06:33:49 +0100 Content-Language: en-US To: FFmpeg development discussions and patches References: <164085810972.2375.12352515367310682014@lain.red.khirnov.net> From: Andreas Rheinhardt In-Reply-To: <164085810972.2375.12352515367310682014@lain.red.khirnov.net> X-TMN: [Rngp2RFO8aI6lSsrCCIsaPD9mgAZZTPF] X-ClientProxiedBy: AM4PR0701CA0004.eurprd07.prod.outlook.com (2603:10a6:200:42::14) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <0abe16a4-2480-1963-8f88-7a3c949a1898@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28aefd11-b3a2-4526-a350-08d9ce7a9f6c X-MS-TrafficTypeDiagnostic: AM6PR03MB5249:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3rVipyWVL6v6XF+W/4RP5SCAauyaQab4tBPglVHzk8MOU1p8IUr2plD4SuPaFMkHAMiFYFMU59jLln3Yd9buwyMH/2UR9NSoIwIz2LhA0fR1moBx3vnKo3imqkAgRoR79uHOBpscQaF0RE0wDvYKm0v+BaXzrgsshCk5WVP1FyULIwxfqbd/y0xe3w/W0b8T3/xOu92bxzUqXV6AUw3rj41AjozaVyExA49HnFJeTNkhmKl7DJbGOswmVfgnh5UbuqGm0SfnAAupH8zg+Ny0bD5N8tcqjqjUBZ3aWILT60CkJ9UwYUsjqE8U54ymiMb2fdTGfoGOY2X3nKFmwj1QBIaR4iO+Jqd++1Joc05eK2iBCtDwMxM40B4tqUpAp58h1IecjUCcOw7M0bHFLVT6mAm/AKumY5RRJKtACn0f9ZmkHyUuaSo+QudKQ//eN2Z/3mPPv0QCZqVbrkg5fR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K?= =?utf-8?B?MVF3d1NzZkN1Q1pmbW1pR0hMclMwWXBpNUVNWGtTcUJSZHRjVWxFZDF5aklk?= =?utf-8?B?NFdDZkpuQ0RNN2VvN212enZjM2FJVXcxR1lzY29tQTRudVp3b3VQd1dETDA0?= =?utf-8?B?SjZXRDRWbFNDZWdlaGx4NHdIb0ZLSEl2bEVpVnVha3AyUWI2V1R0RTdjc3RJ?= =?utf-8?B?YXBzNCs0NnhBMzY1VlZxSnduY3N6cW4xdjA3dVNvZndFaTBkSjVkSWpjYUxa?= =?utf-8?B?OGlyTmQ2TXFaVTVCTjBveG95VFlaZVRsV0dFTzNrQWQzRkluL1FGNG1tb0hh?= =?utf-8?B?T3AzdkFYN3cvQjN2RVUyenFoSnpWMi9JczViWTFRMTl0aGhRRHdNU0VHOFI1?= =?utf-8?B?Qk1iU243UTF4cEszTzNyUU1qM0ZmaElmcXRDL2pwbmp5SHVGTzRqZnYrM0l1?= =?utf-8?B?TFJRdG1pbDhjZ3FMNlFGbHBEWGoybWpWUDFpaGVaaU1Obm1iTVlEWVQ1QVlQ?= =?utf-8?B?Z0xlMkQyMU90MlZBK2Z4RUY4SzI3eFI0K1hab3RYV1JrUG9GeWQzT2ZKajRv?= =?utf-8?B?dFJydjlSQnFEQmpNWDJ3b21QZlZVMXVoMDNDYnJ1dW9DWTZsZz09?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28aefd11-b3a2-4526-a350-08d9ce7a9f6c X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2022 05:33:50.7695 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5249 Subject: Re: [FFmpeg-devel] [PATCH 02/11] avcodec/raw: Reduce number of avpriv symbols 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Anton Khirnov: > Quoting Andreas Rheinhardt (2021-12-15 13:35:32) >> libavcodec currently exports four avpriv symbols that deal with >> PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt, >> avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are >> lists of PixelFormatTags, the former returns such a list and the second >> searches a list for a pixel format that matches a given fourcc; only >> one of the aforementioned three lists is ever searched. >> >> Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and >> avpriv_find_pix_fmt the overhead of exporting these functions actually >> exceeds the size of said objects (at least for ELF; the following numbers >> are for x64 Ubuntu 20.10): >> The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B), >> yet exporting it adds a 20B string for the name alone to the exporting >> as well as to each importing library; there is more: Four bytes in the >> exporting libraries .gnu.hash; two bytes each for the exporting as well >> as each importing libraries .gnu.version; 24B in the exporting as well >> as each importing libraries .dynsym; 16B+24B for an entry in .plt as >> well as the accompanying relocation entry in .rela.plt for each >> importing library. >> >> The overhead for the lists is similar: The strings are 23B and the >> .plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and >> a relocation entry in .rela.dyn. These lists have a size of 80 resp. >> 72 bytes. >> >> Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to >> duplicating it into libavformat and potentially libavdevice. Therefore >> this commit replaces all library uses of the four symbols with a single >> function that is exported for shared builds. It has an enum parameter >> to choose the desired list besides the parameter for the fourcc. New >> lists can be supported with new enum values. >> >> Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the >> fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this >> function remains. >> >> Signed-off-by: Andreas Rheinhardt >> --- >> 1. It would make sense to deduplicate avpriv_pix_fmt_bps_(mov|avi) >> size-wise if it is preferred to keep the lists accessible to users. >> 2. One could handle the fourcc2pixfmt case in avpriv_pix_fmt_find(), >> too, if one added another parameter (say count). In this case >> avpriv_pix_fmt_find() will return the first pixfmt with the desired >> fourcc if count is zero, the second one is count is 1 etc. (and >> AV_PIX_FMT_NONE in case there is none any more). This would also make >> this function more future-proof. > > Would it not be simpler to add a second function returning a pointer to > the full table? > There is already a function to return the full table: avpriv_get_raw_pix_fmt_tags. It is what fourcc2pixfmt uses. The goal of the above considerations is to reduce the number of exported symbols, namely avpriv_get_raw_pix_fmt_tags. > Also, I would prefer making this completely public rather than avpriv. > _______________________________________________ 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".