From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7BD664096E for ; Tue, 1 Feb 2022 21:22:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8D24F68B0D5; Tue, 1 Feb 2022 23:21:21 +0200 (EET) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68DEB68B070 for ; Tue, 1 Feb 2022 23:21:13 +0200 (EET) Received: by mail-qk1-f182.google.com with SMTP id g145so16385171qke.3 for ; Tue, 01 Feb 2022 13:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KPPSlGtjCB1/5TPBdOPlm6usl0v+OscZcchvzRlXvmo=; b=DOUASdlNSzTSBV4RuC5CQYDlJm6qJqSSm1H6T1Z9h5aKwg6ajkEBVeFH8O5O0H7h8G YidBWAg6EviSHJeBwlG4mc1gwZfxek0uGfj83BlA3IB//70pADy9yxCLEPKZwVm8vDVg 9YSty+XKTBnFZRcGK6wnqmRVep7XiLLmnnIL+qyzNaQdEs4TWXm1+4AFUOFdr0IegoEi wOeqKYChbzfgEW5DLI+hQNijNsLb3oSfCWZ1tgxqTDzBwGN8fkA6JAnWis1CXDWKA+8K drSIKns2h8pWzBAEkm9CQZg67KS9tvlBhOUnDH8mEdVMD0cRPUHpgisib+GA3QK7FEjd K/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KPPSlGtjCB1/5TPBdOPlm6usl0v+OscZcchvzRlXvmo=; b=FvT3P25mmOxe8yNLnPOHjIAJhMdKLWjHolKKHnE8Unaaq7J90PwRd/4BuXtOV3o9yX UnetqYkrnMqT4VQQAsDxIrCBRrnFkQHiKKpCxRAys2cT76v2JzpOKV86IH86SEUy2b/6 PPaCBICdb0r8KRFJ6p+2F0hIb/WdaK90uKcB0c4enhE8m6knN6tE5TJUbCTl17IJ86/V kjnQ/UEyY9W1TCWqogSJOJGPyzXv93oQ8ZFfZE8/n2qeOn4JH4nvgTTONAFz0xsfz0M4 jKkJDJuM6BVHmGBIQwO/YPO3rpV22ySP6KOb/ZwyfQGscnLJ03KJj1gag0OQPzY4iS3N muhg== X-Gm-Message-State: AOAM530AO0SBO7QVj2MPcc2XstJTqPc1RhO0UijCD0z6Myx8g9jWvBEH cr9PJWbbttKpLCtydk6Ypj/n1NJqYV18Lg== X-Google-Smtp-Source: ABdhPJwavNB2D/nisPYlWww54qsRE3X4wcNsCaS8stHdSD4sUWUL1qpNH4ul32oaP2HTiLhQsfs0IQ== X-Received: by 2002:a37:270a:: with SMTP id n10mr18584619qkn.422.1643750471895; Tue, 01 Feb 2022 13:21:11 -0800 (PST) Received: from localhost.localdomain ([151.200.235.219]) by smtp.gmail.com with ESMTPSA id ay18sm2928225qkb.8.2022.02.01.13.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 13:21:11 -0800 (PST) From: Scott Theisen To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 16:20:56 -0500 Message-Id: <20220201212056.29712-9-scott.the.elm@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220201212056.29712-1-scott.the.elm@gmail.com> References: <20220201212056.29712-1-scott.the.elm@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] avpriv_find_start_code(): reduce the number of iterations 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 Cc: Scott Theisen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: by correctly starting with three new bytes on the next iteration, instead of keeping byte p[-3] which is invalid, i.e. known to be 01 when it must be 00. --- libavcodec/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b4c5fa5009..d485d0c96b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -965,7 +965,7 @@ const uint8_t *avpriv_find_start_code(const uint8_t *av_restrict p, // i.e. p[-1] == 0 is equivalent to p[-1] < 1 // UU UU 01 - else if (p[-2] != 0) p += 2; // we have UU YY 01, so increment by 2 + else if (p[-2] != 0) p += 3; // we have UU YY 01, so increment by 3 // to start check over with 3 new bytes // UU 00 01 else if (p[-3] != 0) p += 3; // we have YY 00 01, so increment by 3 -- 2.32.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".