From patchwork Thu Mar 25 15:49:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26608 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 5896F44B722 for ; Thu, 25 Mar 2021 17:50:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47CE968ABB9; Thu, 25 Mar 2021 17:50:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2487668A98D for ; Thu, 25 Mar 2021 17:50:39 +0200 (EET) Received: by mail-ej1-f41.google.com with SMTP id hq27so3692951ejc.9 for ; Thu, 25 Mar 2021 08:50:39 -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:reply-to :mime-version:content-transfer-encoding; bh=RlFAQVANAMFcc8NEJ+mZmjLI8oS5lRfmRSuYcEfugVM=; b=VELcMUQF4YJZWYDGR0UV/Y4RfLV4VmXuYnBv7g58bV+Kj27jr2S/y7+tepi4qcbgng F5JSsQY0gNsj3gN3Y/0XC0UYcHV7P4YIB5kGGQ1/q1P+dU7j+3YAh9T6yZqxEl1rzce8 Ev/PZ/jnAjbFpC02qqZBoSD2ybamYEiRMxYruRTETnJGb371UsFQwTEfwnv/gp2aJi0v xyL78bL9PgRVNiTdWtLuRcCesQ6zSeenKZXxntuJOASVLAk2eTUkegwDkVzv30XUgrNU DGl26OBCstBUOc+FXjh0YncwGs0EFypdGK6l0TK7Zb5A4NgWfzCTo8sDa9Steeb+omnV nJaA== 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:reply-to:mime-version:content-transfer-encoding; bh=RlFAQVANAMFcc8NEJ+mZmjLI8oS5lRfmRSuYcEfugVM=; b=R7c3l5kQQyHMOqWpEFSSVVerOMOj3ItLNszTt0DG1kq6dGU5C91pzk71Zo2/OH1Jyu p0w6o4EY7aQB4DzBc3rwpu18t1BgmVxt7Q4d2x+WfL+e+KlsR3sxsD2XnKPgUTGvslyV XgPLHhwz94MIgqXwPX5qGxlb/XkxacZ6S5JGhMdJ+tP56GsWhof/37fltWIBf8CRAWJm 7+MF4hbRn+eLKkJaWbl0871aZ/cM1Kn0OGQe2ZD9lEx6mmOJIRkPYvZgRMSBIPsWb5iF tgg1GqaQRB6BfH7UV7Ch//e2s/pKTdEr8hdw8BR3NwIrMHBFMnT0FebeC7O7IkPKzqLO +jMA== X-Gm-Message-State: AOAM5302zOPDN0MdITn9D4p3kbZUFrn7saHethPQ+dURTkXow7wWe2Vi 3SB/XPKyq9doCylYrRKNBe3/gj66CDFufA== X-Google-Smtp-Source: ABdhPJw69Xukh6XIzKGb1xii+8otWb3hx5yRbH0UU3z5Nt7HHQ/fBiS8Wa9c5MmvJJA7MbWZProWZg== X-Received: by 2002:a17:907:7684:: with SMTP id jv4mr10424611ejc.231.1616687438525; Thu, 25 Mar 2021 08:50:38 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc08960.dynamic.kabel-deutschland.de. [188.192.137.96]) by smtp.gmail.com with ESMTPSA id o6sm2859103edw.24.2021.03.25.08.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 08:50:37 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Mar 2021 16:49:54 +0100 Message-Id: <20210325154956.2405162-10-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210325154956.2405162-1-andreas.rheinhardt@gmail.com> References: <20210325154956.2405162-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/12] avcodec/dvenc: Avoid using PutBitContext fields directly 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Also avoid using bitcounts in case one is actually byte-aligned. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvenc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 134315a834..e0679c538c 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -976,11 +976,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) } for (j = 0; j < 5 * s->sys->bpm; j++) { - int pos; - int size = pbs[j].size_in_bits >> 3; flush_put_bits(&pbs[j]); - pos = put_bits_count(&pbs[j]) >> 3; - memset(pbs[j].buf + pos, 0xff, size - pos); + memset(put_bits_ptr(&pbs[j]), 0xff, put_bytes_left(&pbs[j], 0)); } if (DV_PROFILE_IS_HD(s->sys))