From patchwork Sun Jul 3 10:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36627 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp2138897pzh; Sun, 3 Jul 2022 03:28:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uu2TP8wuEGVVs+KgnCKNRDK935OZessrxN0bHEDOh1w2XDo3uuTmOUc3T0db4B7W8+gTSO X-Received: by 2002:a05:6402:4302:b0:437:7990:992e with SMTP id m2-20020a056402430200b004377990992emr31011052edc.194.1656844102082; Sun, 03 Jul 2022 03:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656844102; cv=none; d=google.com; s=arc-20160816; b=KzbMUdJOw3ojSSB8HqogAWjT9487FSmpU7x8X5cFbwAqOTftGbLJ6tlHGRUPll3GZX vmI8ACbJ1lzI1GCU9ckDHaiba4fbwarReADiRSx51hdbrnft6+6ycV2zXwNGv7Jex2yq CSNhnn7BZ/wiiVc03885wwthtlYn2+P5gaPaibhEE9oyt2OmTZzHzQf5hEyybP0KkOwf 8skli1hP88OJM9V+COk+2uqdacgBA39CuuacFcvUXmd6WRErrib2sznP2iIu/qGGsqSI S0GDKTVsZgnYD4SnJp8QOfLSPG8zkKwNgadm/Oqma3jX33pBGziE7alHyAxZFPscVClr cKvw== 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=f/5NF4U4qf5OWy/tFK7gqVPNGTLum1Nd/hSJhuv9jcw=; b=QAWDQMNaRJEOG6PHIWAWydAMgT3e9phfEbBcy4L/jC6i3D+9O2hhCxQo7eEU5nytQd DqzHZWf9DCnRoMosnG1x48iFIT9p+9hzwHHUHZYeDbNKdDOXVeyNsirLRnf0NVeXCz0J 4LDqQLWfkr+brikyUN+uvNhUGmw4o0x+klPLA/CUkb11HjdLFuVTJzf7ic85UcjgXDOP UdJWlrw8mSwcZL7On/o4bsat0I0ZaoxtgPNliEJrvCOCWGVdhZTawrXkzKumyOaFTlsQ HYm4ARgDoVA2uYyAlFEtML4yTLR6etajU05p1O7DaoPCL7hVLrueFOxo9No55X9aIZvG XduQ== 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 q20-20020a170906b29400b0072a60823affsi11485711ejz.49.2022.07.03.03.28.21; Sun, 03 Jul 2022 03:28:22 -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 9EDD668B9C1; Sun, 3 Jul 2022 13:28:19 +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 1766268B987 for ; Sun, 3 Jul 2022 13:28:13 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0B71824017E for ; Sun, 3 Jul 2022 12:28:12 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id PspM6gE9q5sl for ; Sun, 3 Jul 2022 12:28:10 +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 84CC92400F5 for ; Sun, 3 Jul 2022 12:28:10 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id C50DA3A061D; Sun, 3 Jul 2022 12:28:10 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 3 Jul 2022 12:26:34 +0200 Message-Id: <20220703102636.32523-1-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] 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: EbF+IAJUerI9 It is only used by mpegvideo-based decoders - specifically mpeg12, intelh263, ituh263, mpeg4video. --- libavcodec/get_bits.h | 11 ----------- libavcodec/intelh263dec.c | 1 + libavcodec/ituh263dec.c | 1 + libavcodec/mpegvideodec.h | 10 ++++++++++ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 16f8af5107..992765dc92 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -31,7 +31,6 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" -#include "libavutil/log.h" #include "libavutil/avassert.h" #include "defs.h" @@ -610,16 +609,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 */