Message ID | AM7PR03MB6660D83AC49DD05CB5CFF5F58F249@AM7PR03MB6660.eurprd03.prod.outlook.com |
---|---|
State | Superseded |
Headers |
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp1769598iov; Sat, 29 Jan 2022 22:28:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1XqFUULkNMsOibwE6fBKyeI4SSX7xsteF1hznbAXrc/AXIRHe9poVFqvc3Ucc3nCZuMMB X-Received: by 2002:a17:906:4fce:: with SMTP id i14mr12442153ejw.632.1643524089895; Sat, 29 Jan 2022 22:28:09 -0800 (PST) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ho44si6257024ejc.237.2022.01.29.22.28.09; Sat, 29 Jan 2022 22:28:09 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=T4z6IKbC; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A97AD68B0AD; Sun, 30 Jan 2022 08:28:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074054.outbound.protection.outlook.com [40.92.74.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2024268ADE6 for <ffmpeg-devel@ffmpeg.org>; Sun, 30 Jan 2022 08:27:59 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AyNXlwYISP/Jd3HEYQkE8y+WihxQftWAaQ1w/W/c0ET/DDA9Wj/KkloZ+hv4jDRQwGOEGWz2xKFUS7lfgcxfLFvskYIrUO/724t3IJLCQjvlc5EAvVKUZ08ZflLzDV9cqzNj7tH/OTOGh5cyBmZi04X2QldEh1Ikz5ppG5O4RJKgbmuITWXQDOU8zn3kzmadFTSSgWVrwzUjdFVrQ6Bw1bEd6/l6B9fqmA8osa7caIkPO9bX/7vGhM8EIGMFO3VfAxusuQmgSZhpTxjsH0vHJUev8OL+BmjzJr3jztgYqUO1DBsDR2S9QfKikaG/i8w0VLF1fxaTGbOYd5Dp//K04w== 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=3uZhbSJ4+m7hYx+yfzkwmftvR/T30c4hZlTtF4EdW68=; b=muPk7FW4TGYlFMp/2X/axGTx89rcgu497etjnEJuFGnAkGhfxpcRRJ9054G437YkbkvwATpmHH5SUZncKpWZ8cz2ubpCaBhmbCfL4JSrWAD9pE3yB0aISQGpLQ8ct38AbHVnAUz6nf+RKW6divexk+QLYdXV9wGwk0E+qsRVjNu6GnOMVkz7TiVI3L4LNlIrFTTJYhisjnNFUQP1+H5I1crGbk9YVuQTEDkhrfu9l+hGx6w/RBro8dXb2AUFAEgBJ2S52qo4bKXcukTvtqP6qwSWz6KCtA3lwK/aNlOm8ThkwBXzBcGHQ4B3E57XVR6cBJdJ2UTQOZ2y6Z2uEOGtdQ== 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=3uZhbSJ4+m7hYx+yfzkwmftvR/T30c4hZlTtF4EdW68=; b=T4z6IKbCK88sAFFaZSTFZtJX5yM17/ujeRmuU8OCVkjtbfU7R9A/JVCPzjvXa3fghYxa0/rlSGoXBKSWheKsXN7iNlex3y0pCdzzoBod5gtiohBChztHe9HbvkwFgHD8lvtPcVtmdDFk7848wE4y952umVmTi79UmH67eliDN0rXM6CAYA3degcK9EDxBZA9hBwwp8+tZoMre8V5zGVR9m1JBgpw9A9bNayiTyHnLtwFlMYTtu0pkvk8W0KtDHvj1LRSQhEmEezACV9MbwppZtzJSCZyhPZTQ8CkSDcjY+DOwMCQ+P/ADxA+dOpnmlced4bYC/KtKLSZ1oCiWTPy1A== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4247.eurprd03.prod.outlook.com (2603:10a6:20b:7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.20; Sun, 30 Jan 2022 06:27:57 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%6]) with mapi id 15.20.4930.021; Sun, 30 Jan 2022 06:27:57 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Sun, 30 Jan 2022 07:27:10 +0100 Message-ID: <AM7PR03MB6660D83AC49DD05CB5CFF5F58F249@AM7PR03MB6660.eurprd03.prod.outlook.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <AM7PR03MB666068B09E9D0014E1CC65DD8F249@AM7PR03MB6660.eurprd03.prod.outlook.com> References: <AM7PR03MB666068B09E9D0014E1CC65DD8F249@AM7PR03MB6660.eurprd03.prod.outlook.com> X-TMN: [rJQBrLynDGz5ebpU4e1sSlO+8m3zNcQ0] X-ClientProxiedBy: AM6PR10CA0044.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::21) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220130062749.936489-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b5f217f-e82e-46f1-492d-08d9e3b9a7b4 X-MS-TrafficTypeDiagnostic: AM6PR03MB4247:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Fb8+DNEAbvw2WvJ47SS02wAm1iUlE4UX0mrJhabjQ8pdHsuV+I0A8aLUKMfKdDGDgMTl3mJLy7VtrUedWpMXl871q25Jb9LDfPYlIrHcO5SuG7TJsGcRDmBn3jiZaSJXjUVg2WL0LnDcj4yPVrmPAGryhWeF5v/yyZVRTMiy0WQSoLZgwaZisMyeUPJ2h3zk/crb0EGqZKqidXTNaReV/1iiB8lZ2no2Uh6IFyLeSJMVathmFWAvus3/V4RSUXYBXgxWLWreSPmLvFdo0AGykUzKY30YbuDlJJf9px76pGbwsfe/ydfypXDxZYx0ie7t9z5yBz7psk+etbPyH5eWxHcUcKZ68xKehWfaTCuHB/gUCFUmflNUXzCqQP2sdHUNTVckLNQcSZhEwPxZfy40mEKV9FkMB4cDqD2U18kbqOwIcXB64MBFCnhRFQMOz2cGxc+kxs28tamHlh9hYDNSLKz/PLMY9ppkn/y9b5AApj67ZRQnLOmbM3wO0Qji3bsQ+R5sz2prsCN2AdFDTf9E4OfMksJ42SoNg35iX4wNO9QhUr1MAPyBCxrMfkRcWXv X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DHHGEunCkrIM54h0xeAoi8hsdh9zBTdzALtur6QNbykNxBVVlQan0Z6bOJWIegBOwyIs5RaCeUIBn3CYETXBURRHLKH/Z5H2cLZoRrbTy0dUdBswHxUzHt5kPs0sFom7VnOL0q7Epv/negB+daDHxUmzk30nvcaPS+NreIXtWJzJjvUWEiZW5j9B+nTBgNviOil7VBEQ37kf36OXrIW1DObJaC8wCQxjWbXJou2ye1xj1vEB9nru3+dEDrqfHjNy57zxMwiRhVMXNMFFyCzja+e4Jam5aJNcGTLdGo9ZBNAyEc5ItsEZrRuOnfHC6YuAzgfjRHi8Thw9oCKsRVYsscVZK6Y84IFVZ2KvuBRA6YDU/nwIGn/trz0mC0RylVJUCJdoj8+89fW5k5lWjpGsJb8haN6uAdHxaa8dV0VWBYRpqpHLK6yIMmnzkJULxlS17RYsYbD/Crje42zv2MfUIXYhp44XxTtRPcaw0iiCzszoYX2fiJVYRCdP78mo+T0oHgZH7kHdXAtEpAgW0b4RWqtw6HhgSFKJ/Q8pJEZ3PvFnp5GNMiH9Aent64JNR0wu1t8Iq+N3nQj7c8o0kzosWifqouyu+dXEUbA3/lBo+gI4fb3H4tOu8p2q/D9w401Zj+rzEHJq8TIW61NKSCzC78q4AFyxuNv86W2xCfYQRS55+NhidgLEu/CdsMgJAxTwJamr/6rm+Up+KrgMm27lejOMai+j5lruajDwLOSRO6/ccO1lw4XhEmgZ+iYtpeYHZmvTQNa7q5gr3kf4mnyA5wGsWCIjfJCzF7D1r+Cq2P86gzGZvrKfo0I2yZEArDkKrmrIasTpw7IgqFh3Kv6oikkaExDoun75eYK9VTf8z3t9A88w9i+YRtytOn6QjE3i0ZabD/wRBTk8a3qBzEcyODFPEPqu5bbvzLTsz4mzsHDIxnnp9IKBgv0yBb3sE2qWxAdZo/cSJa7HpgSq/DYLiA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b5f217f-e82e-46f1-492d-08d9e3b9a7b4 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2022 06:27:57.3575 (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: AM6PR03MB4247 Subject: [FFmpeg-devel] [PATCH 02/41] avcodec/mjpegenc: Remove nonsense assert 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> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> 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> X-TUID: BrwgK37ShQzI |
Series |
[FFmpeg-devel,01/41] avcodec/mpegvideo_enc: Allow slices only for slice-thread-able codecs
|
|
Commit Message
Andreas Rheinhardt
Jan. 30, 2022, 6:27 a.m. UTC
Writing optimal huffman tables is incompatible with using slices
and hence commit 884506dfe2e29a5b2bd2905ca4f17e277e32acb1
that added writing optimal huffman tables also added an assert
that the slice context count is always 1.
Yet this was always wrong: a) The MJPEG-encoder has (and had)
the AV_CODEC_CAP_SLICE_THREADS capability, so asserting that
it always uses one slice context is incorrect.
b) This commit did not add any proper checks that ensured that
optimal huffman tables are never used together with multiple slices.
This only happened with 03eb0515c12637dbd20c2e3ca8503d7b47cf583a.
c) This assert is at the wrong place: ff_mjpeg_encode_init() is
called before the actual slice_context_count is set. This is
the reason why this assert was never triggered.
Therefore this commit removes this assert.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mjpegenc.c | 2 --
1 file changed, 2 deletions(-)
Comments
On Sun, Jan 30, 2022 at 07:27:10AM +0100, Andreas Rheinhardt wrote:
> Writing optimal huffman tables is incompatible with using slices
Fundamentally, this should not be i think
CCITT Rec. T.81 says
"If a table specification for a
given destination occurs more than once in the compressed image data, each specification shall replace the previous
specification. The quantization table specification shall not be altered between progressive DCT scans of a given
component."
This explicitly mentions quatization tables but not huffman tables so it
seems allowed that they can be changed
[...]
Michael Niedermayer: > On Sun, Jan 30, 2022 at 07:27:10AM +0100, Andreas Rheinhardt wrote: >> Writing optimal huffman tables is incompatible with using slices > > Fundamentally, this should not be i think > > CCITT Rec. T.81 says > > "If a table specification for a > given destination occurs more than once in the compressed image data, each specification shall replace the previous > specification. The quantization table specification shall not be altered between progressive DCT scans of a given > component." > > This explicitly mentions quatization tables but not huffman tables so it > seems allowed that they can be changed > The intention of the quoted passage was to state a limitation of our current code, not a limitation of the format. - Andreas
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index d15b9ece50..022f171c9e 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -293,8 +293,6 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s) s->mjpeg_ctx = m; - av_assert0(s->slice_context_count == 1); - if (s->codec_id == AV_CODEC_ID_AMV || (s->avctx->active_thread_type & FF_THREAD_SLICE)) m->huffman = HUFFMAN_TABLE_DEFAULT;