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 8806D48CA1 for ; Wed, 24 Jan 2024 08:18:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 110E168D169; Wed, 24 Jan 2024 10:17:33 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0035968D0E1 for ; Wed, 24 Jan 2024 10:17:26 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=b6C0PiMd; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9A9841A0C for ; Wed, 24 Jan 2024 09:17:22 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id xqvhowu-RzLJ for ; Wed, 24 Jan 2024 09:17:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1706084239; bh=M+i14zY8QeWYOQkq+X02iyBrMMzhV10dYDySUHblxys=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b6C0PiMd+89lysYTJG43nb/+NRMLqkHmlE1bKLP+7ZfO6TwQ/egSHQcLZ78d+nQVQ mECaXR+88500/9fAB9npFWGVd1agd5Jj1NRIZp/rph0TBQjF+S0WLEp3CMGUP/Jm22 BYZFm8LaE5o4e0MlvgjdiLRk1tHxV3TApENuE6M5sq6xhb/K72iEZhOUwR3G7dHFoK 2rjTO7/IKmxA+rsrpPKM6t+76r5dNmYsZzDGBwBkNI5hDTxWJMKToksI0CkqDQzmNB Qd3DP9aYDt6ZYlytl0Pa77un0i4eqeH0FvcOQoTDxMGHBczO+D3H9fQ2+ncLb4PYnh 0nC116ZS5ryNw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id C61E21A3B for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id B10F53A0582 for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jan 2024 09:16:43 +0100 Message-ID: <20240124081702.4759-13-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240124081702.4759-1-anton@khirnov.net> References: <20240124081702.4759-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/31] fftools/ffmpeg: refactor disabling decoder threading for attached pictures 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: * as this decision is based on demuxing information, move it from the decoder to the demuxer * as the issue being addressed is latency added by frame threading, we only need to disable frame threading, not all threading --- fftools/ffmpeg_dec.c | 3 --- fftools/ffmpeg_demux.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 7037175a48..e0d8e27098 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -960,9 +960,6 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx, if (!av_dict_get(*dec_opts, "threads", NULL, 0)) av_dict_set(dec_opts, "threads", "auto", 0); - /* Attached pics are sparse, therefore we would not want to delay their decoding till EOF. */ - if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC) - av_dict_set(dec_opts, "threads", "1", 0); av_dict_set(dec_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY); diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 02add669a0..d804358d55 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1259,6 +1259,11 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) if (o->bitexact) av_dict_set(&ist->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY); + /* Attached pics are sparse, therefore we would not want to delay their decoding + * till EOF. */ + if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC) + av_dict_set(&ist->decoder_opts, "thread_type", "-frame", 0); + switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st); -- 2.42.0 _______________________________________________ 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".