From patchwork Fri Jun 17 13:32:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36306 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp135442pzb; Fri, 17 Jun 2022 06:32:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vSfVOg9ZC2eFH8GJH7b6f5r2X6bTmQzZZJoReefer1fNJYjO0cguCQKIfSveAw9inXqhT9 X-Received: by 2002:a05:6402:2204:b0:435:274d:f04e with SMTP id cq4-20020a056402220400b00435274df04emr12760478edb.262.1655472741524; Fri, 17 Jun 2022 06:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655472741; cv=none; d=google.com; s=arc-20160816; b=Bu7zJAEUxKs6ZZAai8DM2MdsAkMbIcfwkvHBJky8Ru9HhZjNfDAQpgiBtQqSsUS0T2 5xx5JeEdIA6XWy8vfoPcz+5TexFmXXgQ8B/17F6GqfcpV6XSyUX0/FBC3EDQmO+GcbVn 0L9bQYZs9KQ9HjqkMg5RlRtgCRpeptUd+FmakUfMBT1mdQWn9bfBppSoHLepSOnhl3FS qlUPN9jHv5EyrUiCDmJ5PODdeyYBeCQsMxY5qBaurwe36zbwGAqBh45nxGkboUlQONof 1R5+aI2cB4oUJH0FV5J2Jz1KsYjaEQvYzyZwU+NcN7sf+H3EaYdOssm+HKFcw2KKPsQM a/CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=KFqyw98XENl8GiQ4Xkrv3vqXD6J5Qp/whVFHSDLrZ2A=; b=xKsuXzoNMVSZUQfxW90A8rG9kC3Dtlyw5y3EZmnGcUy5t9x3zAav16W5v4U3SJjYH3 PkwQ4ih32VwkEm+oX0y9jOnMubB1LWGqq3MSxr+4FWyl9irCig/dl4JPzfLlzLav0y1E 3BLLMcYU9POuSzvjWB1g59Cc0CDY1sAD++1wY7jN6cXY/jzgqucnoDLejbmzbX19amEJ OREHNvJKZ9xWxUamq8Hiqfh2fF2ipypLJyS3AiDzGD1zoNQiVV124WWgoIKqJnFgTMKz nK8yBMZFvblGdC1iAB5r8bBtjLvCCu5wtRFHoudzKG3bOs/Xd1LysR0mYTzbZ/HyJ+Gi tahg== ARC-Authentication-Results: i=1; mx.google.com; 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 25-20020a170906015900b007075a3f9afbsi4510663ejh.377.2022.06.17.06.32.20; Fri, 17 Jun 2022 06:32:21 -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; 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 9770168B8C7; Fri, 17 Jun 2022 16:32:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E867D68B69B for ; Fri, 17 Jun 2022 16:32:09 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 7D352240506 for ; Fri, 17 Jun 2022 15:32:09 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id kl4RPhJTiO79 for ; Fri, 17 Jun 2022 15:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id EFCF2240175 for ; Fri, 17 Jun 2022 15:32:08 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id D98053A0A3A; Fri, 17 Jun 2022 15:32:08 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Jun 2022 15:32:02 +0200 Message-Id: <20220617133206.23643-1-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] get_bits: move check_marker() to mpegvideodec.h X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 3VzjQK6rbd/y It is only used by mpegvideo-based decoders - specifically mpeg12, intelh263, ituh263, mpeg4video. --- libavcodec/get_bits.h | 10 ---------- libavcodec/intelh263dec.c | 1 + libavcodec/ituh263dec.c | 1 + libavcodec/mpegvideodec.h | 10 ++++++++++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index d4e9276da1..498ce4ed35 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -610,16 +610,6 @@ static inline unsigned int show_bits_long(GetBitContext *s, int n) } } -static inline int check_marker(void *logctx, GetBitContext *s, const char *msg) -{ - int bit = get_bits1(s); - if (!bit) - av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n", - get_bits_count(s) - 1, s->size_in_bits, msg); - - return bit; -} - static inline int init_get_bits_xe(GetBitContext *s, const uint8_t *buffer, int bit_size, int is_le) { diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index e7e821d3b3..ded0a7f618 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -21,6 +21,7 @@ #include "codec_internal.h" #include "mpegutils.h" #include "mpegvideo.h" +#include "mpegvideodec.h" #include "h263data.h" #include "h263dec.h" #include "mpegvideodata.h" diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index f01c942f04..af054360d8 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -48,6 +48,7 @@ #include "rv10dec.h" #include "mpeg4video.h" #include "mpegvideodata.h" +#include "mpegvideodec.h" #include "mpeg4videodec.h" // The defines below define the number of bits that are read at once for diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h index 1af8ebac36..10394a616c 100644 --- a/libavcodec/mpegvideodec.h +++ b/libavcodec/mpegvideodec.h @@ -67,4 +67,14 @@ static inline int mpeg_get_qscale(MpegEncContext *s) return qscale << 1; } +static inline int check_marker(void *logctx, GetBitContext *s, const char *msg) +{ + int bit = get_bits1(s); + if (!bit) + av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n", + get_bits_count(s) - 1, s->size_in_bits, msg); + + return bit; +} + #endif /* AVCODEC_MPEGVIDEODEC_H */