From patchwork Sun May 10 15:39:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 19599 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 9A73144A336 for ; Sun, 10 May 2020 19:03:28 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7A285687F58; Sun, 10 May 2020 19:03:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9FED7680060 for ; Sun, 10 May 2020 19:03:21 +0300 (EEST) Received: by mail-oi1-f193.google.com with SMTP id o7so13048309oif.2 for ; Sun, 10 May 2020 09:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V4ztsKXdYy5L+arOkBeCXV0Zx94Sr45oj3m/8eyKSow=; b=tI0RJE2Hd4BrgjBlkcdTUg95VLuLhOeFgM7FjNDcVEobtm4Mhfc5CgAavTn4XBHlpe uiTD2azLP89wzWkmbNM61W7MG7OvRm1yHz6H38FrGBqeo/CMwvzyjikhlQ2/2BL3QhIB 8V9tu0rs9EMujmItj1zwIVYgWwhVIvOKgBWIphyOENldYTpNccTCozoWC7Cod4fKv0GU RyExbLAecHtqohKCTnYL4bvvRkHN7OePRad5TCuSCSnprBAVfqJ08ZIxnOoQ8bxTU83k NCULJPCNlJHQ5nd7MBRaP3+egjZ4s/78E/hJ9apWYLfeJ6khJ5HMULg3CFi5r1GQFdJy PSFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V4ztsKXdYy5L+arOkBeCXV0Zx94Sr45oj3m/8eyKSow=; b=XGzZucTQctzxaa5PRHTN/bk6tq/11GOeIgDSocvrUgvgsYGKeTyJfahMIVUFgvdIpH 5LZxxfIONmwTJXPSzj1rUXbHTA8Spj3sV+l/rgNgQamkd79dHH0hcJbpOz6LqQriVd7R tcq8sIWTsFpePofRANj0XNnMKMVKvdAJQSq3o7BEcNPEBMJqtAw+k01UfQwmxNPewkGB 9ey7Ci23u+SA2/p7AI3iz27I6ETwum1PI+h324wKztf2oDsdE9sUkti3h5Dsl/uDj5cf jEQleJFXhNVNYMlrD07Fx75nBm+mQgS6t6stpxMbLv3xfX0yKLGpCZFYOtFH645cdXzZ N7Ow== X-Gm-Message-State: AGi0PuZxXqJs7Ga3+z2Y3du2aofTCCy8KVgD+VERmio2d0MYt4gBaZ57 GhHQredHTx/RGjApdNuSg2T70GSP X-Google-Smtp-Source: APiQypI5KJV5VcaCzsNWr+6mJ2FbbPs7eKmbd1HD5lr+GbVzAw0w3WTQUAgdOyuCNvIqB7wnMDo80w== X-Received: by 2002:a17:90a:6283:: with SMTP id d3mr17976997pjj.18.1589125179125; Sun, 10 May 2020 08:39:39 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id nl10sm8097171pjb.41.2020.05.10.08.39.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2020 08:39:38 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 10 May 2020 23:39:30 +0800 Message-Id: <1589125170-32558-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1589125170-32558-1-git-send-email-lance.lmwang@gmail.com> References: <1589125170-32558-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mpegvideo: cosmetics 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/mpegvideo.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 561062f..b993813 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -725,12 +725,18 @@ static int init_context_frame(MpegEncContext *s) if (s->encoding) { /* Allocate MV tables */ - FF_ALLOCZ_OR_GOTO(s->avctx, s->p_mv_table_base, mv_table_size * 2 * sizeof(*s->p_mv_table_base), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_forw_mv_table_base, mv_table_size * 2 * sizeof(*s->b_forw_mv_table_base), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_back_mv_table_base, mv_table_size * 2 * sizeof(*s->b_back_mv_table_base), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_forw_mv_table_base, mv_table_size * 2 * sizeof(*s->b_bidir_forw_mv_table_base), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_back_mv_table_base, mv_table_size * 2 * sizeof(*s->b_bidir_back_mv_table_base), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_direct_mv_table_base, mv_table_size * 2 * sizeof(*s->b_direct_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->p_mv_table_base, + mv_table_size * 2 * sizeof(*s->p_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_forw_mv_table_base, + mv_table_size * 2 * sizeof(*s->b_forw_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_back_mv_table_base, + mv_table_size * 2 * sizeof(*s->b_back_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_forw_mv_table_base, + mv_table_size * 2 * sizeof(*s->b_bidir_forw_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_back_mv_table_base, + mv_table_size * 2 * sizeof(*s->b_bidir_back_mv_table_base), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_direct_mv_table_base, + mv_table_size * 2 * sizeof(*s->b_direct_mv_table_base), fail) s->p_mv_table = s->p_mv_table_base + s->mb_stride + 1; s->b_forw_mv_table = s->b_forw_mv_table_base + s->mb_stride + 1; s->b_back_mv_table = s->b_back_mv_table_base + s->mb_stride + 1; @@ -764,11 +770,14 @@ static int init_context_frame(MpegEncContext *s) s->b_field_mv_table[i][j][k] = s->b_field_mv_table_base[i][j][k] + s->mb_stride + 1; } - FF_ALLOCZ_OR_GOTO(s->avctx, s->b_field_select_table [i][j], mb_array_size * 2 * sizeof(*s->b_field_select_table [i][j]), fail) - FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_mv_table_base[i][j], mv_table_size * 2 * sizeof(*s->p_field_mv_table_base[i][j]), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->b_field_select_table [i][j], + mb_array_size * 2 * sizeof(*s->b_field_select_table [i][j]), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_mv_table_base[i][j], + mv_table_size * 2 * sizeof(*s->p_field_mv_table_base[i][j]), fail) s->p_field_mv_table[i][j] = s->p_field_mv_table_base[i][j] + s->mb_stride + 1; } - FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_select_table[i], mb_array_size * 2 * sizeof(*s->p_field_select_table[i]), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_select_table[i], + mb_array_size * 2 * sizeof(*s->p_field_select_table[i]), fail) } } if (s->out_format == FMT_H263) {