From patchwork Sat Sep 26 10:27:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22626 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c650:0:0:0:0:0 with SMTP id k77csp1722509ybf; Sat, 26 Sep 2020 03:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0ApwiK3GLnISlQJ52McvE5CMebMQUnvrPKtZfYQm2tTA7lIgKrYUeTnNFv7iZpYE+ByDq X-Received: by 2002:adf:f88d:: with SMTP id u13mr9593133wrp.213.1601116572372; Sat, 26 Sep 2020 03:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601116572; cv=none; d=google.com; s=arc-20160816; b=z0hnap1Pl/vCF6ZtOiStCmvYtu5Esag8hUNoQQmXengMEHtpr+1edCLola4aNdDn52 xDV6vczCAVosG4POVEcqhEe0tQVJDOu1uGLph8P+jRmEA77WkUDRsTmxq7xk4Ekx0bDm 7W2Im93m+hFhyXQ73O4NQQLvdfaS/92wqslD+4xIsv/RH6LYQ5BG8zb0iCuW55MB/i9T o5s/ea4VX9gRa0eEhUR3CVVeLQ/tt09TKJIpSKfytSqOkQqouCigwhKgj29b/l3L/XMQ 6NYM1Bh4N2GbPyKMW31o5YAXqF75msy4k71yq9qNdjG2lKPoxkVze9TsNmnFADkyXBXf fV7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=zOaOEgLynrQLAhnytKviDTh1vttlGolN3rWpTqfDty4=; b=aBYY1ZgKFGOYIQ/1rjXKfDxqMlI1CGblL602urUF6oWnLd25vanmMrH9PL6rf1rBPA jAMvSv4m8IXB8E5JyZcse2ZAp3ozgOpJmJaydFpWxtw7+58nDFDhyRaW55EPM8exxiCP 7EhKKy81g+rZ/wuONj+TT0ZsEjicP90M+RPqbIMUkv5l0c0r+I6vgTAW8tN7p5ZLPhXg O7TtOi+XMxTKn73vjHV7TtAzjtUxcLFhXwD+EWuBSJN6Vwph1GsMY2zLdt4L3czwbTIN VENNrP0kvPoUgssoUxOw/Bi9VcOYEZYHL8znkkUVPtQawSvWhp8bGDvj3oqyJN7UeZ+x /xfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=JxxhEoBI; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s8si5063360wrn.325.2020.09.26.03.36.12; Sat, 26 Sep 2020 03:36:12 -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=@gmail.com header.s=20161025 header.b=JxxhEoBI; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD81668B773; Sat, 26 Sep 2020 13:36:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 09ABA68B76C for ; Sat, 26 Sep 2020 13:35:56 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id w2so1738297wmi.1 for ; Sat, 26 Sep 2020 03:35:56 -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 :mime-version:content-transfer-encoding; bh=d8P0qbWSO4yudPweHUYIG1bNvk+mceRmrQ1f2kQCMuQ=; b=JxxhEoBIxLzg1AMObtqdQBF9svHUISILp7epE6avqQVt+B8ukgxvk4hzsUfcyRYD2e nbxFjBfulUSqhf7e+gbVXld4uAA/f4ihVk+DC7z2839f7Sr5mgAB6CmShoHf1Yv4xVp7 wMFJVRonsCg4lpG2srYaXLONeIQ23aItGCrmdc9A2IkefBgyEVtztlLqKpM5zvnDsCjR 9NcMUBsmROg3vTk5hFAMcocUB4+C6lG3Ephmoyn1hi6j8qJIwoJwNFs8/vAF3c5SYi8m UojJo+yFmNwYc1/F9z8bYEg9gllVi+Dk/yCUhGZeJ3rN0brn0UBS8OX5vROj9XuzhB/Y TwoQ== 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:mime-version:content-transfer-encoding; bh=d8P0qbWSO4yudPweHUYIG1bNvk+mceRmrQ1f2kQCMuQ=; b=HqrJ/vOkSMs15h7sNcxEaVbw8p5VjR5TuHjGdtyHhSjiPU/pklWcOi3eaHL50TuCFX Zt7J/AKlHn1ykhuFMSfjlzL62njUpaRt5VPzh8KImaYaoupxzZ9LhHoNDPYAiboCvcsr tmVmRxbesBsmWchnjIN6h8v8i7SoYIATEQwRuguXWkKu1g+1XZBdni1+eXPrZdzlTxkv MT1RiqrEvIwM9iSsd6PUimXEp06L4F2v/3ePs2Ekp2uyvgKPl/v5oxrYrTTKfiTDYuOs VmaOZGzgLKSMrcDh+YRTaRxCmweR4+vdsOLSOCS2LBFdRNbN48ckVqK+Q8qgZvTlgJkR TZ5Q== X-Gm-Message-State: AOAM530yrz+9XQBQmNZaBBsDKg5UHP9QQub1mM62XTNCgkSk7Ghvge/T nUvC7PibeOhtLInzjIsjbL6kJBbJerc= X-Received: by 2002:a05:600c:283:: with SMTP id 3mr2094147wmk.110.1601116192929; Sat, 26 Sep 2020 03:29:52 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id k8sm6064867wrl.42.2020.09.26.03.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 03:29:52 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 26 Sep 2020 12:27:41 +0200 Message-Id: <20200926102804.228089-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926102804.228089-1-andreas.rheinhardt@gmail.com> References: <20200926102804.228089-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/25] avcodec/bytestream: Add unchecked bytestream2 peek functions 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" X-TUID: cPfJvNbf4S7o Content-Length: 2424 Signed-off-by: Andreas Rheinhardt --- libavcodec/bytestream.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 0516a6e3dc..d0033f14f3 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -77,11 +77,15 @@ static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ } \ return bytestream2_get_ ## name ## u(g); \ } \ +static av_always_inline type bytestream2_peek_ ## name ## u(GetByteContext *g) \ +{ \ + return read(g->buffer); \ +} \ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ { \ if (g->buffer_end - g->buffer < bytes) \ return 0; \ - return read(g->buffer); \ + return bytestream2_peek_ ## name ## u(g); \ } DEF(uint64_t, le64, 8, AV_RL64, AV_WL64)