From patchwork Mon Jul 1 17:08:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 50258 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp1947846vqv; Mon, 1 Jul 2024 10:08:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWTqTqGsT63JL9GF95anq0Wbvd7WW8WsjOoDupaM759PY3XBEqvjoGqU4EUTeYxIuXOqOqCn7st/91W1AlOOjP3zgX8gh1j0B6Ghg== X-Google-Smtp-Source: AGHT+IGqY76RCUCq2PmvjDTf85bNRXrkzFPfH/f1iAXqhU1UUylZQRlBKj1clJBvgzzaiTmzzxu1 X-Received: by 2002:a2e:a80c:0:b0:2ee:6254:f9f1 with SMTP id 38308e7fff4ca-2ee6254fb37mr48284231fa.6.1719853699187; Mon, 01 Jul 2024 10:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719853699; cv=none; d=google.com; s=arc-20160816; b=E9/GAqxNAQRgUrwFdk5iTDsZuleJWHCSj+W+nQpR9x1sPD18Y+5bMuZ+QKX2abRrpO 6RnSrw4wqCjLRvXEr2Sbs5c8KnGHz4rkBtEoqaxzSsu6KnF04LTzw3tWoe+grWO6et7c faMioEy4Fx8PvAx9X+gAZY4MtLAOQNOBIGWxZfojmZ6jp8Tx2P1LDZlU9Aq86Q4Gh4Zk pzDIRLh50kh1L4LTEM48quZVqvUUMXGPtxg3O+amb1VT02vR4dhYa9IMgzI6V9sBsiMa 5sUXgFu4ZtWaeIB31Ijd9DduLG6O11tF0UiViorrY16ueXAwd7gKMmgmGD3X9myrYryu agVA== 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=5a6xoAruAzECWvFUBpnxmY7zgESFbYlL978LHv2qXP4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=jjPmShJe7oEOXuV9Ka0Fkh00gjRWvNXJ77POdJW2u9SLcAVKUG7RULrqSlEDAbraEC o79YwMjb66/pKc0PTOdYPqx6fFlqR5bHrlSSXCDfykF45ZUoy6QFUyui8qc0kQdnVFcl HD/cRRwUSXYIuvhCXZeNW68+KFGza+cJp13+eG6P5SDkgFQTh2Acnzp6AsgbzcG6+tQY TNw11Au/9rLN5sKandBG6gpEdjoXksHQ60/ogVd/P7dmnRnpkd8w1T0PCLTXz/s0GuOi mLhkDq7PF/eCEp4XsYwLWgZ4OizMMDee6ptoQOmzYVZm8c5Wn6yOhEv/D7kCLB4sPPBP pPDQ==; dara=google.com 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 4fb4d7f45d1cf-58615179e8asi3813095a12.489.2024.07.01.10.08.18; Mon, 01 Jul 2024 10:08:19 -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 B8B4668D800; Mon, 1 Jul 2024 20:08:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D3A668D6E7 for ; Mon, 1 Jul 2024 20:08:08 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 93093C0140 for ; Mon, 1 Jul 2024 20:08:07 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 1 Jul 2024 20:08:04 +0300 Message-ID: <20240701170807.107018-1-remi@remlab.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [RFC] [PATCH 1/4] lavc/h264_loopfilter: expose tc0_table (for checkasm) 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: e4h1JUiLf22M --- libavcodec/h264_loopfilter.c | 50 ++++++++++++++++++------------------ libavcodec/h264dsp.h | 2 ++ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index c164a289b7..9481882dd0 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -66,7 +66,7 @@ static const uint8_t beta_table[52*3] = { 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, }; -static const uint8_t tc0_table[52*3][4] = { +const int8_t ff_h264_tc0_table[52*3][4] = { {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, @@ -109,10 +109,10 @@ static av_always_inline void filter_mb_edgev(uint8_t *pix, int stride, if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0]]; - tc[1] = tc0_table[index_a][bS[1]]; - tc[2] = tc0_table[index_a][bS[2]]; - tc[3] = tc0_table[index_a][bS[3]]; + tc[0] = ff_h264_tc0_table[index_a][bS[0]]; + tc[1] = ff_h264_tc0_table[index_a][bS[1]]; + tc[2] = ff_h264_tc0_table[index_a][bS[2]]; + tc[3] = ff_h264_tc0_table[index_a][bS[3]]; h->h264dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta); @@ -131,10 +131,10 @@ static av_always_inline void filter_mb_edgecv(uint8_t *pix, int stride, if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0]]+1; - tc[1] = tc0_table[index_a][bS[1]]+1; - tc[2] = tc0_table[index_a][bS[2]]+1; - tc[3] = tc0_table[index_a][bS[3]]+1; + tc[0] = ff_h264_tc0_table[index_a][bS[0]]+1; + tc[1] = ff_h264_tc0_table[index_a][bS[1]]+1; + tc[2] = ff_h264_tc0_table[index_a][bS[2]]+1; + tc[3] = ff_h264_tc0_table[index_a][bS[3]]+1; h->h264dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta); @@ -154,10 +154,10 @@ static av_always_inline void filter_mb_mbaff_edgev(const H264Context *h, uint8_t if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0*bsi]]; - tc[1] = tc0_table[index_a][bS[1*bsi]]; - tc[2] = tc0_table[index_a][bS[2*bsi]]; - tc[3] = tc0_table[index_a][bS[3*bsi]]; + tc[0] = ff_h264_tc0_table[index_a][bS[0*bsi]]; + tc[1] = ff_h264_tc0_table[index_a][bS[1*bsi]]; + tc[2] = ff_h264_tc0_table[index_a][bS[2*bsi]]; + tc[3] = ff_h264_tc0_table[index_a][bS[3*bsi]]; h->h264dsp.h264_h_loop_filter_luma_mbaff(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_luma_mbaff_intra(pix, stride, alpha, beta); @@ -177,10 +177,10 @@ static av_always_inline void filter_mb_mbaff_edgecv(const H264Context *h, if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0*bsi]] + 1; - tc[1] = tc0_table[index_a][bS[1*bsi]] + 1; - tc[2] = tc0_table[index_a][bS[2*bsi]] + 1; - tc[3] = tc0_table[index_a][bS[3*bsi]] + 1; + tc[0] = ff_h264_tc0_table[index_a][bS[0*bsi]] + 1; + tc[1] = ff_h264_tc0_table[index_a][bS[1*bsi]] + 1; + tc[2] = ff_h264_tc0_table[index_a][bS[2*bsi]] + 1; + tc[3] = ff_h264_tc0_table[index_a][bS[3*bsi]] + 1; h->h264dsp.h264_h_loop_filter_chroma_mbaff(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_chroma_mbaff_intra(pix, stride, alpha, beta); @@ -199,10 +199,10 @@ static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride, if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0]]; - tc[1] = tc0_table[index_a][bS[1]]; - tc[2] = tc0_table[index_a][bS[2]]; - tc[3] = tc0_table[index_a][bS[3]]; + tc[0] = ff_h264_tc0_table[index_a][bS[0]]; + tc[1] = ff_h264_tc0_table[index_a][bS[1]]; + tc[2] = ff_h264_tc0_table[index_a][bS[2]]; + tc[3] = ff_h264_tc0_table[index_a][bS[3]]; h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta); @@ -221,10 +221,10 @@ static av_always_inline void filter_mb_edgech(uint8_t *pix, int stride, if( bS[0] < 4 || !intra ) { int8_t tc[4]; - tc[0] = tc0_table[index_a][bS[0]]+1; - tc[1] = tc0_table[index_a][bS[1]]+1; - tc[2] = tc0_table[index_a][bS[2]]+1; - tc[3] = tc0_table[index_a][bS[3]]+1; + tc[0] = ff_h264_tc0_table[index_a][bS[0]]+1; + tc[1] = ff_h264_tc0_table[index_a][bS[1]]+1; + tc[2] = ff_h264_tc0_table[index_a][bS[2]]+1; + tc[3] = ff_h264_tc0_table[index_a][bS[3]]+1; h->h264dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta); diff --git a/libavcodec/h264dsp.h b/libavcodec/h264dsp.h index 4a9cb1568d..13371c59ea 100644 --- a/libavcodec/h264dsp.h +++ b/libavcodec/h264dsp.h @@ -117,6 +117,8 @@ typedef struct H264DSPContext { int (*startcode_find_candidate)(const uint8_t *buf, int size); } H264DSPContext; +extern const int8_t ff_h264_tc0_table[][4]; + void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc); void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,