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 BAB7B4AA01 for ; Tue, 7 May 2024 16:10:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A351068D7B1; Tue, 7 May 2024 19:08:48 +0300 (EEST) Received: from out203-205-251-84.mail.qq.com (unknown [203.205.251.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2AD7968D779 for ; Tue, 7 May 2024 19:08:33 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1715098104; bh=soze7h4iUxwdCm+5jtv48zdxkYuZASul51y+bgyGJPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k8eiICFIXr9G/IxcQMbXGv1mszz7nyc2Q6pM8lq9UFVtumlP9dyPljoPqagXEzkGA 73q2w73875ePNRfBEEaLCvmwyMwzoGzFwXCPENlpu8GZhuvyRk2GacDUC/oxPeV520 9N9KB/1hKp6OWgmfrPTwiynbUDXGlW2yoLsjvJhE= Received: from localhost.localdomain ([113.118.115.105]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 2148D2A6; Wed, 08 May 2024 00:08:20 +0800 X-QQ-mid: xmsmtpt1715098103t0wp8q64j Message-ID: X-QQ-XMAILINFO: N3l5ASPewLWqrCD1XzBZRH6QfCrC1hsFNoUpus3YtSs+6BCy9Nv6OSI+4cmPbt M3acRRV0EG9fFAfzPBYa/KplCTMmUZMO5lzkhYcB7odw9H8/3CO+wdS6uMSHUP8LusG8MsnNuieN C4PB6F/QXFVqzFEVi+xBoSnoZuvN9JaIlgGNBZ6V8fK8W20Y3WbkLsssfOo/FeNKv2ohtNFoqwoA W0UpxrGysGSpaGzJLcefIlR1d7tGDim9Xloidn/hxTrgkJ8GdmDufdtd+JU43+DqR762Oy0BK4em Hh9oikZCv9mTb0778N4AtdOVt4jOVXDUBKb00cdYZxasKytyihhUAJ4z2iIjKki6LDXnS1L710EI t3Q2hoe3lqqCM1BqR5hZTqpvRox6Vpnbpa5zCIANhYFS4j1UMQZoyZdgKfML6LiT6fwqwLarLK/Q qiAzVHWeYY/tU+fYHhCxwmS9YT9LnVI3DK7hREq9vb+7jde50B91HOKUp0zxttyQgeWFDrWWj5s2 5sABfvCadBWK4UkuEl86YNFuTwxJX/JLHDHLovT2hpoh/fORYqk1VP8YoOTcpnJ8CKoeg3fiVjV5 0CCyl091d4DBOrci0zHVPG+mFDSPiWYA/M9vX3Q0sW9hogVVFLd15zpI9HmV6kVJPH1ve3RLiVhw VPzXIH9DdiFXev5OQNoYa6JKagow51V+Gd6xKLAN+TvF6cbOFzzKbdIqi08EwiWVD9q9IFAKRDjG ox5MsdlKN0xR4dN9YUZVZc0aTruVDTfAU75vDAtL7JwfrO+5bVR8IhiI7h8QN/S88ceF7ks1Gdom /eqzr9No+i3EzqsJYIYfTCyJ1+aksz5PHx8Nn+hOM76XmyV4dsFh6R1EOVQbNlK6JJr1BfkCDKfk yuQ7lfjAxK5ZevvjY6fpNlgSZJ1YwpzNyEDDYZe4ST5/ibnKibbImrULAoZso9dJKtMpRqhR2A6j LW1B4AtqG8G0by7z3WgcXIQo8hGApiiNvrv0TtL1xaRSJRWyX/18MVFOVVPCtrUTYvCoFt6Hs= X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Wed, 8 May 2024 00:08:13 +0800 X-OQ-MSGID: <20240507160818.71113-7-quinkblack@foxmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507160818.71113-1-quinkblack@foxmail.com> References: <20240507160818.71113-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 06/11] avfilter/dnn_backend_tf: Remove one level of indentation 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 Cc: Zhao Zhili 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: From: Zhao Zhili Signed-off-by: Zhao Zhili --- libavfilter/dnn/dnn_backend_tf.c | 63 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c index 0ab3bd13ed..eb4a2a5289 100644 --- a/libavfilter/dnn/dnn_backend_tf.c +++ b/libavfilter/dnn/dnn_backend_tf.c @@ -483,41 +483,42 @@ static void dnn_free_model_tf(DNNModel **model) { TFModel *tf_model; - if (*model){ - tf_model = (*model)->model; - while (ff_safe_queue_size(tf_model->request_queue) != 0) { - TFRequestItem *item = ff_safe_queue_pop_front(tf_model->request_queue); - destroy_request_item(&item); - } - ff_safe_queue_destroy(tf_model->request_queue); + if (!model || !*model) + return; - while (ff_queue_size(tf_model->lltask_queue) != 0) { - LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue); - av_freep(&item); - } - ff_queue_destroy(tf_model->lltask_queue); + tf_model = (*model)->model; + while (ff_safe_queue_size(tf_model->request_queue) != 0) { + TFRequestItem *item = ff_safe_queue_pop_front(tf_model->request_queue); + destroy_request_item(&item); + } + ff_safe_queue_destroy(tf_model->request_queue); - while (ff_queue_size(tf_model->task_queue) != 0) { - TaskItem *item = ff_queue_pop_front(tf_model->task_queue); - av_frame_free(&item->in_frame); - av_frame_free(&item->out_frame); - av_freep(&item); - } - ff_queue_destroy(tf_model->task_queue); + while (ff_queue_size(tf_model->lltask_queue) != 0) { + LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue); + av_freep(&item); + } + ff_queue_destroy(tf_model->lltask_queue); - if (tf_model->graph){ - TF_DeleteGraph(tf_model->graph); - } - if (tf_model->session){ - TF_CloseSession(tf_model->session, tf_model->status); - TF_DeleteSession(tf_model->session, tf_model->status); - } - if (tf_model->status){ - TF_DeleteStatus(tf_model->status); - } - av_freep(&tf_model); - av_freep(&model); + while (ff_queue_size(tf_model->task_queue) != 0) { + TaskItem *item = ff_queue_pop_front(tf_model->task_queue); + av_frame_free(&item->in_frame); + av_frame_free(&item->out_frame); + av_freep(&item); + } + ff_queue_destroy(tf_model->task_queue); + + if (tf_model->graph){ + TF_DeleteGraph(tf_model->graph); + } + if (tf_model->session){ + TF_CloseSession(tf_model->session, tf_model->status); + TF_DeleteSession(tf_model->session, tf_model->status); + } + if (tf_model->status){ + TF_DeleteStatus(tf_model->status); } + av_freep(&tf_model); + av_freep(&model); } static DNNModel *dnn_load_model_tf(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx) -- 2.34.1 _______________________________________________ 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".