From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 860344CEA6 for <ffmpegdev@gitmailbox.com>; Tue, 15 Apr 2025 00:54:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6456D687CD6; Tue, 15 Apr 2025 03:54:42 +0300 (EEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2046.outbound.protection.outlook.com [40.92.59.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9CD40687A2C for <ffmpeg-devel@ffmpeg.org>; Tue, 15 Apr 2025 03:54:35 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y+9bhN+QqQcR+rCOzODZQdck7gL8EWMlqyPrrGf+GpHFIm2KxQloYPF4IgusujvcWCKiyqmurD7zsDoRBWNjpFTc6vnr6kYa3THDNu8GQGfeFPxxJi4JBQ6aC5W2zcyjZ4rGc9f2HAqSS0TFL7E2SpGLAgx1sTZ62dIkM76GmWncQ47DgAtrB7McmQVYlBSGx/rpfuTexC7hrJ2mVmmEho2FISlZwOLBdrnzwphlkOkuzGnpIuM6uQI4wZBEz8N+js/cOTqCN4tnq9MPoSfAFU/Nh4GH/v+zcJtv8DzLP/Fs0drvn9+HGv94b21H2qu9mJVx5sO/qc2srL6puGHz0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=I5UPsx0ULf08sw+Fih8wkIkYxhtvJB6k9ox7Ujog6mA=; b=uvlFdWoQw/9/MLmT2IiPPXxDmNu/IV3sqAJ/m5p2E4JgmtPB9OYVOXTLcNvHmT0eo4UP17Lfw0SOyj8mK7BK02YMsSGdAOQJuDDxPg7cIb1dfMvA708Djt5qKnkPyvmGITblkOXNE6fmZmkbh4SjSjp80MUQYqle/E8dvNr9AvVQdOd3E9QVBqcwrHfDPc3NTw4idJaE2735v0EyQ1ydXQ/TJOvGEH4UENldWTFD6o0PTEAiwhz1lsOk5UnTMkfBoMzwVze2o8wkf3A68bzPkTv2u6k67hWDGnhnpPv6qvODR0J8UpY/B+wuci0Zx472Qtc9FjGJQ0buC2Oit7Qpcw== 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=I5UPsx0ULf08sw+Fih8wkIkYxhtvJB6k9ox7Ujog6mA=; b=WLGfbCsrHDYzrGxGnm6jezI1ylV4mCjORzjr7Gcf3mQppEzn1JDp2vNzWO3fuUpU/Oc9Vi6ot9audMrFHfMJ1EdCEsENkj3eeg33cURw5zKHQJceFgsf95VcBh306wxLJwHZPWfpU9cO3oC7WNFLB9i1kcEa/ymPOdKWGaGaMa2XD7Y2YnjeY9W5XTJ/CuWcEzY0NGuohhTGsSP9kFHQHb0BeMGJUiHiKueMDUsAxXv1otFDB9Jx06oa4A30u8G4UnS9WNOk50TD1YkCWUlGo4caQ2T4YzLJL7GO1pfIGBU2vGICM86PnO84c0XaJMIqVRFFNrNdsP7Nb5txIyoXrw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DB4P250MB1031.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3cd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8655.13; Tue, 15 Apr 2025 00:54:33 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%5]) with mapi id 15.20.8655.012; Tue, 15 Apr 2025 00:54:33 +0000 Message-ID: <GV1P250MB07374ABBBADD183A639FCB928FB22@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> Date: Tue, 15 Apr 2025 02:54:32 +0200 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <DU0P250MB07476D6A89F0D691F04EB7F68FAE2@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM> <20250405073810.GC4991@pb2> <20250405143625.GE4991@pb2> Content-Language: en-US From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> In-Reply-To: <20250405143625.GE4991@pb2> X-ClientProxiedBy: FR2P281CA0093.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::18) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <355f857a-9681-47f7-900c-d1696d36bd0f@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DB4P250MB1031:EE_ X-MS-Office365-Filtering-Correlation-Id: 56bef276-311f-47f6-99e3-08dd7bb81655 X-Microsoft-Antispam: BCL:0; ARA:14566002|6090799003|5072599009|15080799006|7092599003|461199028|19110799003|8060799006|440099028|10035399004|3412199025; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RDQxR2RhdTkxNWpyNCsrOEU3U3BNc2hiMDh6UXlvVXI5d1lNQk9ZdHc1WW1E?= =?utf-8?B?NHNKTTcza2l2Z09TdDZ2T09DUVZiY3FodWU1dmU3bm1HTGlaRkN1dk9OV2lH?= =?utf-8?B?YmNFanpIZ2pMMjJNVFBW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=?utf-8?B?azhlYklXc1h1NWhjTjU4NzQzRHhLZjFHcm9FUWhaUm5CcmxsN3M2bkF5TzJT?= =?utf-8?B?cVdibTZzTnFnL1lhVm9wRFRvUWI0QXM4bHhUeTBtTlB2NWJuUUlGbzhhZzhZ?= =?utf-8?B?T3VJV3NFaGlDZ1g3YyswNURIQlFZc0JnYTUySDFZZ0xuT1dJbkdsYmIyVmxy?= =?utf-8?B?MDNUalJKWS82eVJaNERBa2JMcGJDMVpOMkRIYXZUMVVjRW81c2JrUVBSQjFU?= =?utf-8?B?NEwrVFdPbGdJLzJCaGNFRDhBYnRpSlNPS2FXV1BlRWdzelNDNldWWnhmWnJB?= =?utf-8?B?WG5Gc3lpUjBvNVB5SkZQc1RTUnhCaVdZMDBhVlkxTmRiNE41TGl0U24ydFl3?= =?utf-8?B?UFpoazJmZzgydDc1NmtmalUycWtRZ3grQ1ZoQ1RpT1RxZ05hSGpkT2lMOHFm?= =?utf-8?B?eEpuTFlDdHNUdGJvWkRsN3JUbWVhZ2pNaGtPWFVEYjY5MlE5Vzc2cmJ3K3Fk?= =?utf-8?B?WjJ2TThJZjVCc3lLWmMvalg1TU9BUWJqSUFyK0dwWVdxQTNjOU5wT0E4cGxr?= =?utf-8?B?Y3pqWTU1QVZLK3RvWVZwRTJZdlZienM3TFJCYTRqemhYejhBcENId1pLNWly?= =?utf-8?Q?zQrFjmE6OCv+ClofP7Xbd73kOhBEDlu8xSbFR06?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56bef276-311f-47f6-99e3-08dd7bb81655 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2025 00:54:33.7972 (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: DB4P250MB1031 Subject: Re: [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/GV1P250MB07374ABBBADD183A639FCB928FB22@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> Michael Niedermayer: > On Sat, Apr 05, 2025 at 09:38:10AM +0200, Michael Niedermayer wrote: >> On Thu, Apr 03, 2025 at 10:31:26PM +0200, Andreas Rheinhardt wrote: >>> Patches attached. >>> >>> - Andreas >> >> [...] >> >>> libavcodec/mjpegenc_huffman.c | 33 ++++++------------ >>> libavcodec/tests/mjpegenc_huffman.c | 6 ++- >>> tests/ref/fate/jpg-icc | 6 +-- >>> tests/ref/lavf/jpg | 4 +- >>> tests/ref/lavf/smjpeg | 4 +- >>> tests/ref/seek/vsynth_lena-mjpeg | 40 +++++++++++------------ >>> tests/ref/vsynth/vsynth1-mjpeg | 4 +- >>> tests/ref/vsynth/vsynth1-mjpeg-422 | 4 +- >>> tests/ref/vsynth/vsynth1-mjpeg-444 | 4 +- >>> tests/ref/vsynth/vsynth1-mjpeg-huffman | 4 +- >>> tests/ref/vsynth/vsynth1-mjpeg-trell | 4 +- >>> tests/ref/vsynth/vsynth1-mjpeg-trell-huffman | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg-422 | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg-444 | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg-huffman | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg-trell | 4 +- >>> tests/ref/vsynth/vsynth2-mjpeg-trell-huffman | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg-422 | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg-444 | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg-huffman | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg-trell | 4 +- >>> tests/ref/vsynth/vsynth3-mjpeg-trell-huffman | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg-422 | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg-444 | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg-huffman | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg-trell | 4 +- >>> tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman | 4 +- >>> 30 files changed, 91 insertions(+), 98 deletions(-) >>> 515cd8ef4364423e2e7ec04535f04b0580e97c78 0020-avcodec-mjpegenc_huffman-Avoid-AV_QSORT-to-sort-entr.patch >>> From a17db6215a1600021c9d4a7d6c7923ac5816ea70 Mon Sep 17 00:00:00 2001 >>> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> >>> Date: Wed, 2 Apr 2025 15:06:43 +0200 >>> Subject: [PATCH 20/23] avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort >>> entries by length >>> >>> It is unnecessary; all one needs to ensure that shorter codes >>> precede longer ones is to get the number of codes for each >>> length. Then the codes of length 1 occupy the first count[1] >>> positions, the codes of length 2 the next count[2]... >>> Doing so gives a 3.4% speedup of ff_mjpeg_encode_huffman_close() >>> here; it also saves about 340B. >>> >>> The new code sorts codes of the same length in order of >>> ascending symbol. The old code did not and therefore >>> the FATE checksums needed to be updated. Due to MJPEG's >>> 0xFF unescaping file sizes as well as file checksums >>> needed to be updated; the decoded picture hashes stayed >>> the same. >> >> so theres a difference in size because of escaping differences >> that implies the previous table was not optimal (by the definition >> of smallest filesize) >> >> have you considered to use this effect to reduce escaping overhead >> further and thus improve compression further ? >> >> for example one can build a variable length code that has no "all 1" code with >> very little overhead. One also could maybe avoid codes that have >> long runs of 1 over some threshold >> >> The patch as is, is fine of course. Thats just an idea to improve >> compression by another 0.1-0.3% or so > > or another way to see this, is that a huffman table assumes the cost > of each code of the same length is equal. > But due to the escaping thats not true, a code starting and ending in 0 and > not having 8 1 bits in it is less costly than a code that is > more likely to create patterns that need escaping > > the maximum compression gain from this is small, but it may be > an interresting problem. Within the bitstream syntax and adding > no cost on the decoder > I implemented this (with the exception of the 0xFF in the middle of a code) and surprisingly it turned out not so beneficial. See https://ffmpeg.org/pipermail/ffmpeg-devel/2025-April/342212.html - Andreas _______________________________________________ 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".