From patchwork Mon Mar 23 04:08:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 18361 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 42B2744B13D for ; Mon, 23 Mar 2020 06:09:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14F3F68B680; Mon, 23 Mar 2020 06:09:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B870C68B679 for ; Mon, 23 Mar 2020 06:08:57 +0200 (EET) IronPort-SDR: rq/DO0AuvQJ93RVBiNH30INGGMwjWR9Qz8joXA/Z7qMAKrbz/swqCkFtN1WVuySFW9eYPlrvb8 u2XEXW6j26Lw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 21:08:55 -0700 IronPort-SDR: U6hcTZ1TqjlrceQpiJcdSoxKb6U2vwtEJSiaInua+JqEkr1knw9DepqNvMR9QD3Hr2+S7PqI6E 8ylB811nSmkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,295,1580803200"; d="scan'208";a="392781089" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga004.jf.intel.com with ESMTP; 22 Mar 2020 21:08:54 -0700 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Mar 2020 12:08:00 +0800 Message-Id: <1584936480-9033-1-git-send-email-yejun.guo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 1/4] avfilter/vf_dnn_processing.c: fix typo for the linesize of dnn data X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Guo, Yejun --- libavfilter/vf_dnn_processing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c index fabe4f1..cf589ac 100644 --- a/libavfilter/vf_dnn_processing.c +++ b/libavfilter/vf_dnn_processing.c @@ -329,7 +329,7 @@ static int copy_from_frame_to_dnn(DnnProcessingContext *ctx, const AVFrame *fram if (dnn_input->dt == DNN_FLOAT) { sws_scale(ctx->sws_gray8_to_grayf32, (const uint8_t **)frame->data, frame->linesize, 0, frame->height, (uint8_t * const*)(&dnn_input->data), - (const int [4]){frame->linesize[0] * sizeof(float), 0, 0, 0}); + (const int [4]){frame->width * 3 * sizeof(float), 0, 0, 0}); } else { av_assert0(dnn_input->dt == DNN_UINT8); av_image_copy_plane(dnn_input->data, bytewidth, @@ -369,7 +369,7 @@ static int copy_from_dnn_to_frame(DnnProcessingContext *ctx, AVFrame *frame) case AV_PIX_FMT_BGR24: if (dnn_output->dt == DNN_FLOAT) { sws_scale(ctx->sws_grayf32_to_gray8, (const uint8_t *[4]){(const uint8_t *)dnn_output->data, 0, 0, 0}, - (const int[4]){frame->linesize[0] * sizeof(float), 0, 0, 0}, + (const int[4]){frame->width * 3 * sizeof(float), 0, 0, 0}, 0, frame->height, (uint8_t * const*)frame->data, frame->linesize); } else {