From patchwork Fri Nov 20 07:32:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23875 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 089B2449167 for ; Fri, 20 Nov 2020 09:49:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 82F7D68BCEE; Fri, 20 Nov 2020 09:34:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B8A068BCE6 for ; Fri, 20 Nov 2020 09:34:30 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id f20so11519125ejz.4 for ; Thu, 19 Nov 2020 23:34:30 -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:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=nmc2UDwcOY+nOEmyMt8RAi5JykEHakFu6blHazAidt8=; b=IaXdt25xhzy6SO7F2qxxEwHC+FiCODfqqO9Iabjpm7OC6kB7d74h/AFCJAtEUZtcui i5G22SEtGF9cIJ8CLLWvHqcaLrmRG9WmewxvKUf/FpR8nrM4cpix1R3iMYJhEa+i2SVs sOjGepynzO3H2ZtU0di4BpznaOM9bTulkleJ6HCYlM4d0O7jL1dsF4fFT0lDcePHn15J dE6fJ0KpMsI+NLGi87qWl9jBa3CH8un8UdYrF+BJnSr4/jZpSABn/Bvzp3tJ3CZcjRSo GshI3NsArzH4ZzMlViaYHPZKLTYw5D4RhXcwVKDS/mSlAOXFQIX2DDTAY+Oh7jUMxhXm F/yg== 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:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=nmc2UDwcOY+nOEmyMt8RAi5JykEHakFu6blHazAidt8=; b=Ya+tXwR1etBjTGwubP87tQhGtkWGeC9lTiWeFPdJiMVcHBK2la9vPhXaW/iz1nPnCo LEEc0Z0luEJMGEh+/cOo0APQEFotRunhVDJveQ46HYwNC6P6S6TsJNKInXgysILMhAm8 TUclpc1AbCFIqBUwwydedD6SM2eSW8YO3vMxrnHdKIbpRLOVtHeM3ciW/tRU02IgBd1n gI9IRMo/mYqUKf6b840GekA5lqc8jUZkato3rbT/QVazgHA2i1QnRm79WsM3ERlJqlH2 N+3A7gRO+vtVSU3cB5InnPb2P0PPgi7NUuyEKetQrS1kZ1UNymEIyj8jsP6cZcl0s7n/ DgnA== X-Gm-Message-State: AOAM5328dbrx20CHZSF7POg7ZcMOEF7azLogrrUL2UejRdARIl3BS8JH QHjGFiU+QRawkoXow+mqF5hGZ0f/2p5wBw== X-Google-Smtp-Source: ABdhPJyytNIP5G/aHgS07uwomu4qhy/zeDVOFP8SfoFmgbHKVz4JlyljfFEqFgD1GCbLVUmoys7zNw== X-Received: by 2002:a17:906:4bcb:: with SMTP id x11mr30939863ejv.538.1605857669776; Thu, 19 Nov 2020 23:34:29 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:51 +0100 Message-Id: <20201120073327.820745-27-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> References: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 126/162] avcodec/intrax8: Replace always-false check by assert 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/intrax8.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index f385423dc1..390c10272e 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -46,7 +46,7 @@ static VLC j_ac_vlc[2][2][8]; // [quant < 13], [intra / inter], [select] static VLC j_dc_vlc[2][8]; // [quant], [select] static VLC j_orient_vlc[2][4]; // [quant], [select] -static av_cold int x8_vlc_init(void) +static av_cold void x8_vlc_init(void) { int i; int offset = 0; @@ -115,13 +115,7 @@ static av_cold int x8_vlc_init(void) init_or_vlc(j_orient_vlc[1][i], x8_orient_lowquant_table[i][0]); #undef init_or_vlc - if (offset != sizeof(table) / sizeof(VLC_TYPE) / 2) { - av_log(NULL, AV_LOG_ERROR, "table size %"SIZE_SPECIFIER" does not match needed %i\n", - sizeof(table) / sizeof(VLC_TYPE) / 2, offset); - return AVERROR_INVALIDDATA; - } - - return 0; + av_assert2(offset == FF_ARRAY_ELEMS(table)); } static void x8_reset_vlc_tables(IntraX8Context *w) @@ -731,10 +725,6 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, int block_last_index[12], int mb_width, int mb_height) { - int ret = x8_vlc_init(); - if (ret < 0) - return ret; - w->avctx = avctx; w->idsp = *idsp; w->mb_width = mb_width; @@ -762,6 +752,8 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, ff_intrax8dsp_init(&w->dsp); ff_blockdsp_init(&w->bdsp, avctx); + x8_vlc_init(); + return 0; }