From patchwork Thu Jul 20 18:39:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan-Teh Chang X-Patchwork-Id: 4396 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2481471vsb; Thu, 20 Jul 2017 11:39:52 -0700 (PDT) X-Received: by 10.223.172.183 with SMTP id o52mr7706323wrc.1.1500575992197; Thu, 20 Jul 2017 11:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500575992; cv=none; d=google.com; s=arc-20160816; b=Xp1GtF7IkS81+dJ23YI+4ZrQfctBGqQ+0PUUk1kHA832CJijrIsglfjPj3bZOkh3A1 SdR2CjPhkNkQTPC9pyMo9FwkomIwglAOeII2X04Vc+VfKHvnqGlMcxr7fMDzQ/hzwmPe dPtSzEDl3cDgctDZ4HGn/fd4pzJ26SVczzKtJKvyV9P0eZ79Nm8FJp+PnyREIXWxtftr +BoNqM6dsnKJ2Bu0H5CXjKJQrfkVVhF4LxiIYTbdNyysDBplUt2D1vWnlxwVpYY5CveX XDD7ZbpRUXVijJEKoW07QgEA7SdZ0wBlj6kBvnzUU9pwTB95CPtPdx7CsNWCItjkJMOH q67g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=Z6vNr8T48uccS4FbyIiBdm4ei56htVSbaJ6vE7EsICs=; b=RwD6eEv6HRESszBba+sM5WinwtUZfiUjFKMXz5FWCe6qUbiby1XwLS0udOoKpcwq8S gjhK5h0zHaG9rXNbTgOusPUBD8jg1hi5pRwypeYyx9VlH8ejSUFzqgyiNS7GxRP2+LDX mYWzTgrdeq6BBAaf4B+VygbthweXLPuF7/W9oiTTwfyaNtmXnUsagcDgs+jD4Fc+ypu6 1iEZFeyQaQwt1zfDHpA7oijKUvqUpuVsLtQqAuXwot62PmJ95Fxz7k1xcCHT4VDl/FfZ 49lbWEpVZqDM/aLSz3VnK2GhKFzRcOVcyoT9gkQ9beGg4kxvhFMH7uDu5US24hS2gLhh Y14g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.b=e/ZjCQ62; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 32si6468507wrn.5.2017.07.20.11.39.51; Thu, 20 Jul 2017 11:39:52 -0700 (PDT) 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=@google.com header.b=e/ZjCQ62; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08F34689A9F; Thu, 20 Jul 2017 21:39:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f48.google.com (mail-pg0-f48.google.com [74.125.83.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 675A468826F for ; Thu, 20 Jul 2017 21:39:34 +0300 (EEST) Received: by mail-pg0-f48.google.com with SMTP id 125so18292512pgi.3 for ; Thu, 20 Jul 2017 11:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:subject:date:message-id; bh=uSknNAZwYfpwI/1zEyRlW6MUjC3hBHcAn82zgpzesho=; b=e/ZjCQ62gWvKgUz3zvShT/iBvogZRFsGXGtVkbpQ0sqFChCbzULvxCUdZqDCqbb7RP 4tXwPtF71oS1ZnIIzSA6Hsvp8Y7MMo+xAar5/p4DKaqrv/otBkBmX6Dd97sAV2qdYZ4e BPpigedple2smUGdrQj2QXEsQZx6qPdGrv6agLYxL4Jx8gs76hVRwrjQaKaxQTVwxSHD 9NUlBYrDIl3auif6m6AzSIEOVz3+qWreLkmeOHKvk4RxWLlTjSWjhN6STiKRRz7B2p/T cBKa/9uiwGVwAT2XxKrUUAkNjowNXLWSKsrt+2qPd2QfVsaqG5epf1FquRGy0ZIJTRdt u/IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=uSknNAZwYfpwI/1zEyRlW6MUjC3hBHcAn82zgpzesho=; b=Zbq4mowEeBtEiPigTAskPOu+0ZvgNRX9A/m0kcmXMaQ2FkpDA4UxEWspTaYL8//6CI LcKBjS2336bUM3S9scxVYpGMCsejydwwFjY6h7XISQl9n3jP86ocapl2zZiUlZT9iqAJ Xgb4pSpxifq/FROOdE6UPdwXDin2XtFyJ4HdxBIouYNude2akiS8Vql62xpaey+1O249 nzR6s8GvmLQ2eJA9dzr1T0ZVNJeY5I1wEvhhhbi525+O5oFk+8jTlk1pSO47eddasKTl vU+Qm9kRDhQ4ypVjxxSsA1iW40qt10XIZcFUTvyf5uJ+FfJQaK2MRDnFsJ25++t584t+ ypyA== X-Gm-Message-State: AIVw110U/eCMpPigHHQ2ZddU+KXqTwAQapjaF5VaINYwZA1APLEJKTp+ Rp1PdVCyHMOOy0LwGC0hYQ== X-Received: by 10.98.148.25 with SMTP id m25mr4890728pfe.7.1500575980669; Thu, 20 Jul 2017 11:39:40 -0700 (PDT) Received: from wtc-desktop.mtv.corp.google.com ([100.98.5.29]) by smtp.googlemail.com with ESMTPSA id n9sm6264842pfh.109.2017.07.20.11.39.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jul 2017 11:39:38 -0700 (PDT) From: Wan-Teh Chang To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Jul 2017 11:39:11 -0700 Message-Id: <20170720183911.52063-1-wtc@google.com> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog Subject: [FFmpeg-devel] [PATCH] avcodec/hevcdec: hevc_await_progress: declare |y| only if used. 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" hevc_await_progress() uses the variable |y| only inside the "if" block. So |y| only needs to be declared and initialized in that block. Signed-off-by: Wan-Teh Chang --- libavcodec/hevcdec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 55f51211c3..e084d75767 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -1684,10 +1684,11 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref, const Mv *mv, int y0, int height) { - int y = FFMAX(0, (mv->y >> 2) + y0 + height + 9); + if (s->threads_type == FF_THREAD_FRAME ) { + int y = FFMAX(0, (mv->y >> 2) + y0 + height + 9); - if (s->threads_type == FF_THREAD_FRAME ) ff_thread_await_progress(&ref->tf, y, 0); + } } static void hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,