From patchwork Tue Oct 24 15:04:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44347 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2122604pzb; Tue, 24 Oct 2023 08:05:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHat3V4TUp8mp7DvLF3LczSawm9NvNmuBhXRC7TX6a4nwPjl/iDOyU2hAHcykFjykup8jF0 X-Received: by 2002:a50:8d11:0:b0:53e:8c4c:ab3e with SMTP id s17-20020a508d11000000b0053e8c4cab3emr9582882eds.19.1698159905535; Tue, 24 Oct 2023 08:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698159905; cv=none; d=google.com; s=arc-20160816; b=jf0RIEyRT06eC6N2gyb4NlBNeNatFT/1xh5dL0Rs49c8gzRoRmhLdhPYfYjUTJodhw IySI12q66uRpOiEuJbT44bn9ug+5jGfTot+upmGCzMZC5zDG7m0EwQ8VoNVGOc6og+Gf b3G3zYapbIO/t1wGdWo+itkjfWaVVrIYsqc2Az6UKnE+5ZSzQTwkxgbNgWzAInjcPQxg K2u8LdA9g//w8v3oO1a725FKnotqc8L62uvnBoGOmH8+rfDt932kDVhnQLwPz3BqVFS2 HqQODtYzNVZbAPtLa3d/h7TDieQ2shZ70x4/Y+3wYLF/s89DVYBzg7SVw0VqwjbQW3OM CZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=1pH+LRLOp+DS3CwoPIuwjp0eyNuwyMxjDPiCBCJFG/A=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=ZsqSitH++D4E9VFACp8wvDJKNitcOxQGYD/HNewaT7Cgr1pCRVcqAS7GOZg4DnjBaG ejmKXTCDeoPvbNf8z+sv8eQHE3bJKIx1ZyEFK2Yk3tKPkxLuM0lWVy/cr1zDzSczwWpI FhuhLjTfZW0QkySTi4BOIAx7Zntpssie6v6SbX3Kpopqve5njmR+nwZByD6QOm+AOBHy RTwsIMBlsZbTFXz9x3EjFy4QUhLnSI6jhsxO4vHNAX5kdvj9dp/WCjh+Ai+CA32AMu/+ 1qg9qf9ysiVzxCjN1j2qtayjLg1Z4r/rXfFwp26Z8mUhw5+U3E/Xg/+c6d/c8S4YdRWM w19w== 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 z4-20020a05640240c400b0053ee70d12a5si4660315edb.340.2023.10.24.08.04.55; Tue, 24 Oct 2023 08:05:05 -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 BD74068C9D6; Tue, 24 Oct 2023 18:04:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7431B68C3E2 for ; Tue, 24 Oct 2023 18:04:44 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CC900FF81D for ; Tue, 24 Oct 2023 15:04:43 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 24 Oct 2023 17:04:40 +0200 Message-Id: <20231024150443.7438-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/magicyuv: Use a compile time constant for vlc_bits 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: iEIAFZSa5ADu This will permit further optimizations Signed-off-by: Michael Niedermayer --- libavcodec/magicyuv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 4a143cdbbf7..78d7f44cd65 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -124,13 +124,13 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1, x = 0; \ for (; x < width-c && get_bits_left(&gb) > 0;) {\ ret = get_vlc_multi(&gb, (uint8_t *)dst + x * b, multi, \ - vlc, vlc_bits, 3); \ + vlc, VLC_BITS, 3); \ if (ret <= 0) \ return AVERROR_INVALIDDATA; \ x += ret; \ } \ for (; x < width && get_bits_left(&gb) > 0; x++) \ - dst[x] = get_vlc2(&gb, vlc, vlc_bits, 3); \ + dst[x] = get_vlc2(&gb, vlc, VLC_BITS, 3); \ dst += stride; \ } @@ -155,7 +155,6 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, ptrdiff_t stride = p->linesize[i] / 2; const VLC_MULTI_ELEM *const multi = s->multi[i].table; const VLCElem *const vlc = s->vlc[i].table; - const int vlc_bits = s->vlc[i].bits; int flags, pred; int ret = init_get_bits8(&gb, s->buf + s->slices[i][j].start, s->slices[i][j].size); From patchwork Tue Oct 24 15:04:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44348 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2122906pzb; Tue, 24 Oct 2023 08:05:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZuZDbpubwVMblhTw436KJp6W+lvJWXyKNL4K5+fMmo5WXLfLHFuJ3NkiZtIui2m3+0V5P X-Received: by 2002:ac2:5198:0:b0:503:3781:ac32 with SMTP id u24-20020ac25198000000b005033781ac32mr8498356lfi.41.1698159921234; Tue, 24 Oct 2023 08:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698159921; cv=none; d=google.com; s=arc-20160816; b=McSTKuHCU18fG1lQeujcQb1XqTvvubpPxHkf/VY2vbR77spcCqeo0kVkWscK42xk7n 5ymo1B5o0qb24WeNK4fKeugwcDK0lUV7uGGopOvB4mX+GenC8ZGOZkuPhs0T2jbMgtaD XjzFECK1lh5YE/teU/F91lAa356emnmn7lkQf0KOX6H1PVjdcbTE/sXhefGey5j4d6+c SYNqMVyW4wL5x7qQ2bmS1kmQxgSw6NE0M9xhhmSuIhCwDrXNdqYbIj1bxpdCr3EaZLz4 S/yiWeqWwzf+JoGeFKp4NKVVhyNX5SBMaA34CHHpAzB2fUM4xl6J9BWFzRaIcA2VjUxY xLtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=dbR9Qnd49Bt6QpAwEWrLlFzUVGHh+qKZz8GAndWkwIo=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=PcHZfHL+/x8nDzoEDH0eyityDU03HBr2ly1X+1vcfkJv3tfpl0x4nVwFQ5eA6ggGgt hkTvINF7FT5pF/r+j1aBqhXtTuNndbmB4id4PKOMvZ1iw5Er4oUiDqK+e5kjtn2IzKWo KRywNxfUVLQJaew7YdA1eoNT4N9ZF6Sav1gNvUTslMwGnpXnLxWkRBEBjK4OtOfN50d4 F1C6yw7MYrdYgZU1GN6jEy72oINSnUhU/IWTEkG4uo2KuHymrpQcbixrXWJExIh0tWIz RmV1ugW8GZs3X9Rl2s+mARsa6keAzDDIeYGWPYUENCRGORMmpZ/0ZQRpNsYCk8nZQuMx Td9w== 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 v17-20020a50a451000000b005403d3931f8si2733573edb.522.2023.10.24.08.05.09; Tue, 24 Oct 2023 08:05: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 1009E68CA3B; Tue, 24 Oct 2023 18:04:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 672B768C9D6 for ; Tue, 24 Oct 2023 18:04:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C523360003 for ; Tue, 24 Oct 2023 15:04:44 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 24 Oct 2023 17:04:41 +0200 Message-Id: <20231024150443.7438-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231024150443.7438-1-michael@niedermayer.cc> References: <20231024150443.7438-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/get_bits: Avoid 2nd bitstream read in GET_VLC() if bits are known at build and small 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Oo+CsL6sKuSb Signed-off-by: Michael Niedermayer --- libavcodec/get_bits.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index cfcf97c021c..86cea00494a 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -581,8 +581,12 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) n = table[index].len; \ \ if (max_depth > 1 && n < 0) { \ - LAST_SKIP_BITS(name, gb, bits); \ - UPDATE_CACHE(name, gb); \ + if (av_builtin_constant_p(bits <= MIN_CACHE_BITS/2) && bits <= MIN_CACHE_BITS/2) { \ + SKIP_BITS(name, gb, bits); \ + } else { \ + LAST_SKIP_BITS(name, gb, bits); \ + UPDATE_CACHE(name, gb); \ + } \ \ nb_bits = -n; \ \ From patchwork Tue Oct 24 15:04:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44349 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2123094pzb; Tue, 24 Oct 2023 08:05:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBeYFPVO31v5R8wcC/vnMNhvKbR+nsrSgqOgqbyDgqrihYeSO58ZYK73cd286EPmNUr036 X-Received: by 2002:a17:907:c205:b0:9ae:50ec:bd81 with SMTP id ti5-20020a170907c20500b009ae50ecbd81mr12484607ejc.21.1698159931847; Tue, 24 Oct 2023 08:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698159931; cv=none; d=google.com; s=arc-20160816; b=r6FipKV/5aiTOZC6btwsiMUJ59xx8BCwnOjVW8gIP6iw2Zev5asDAjbXx4DPR0d5Dx wNNR2uE9fWB5/FKWBOWAaBR8XDjg5r0cmWJbcL/7j6heuOkeegbRj8ZCh0FkTfF9Qmpv /3pzw0QYDwCkZSlxPYX9no+9k6YScy8UgomywJFParnTSYlFXlNKy4DLFgWpckB7is/J 5LMxIamgucHlaqShWUkbadOlwFcyve1MFFU0+I7/aZcRd472/ZbS66rPBB/1eBkzLD59 2iuLr8wBYTjPmRDyQIs1zpinyPBjRO1dmq2z8rMcihf/y1xu7dFi/wNcnto9EdAcT2Cz dl7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=qedFYw5OBlYptB3L8B8hmwkanc14tTJ72kj910yZQUc=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=pLXJVQt2mcpHM7XqI446SuDudfifjw1rc6nG3ZZS6nHLUL7ZdVMxqbf6DNt6fgyWqS HwaDZnjj6bRBkQsmgguj4JKV3oNzZY/lXhoi7szYbGDHMlgcANZP45/sOxaQaReDo0Kt aTrejRbYRIvZmkiKLX0OhsSdYqufymihxN5ZGBOAfqFDVHhX8NzRQKCWpf0A0N5Igh5y UKqh43klwAaPyKcWVd/3T/Z03NtITvwTb2fyqfjB12Wm05KZN54WnuVs4bCdonVvS3Xw xh6OOSe/6c1PXHoLRQK5TYLpipXmiNb0wrqx+KG17HV5zyMpIv2RWSLMTA+k76OG79fI C+IQ== 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 cs20-20020a170906dc9400b009b2c4c1eb6bsi4980923ejc.754.2023.10.24.08.05.21; Tue, 24 Oct 2023 08:05:31 -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 4355268C9CC; Tue, 24 Oct 2023 18:04:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7938268C3E2 for ; Tue, 24 Oct 2023 18:04:46 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A509A40002 for ; Tue, 24 Oct 2023 15:04:45 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 24 Oct 2023 17:04:42 +0200 Message-Id: <20231024150443.7438-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231024150443.7438-1-michael@niedermayer.cc> References: <20231024150443.7438-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/get_bits: Implement get_vlc_multi() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8ULjcWQ7k63B Signed-off-by: Michael Niedermayer --- libavcodec/get_bits.h | 61 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 86cea00494a..806e4b16f49 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -668,13 +668,68 @@ static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, return code; } -static inline int get_vlc_multi(GetBitContext *s, uint8_t *dst, +/** + * Parse a vlc / vlc_multi code. + * @param bits is the number of bits which will be read at once, must be + * identical to nb_bits in vlc_init(), should be known at compile time + * @param max_depth is the number of times bits bits must be read to completely + * read the longest vlc code + * = (max_vlc_length + bits - 1) / bits + * @param dst the parsed symbol(s) will be stored here. Up to 8 bytes are written + * @returns number of symbols parsed + * If the vlc code is invalid and max_depth=1, then no bits will be removed. + * If the vlc code is invalid and max_depth>1, then the number of bits removed + * is undefined. + */ +static inline int get_vlc_multi(GetBitContext *s, uint8_t * restrict dst, const VLC_MULTI_ELEM *const Jtable, const VLCElem *const table, const int bits, const int max_depth) { - dst[0] = get_vlc2(s, table, bits, max_depth); - return 1; + int ret, nb_bits, n; + unsigned int index; + + OPEN_READER(re, s); + UPDATE_CACHE(re, s); + + index = SHOW_UBITS(re, s, bits); + n = Jtable[index].len; + if (Jtable[index].num) { + AV_COPY64U(dst, Jtable[index].val); + ret = Jtable[index].num; + } else { + int code = table[index].sym; + + if (av_builtin_constant_p(bits <= MIN_CACHE_BITS/2) && bits <= MIN_CACHE_BITS/2) { + SKIP_BITS(re, s, bits); + } else { + LAST_SKIP_BITS(re, s, bits); + UPDATE_CACHE(re, s); + } + + nb_bits = -n; + + index = SHOW_UBITS(re, s, nb_bits) + code; + code = table[index].sym; + n = table[index].len; + if (max_depth > 2 && n < 0) { + LAST_SKIP_BITS(re, s, nb_bits); + UPDATE_CACHE(re, s); + + nb_bits = -n; + + index = SHOW_UBITS(re, s, nb_bits) + code; + code = table[index].sym; + n = table[index].len; + } + dst[0] = code; + ret = n > 0; + } + LAST_SKIP_BITS(re, s, n); + + CLOSE_READER(re, s); + + return ret; } static inline int decode012(GetBitContext *gb) From patchwork Tue Oct 24 15:04:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44350 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2123239pzb; Tue, 24 Oct 2023 08:05:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpIE7apDN3OBK8j3NZk9GIFgn7O8R8LsrqA8z6/Yac2bPdOTt3EE42miRSeaXMJ0XPBCSv X-Received: by 2002:a17:907:724d:b0:9bf:952d:a8ad with SMTP id ds13-20020a170907724d00b009bf952da8admr10559102ejc.5.1698159940807; Tue, 24 Oct 2023 08:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698159940; cv=none; d=google.com; s=arc-20160816; b=Eajyu49j3igMZ3mmw9zSP5ST8b1rjpmkN2MtjTDVr3aY+O/Bk2HoTSYbAa0sq5d36V t2/PrthM1q/Ah2Mp6Ahs30ygCNCZ8CsnSkqUWsnZQ8QSkNRiDkcN0C5u9oz1bTgaLqVI UZibVCoUsUos6ZW1NQiXiIfWVEqpzb8/w0b+UpQhFTh6IhaAqBCFrhbnhZJkevq6Skyn JC4h+KP+FNB+nxeayGWkzT4h3y3eGVpIl0SZfoU4DJTCX2a5Rp1VZR7DZhKI6vkTtUOK CEQPXLitmGy0bUPF/aADYeBVvHBrJeSEyZylpA2mDh0+e8hhFLslBYi8ydsyhpjvpgod 6Q9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=sWRFZ7ZwL2XQl/gJqfKi2zs+eN2j+5YFWPH4g6DB7+M=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=fT/528jdJbnWUut53hMaUxyf445zfpoUP7N3RK3WvPI6w/PNYQ5Jx7u23x04us0dOu BTbVv/KtPNz5K/KZH8q+TSCVKz8HX4RzRDIK7TYisPM2Xn+vFM9w+TMaXAk4SKRWYdsN /I9+2AJojPsNh8aw8e8audG3+VbRyA9osh5xqsx+tsr/3JmC3QRu/wcs/A+ZxCDard5s aDMxYAsatE855x7voMKMy9eBSb4T1wc9rJTcMwYrTp8jf+wwxScIQVdey3FMz/+nk/LV 26f32v5lJU7DMz8m19o4pa4Ip0hFSVX1kG603aq+aeZPsc1zpg1F+Y124BqEJ4paMbc1 MkAA== 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 e7-20020a170906374700b0099277496cebsi4417071ejc.348.2023.10.24.08.05.34; Tue, 24 Oct 2023 08:05:40 -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 3CA4368CA67; Tue, 24 Oct 2023 18:04:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C36068C99B for ; Tue, 24 Oct 2023 18:04:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8D6FB1C0005 for ; Tue, 24 Oct 2023 15:04:46 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 24 Oct 2023 17:04:43 +0200 Message-Id: <20231024150443.7438-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231024150443.7438-1-michael@niedermayer.cc> References: <20231024150443.7438-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/magicyuv: Set UNCHECKED_BITSTREAM_READER 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tspuIhFHiKQC The code already checks for the end everywhere Signed-off-by: Michael Niedermayer --- libavcodec/magicyuv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 78d7f44cd65..2ab29df2f51 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -23,6 +23,7 @@ #include #define CACHED_BITSTREAM_READER !ARCH_X86_32 +#define UNCHECKED_BITSTREAM_READER 1 #include "libavutil/pixdesc.h"