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 065D94A40C for ; Tue, 30 Apr 2024 07:12:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A911368D5D0; Tue, 30 Apr 2024 10:12:34 +0300 (EEST) Received: from out203-205-251-59.mail.qq.com (out203-205-251-59.mail.qq.com [203.205.251.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C034868D582 for ; Tue, 30 Apr 2024 10:12:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1714461135; bh=1wklaRLE14l6xLaWgU45zthbEJNQvCoOjvvidDHrzgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Rgv2rHouwAJ1Uj+q6LYRqdtZoQz9bLUcd3bq18e343/WYocdmuyrtc/2AdLnFqNTy 0sq81CRHtZB31QUGIgArGZrEGQSdKCcRnsPLswIKj8iFQab0txn7cCrNlHaiSsmyPN Cz/avCYwxRYD6mM+/loIm1WCj+dY24utTPxIESxE= Received: from localhost.localdomain ([113.108.77.51]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 3091B0E9; Tue, 30 Apr 2024 15:12:09 +0800 X-QQ-mid: xmsmtpt1714461134tgmsclvf2 Message-ID: X-QQ-XMAILINFO: M7uElAZZZMmFED9XRmM5uTKVs/Ztq/BJmh6YbZ7UeOks6+kD11yzX1ZixwVRc6 n9yTBEeXL2FjJSH89MCis5S/cwOu637DKXiH4xpHJ6li0ci1HhsbZC+lis1vVbk5sv8QyqH+AMYb fv3GJj63KiSHj7Lw9JZcXI3oLHJ91CIoimxoFucZN64mSTKBdSWiI8cu791vamWi9IVP+/iD/fC3 e1jD9A2HUlLHsfUrPvqBZkRnN9yiZhBw1PLoYg/sgmFw0t2WKvUBkuYxpoHX/HFUR7EGEYgdrmb5 TPpBt9AocArUc4bMbxq/Q35e08SCIIC76V15BQ1azSbEyBGZnLidAQP5x5t2yIiYp/QubwSD3xZ4 end7eC2Q3txFGKRWFQgdTrOEHBTVwtMuuhxbOA/ty21UXLp42GCfJzngGFDFQ5E/lEIFadI99IE6 ijR4QAU0JQ0raaKpButjUNg970bkV+sIgZAq840nWBLEX8t13TGDtTtvSJYS4TwaSl2Tdpkao3Jf KO/LlzMJx/q8TUenmy3Pf0cTeS0zbkZ3DAAD2+n4BVi9q8NrzmzeAl9qRP0QjeXAMUeZPDORbsMZ p1BgEp6XKx0O9NaDZk6CvPFsl7aaBJKtMnAjJO/5uthz3SJoWqCfIulfB8uxCd4chL7ElfdpcmYX usBVJ5BOeqccR3DGPeajyNZEPYrE0TJl01OGWDgsni+GacQnVlBnf0w6KA7MPiNX+pK2cTHKNPe8 QDQ6SthxQ3/S/FGgkJ68Fg7qeKg0sYbJOudihbJk1OE1JNsGpyLdxHpEp/lIGP20Pt5b/COuVajs hw74sEHxpbLJE4aTvzToXhUdSraESdgWjZdCAkCOMert40XtZMPknkcj6G705xDGyhlJnrKhWSK2 QGwV4ZAjyxxTH3a7zC4xvbL5aRw4hnbdMeIjuZVZ2Gu7WXz0spJT2lWI1lA7KNkiFZ2J5h4dsW2/ RooFydd209Tcllr/100moBeb6a17k//x9REl1APxhUS5m9lLlrXD0NTHA9xZDINEP+v8RSqcRw5k uH88G8ljdqR+QEGbOA X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Apr 2024 15:12:02 +0800 X-OQ-MSGID: <20240430071208.126817-5-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240430071208.126817-1-quinkblack@foxmail.com> References: <20240430071208.126817-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 04/10] 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 --- 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 d24591b90b..60f9e57fb7 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.25.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".