From patchwork Sun Mar 24 22:44:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 12426 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 3DC0F447CB4 for ; Mon, 25 Mar 2019 00:46:46 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 285C368AAFE; Mon, 25 Mar 2019 00:46:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-2.mx.upcmail.net (vie01a-dmta-pe08-2.mx.upcmail.net [84.116.36.21]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AB1868AADF for ; Mon, 25 Mar 2019 00:46:38 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.91) (envelope-from ) id 1h8Bt0-0007sQ-38 for ffmpeg-devel@ffmpeg.org; Sun, 24 Mar 2019 23:46:38 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id 8BryhXMFYxLwq8BryhnPuk; Sun, 24 Mar 2019 23:45:34 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=WaxylHpX c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=79H9k_qMoMjRrmy00Z4A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 24 Mar 2019 23:44:23 +0100 Message-Id: <20190324224426.24868-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190324224426.24868-1-michael@niedermayer.cc> References: <20190324224426.24868-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfINghCjlNFD2nlT1KXPbUNuKd9CgorueQg3G7YaaRPf/f3/DtlEXNfcFom8seFOkLSHKGY8O6jj04cw1LsFZGH0i6+CTUjdO6Wi8KzN5H9ZSZqaOLOcQ hCxyQRs2PgN7we0r4xSlY8L3bThQc+A4N2O5/bCOybx7ZRlsDMNLKSv7 Subject: [FFmpeg-devel] [PATCH 2/5] avcodec/ivi: Factor ref_mb check out 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/ivi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c index 71bf0e6e1c..1a496d9b2d 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -806,10 +806,11 @@ static int ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, mb->mv_y = 0; } - if (band->inherit_qdelta && ref_mb) + if (ref_mb) { + if (band->inherit_qdelta) mb->q_delta = ref_mb->q_delta; - if (band->inherit_mv && ref_mb) { + if (band->inherit_mv) { /* motion vector inheritance */ if (mv_scale) { mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); @@ -836,10 +837,10 @@ static int ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, } } } + ref_mb++; + } mb++; - if (ref_mb) - ref_mb++; mb_offset += band->mb_size; } // for x offs += row_offset;