From patchwork Tue Nov 24 14:41:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24024 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 8123E44BE45 for ; Tue, 24 Nov 2020 16:41:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4FFBB68BC63; Tue, 24 Nov 2020 16:41:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F1E168BAD4 for ; Tue, 24 Nov 2020 16:41:34 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id p22so2624538wmg.3 for ; Tue, 24 Nov 2020 06:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z1V88FwuMlgKnS9hRtkLeDXA8Vs2jJqcH4PEusY0mo0=; b=GOSA5i7J3HAJDsxLdQqi5u6z9DY6INyAzcUCs4Xzx3HNXQfee0dwFFhvTpQaPJG1Qd jUhKglFZif8lQ2cQHmALlZHhuUh3IwOkHohpZQ6TL9r+HDEaep5l8wP7M+ZAvKHFYXbt wJ+KmTEEvqkni9lizUtPbW2sl4DHc7b1KQhjz0Dr2eWh8nuQFN1iT3KMNDrs/e62QNrc liff0oj4VCRyTTwI5gm3Iy9zXs6naItPOSBZLyCWjx72/WiWVqbVx3B5wCBXoPuxx+pk qkGXHpVz1VXex4BuH1KGyesn5Y0DVAa1Rd3Fa+SlPG51sZhtdP0wLvLt/LBTMrXcIN2k yJKA== 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:mime-version :content-transfer-encoding; bh=Z1V88FwuMlgKnS9hRtkLeDXA8Vs2jJqcH4PEusY0mo0=; b=AkPng5a3/9yj/ftUlee6+3zryxD2VliJHrPkLUAnOIRG8x2uW4jW6YX+m2luP/CJts tpAf6tm/6bqHVm1saRlJjPJYoWK58s6L5rcgj//lsBzWzYvu1uHqCMaFQnh/hlukiUW2 cIkqQHCPj6AhYDFVFV4bRfVhLXcGyYVnfRL0/VKz84RUWDExuSNjeyj6kL3apeN5cX3o hCPl+IGite51231lLwaJAMQZPjJ/Jpa9sJWdQYoXhrt52RtSbcrG7lGwQBwvzrLQj6mI J0xuARKrhgrWc4GHubKPvDsz6H/85QWBRL7WCYQwtGvnC4zXnjMNYXXJ4oKSSyB+O9+2 EGtg== X-Gm-Message-State: AOAM532GTFnNjuJyag9nkiboBLOg+YNErP9AX+9MYKLgLc8j6rGW6gA/ Vmy+8oeZfb+4gMJzGHPhQlCaSkgPVp8ctw== X-Google-Smtp-Source: ABdhPJx/WKUUur7Jtkf7IF+MXYIB3vdiE4h+/5UuWMRLnRThLGcNiFCzI6CRDXoErNbbeIG22Pz3Tw== X-Received: by 2002:a05:600c:22d7:: with SMTP id 23mr4843236wmg.61.1606228890354; Tue, 24 Nov 2020 06:41:30 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id 90sm26453232wrl.60.2020.11.24.06.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 06:41:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Nov 2020 15:41:19 +0100 Message-Id: <20201124144122.1994769-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/mpeg12enc: Always initialize MPEG-2 intra VLC table lengths 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" The MPEG-1/2 encoders initialize several tables once during the first time one of the encoders is initialized; the table for MPEG-2 intra VLC lengths is only initialized if it is used for this encoder instance. This implies that if the first MPEG-1/2 encoder to be initialized does not use it, it will never be initialized even if a later encoder instance makes use of them. Fix this by initializing this table unconditionally. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12enc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 46c3424de9..eee4af0adc 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1055,7 +1055,6 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s) } init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); - if (s->intra_vlc_format) init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */