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 82A4848622 for ; Tue, 12 Dec 2023 06:57:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 67E0968D18D; Tue, 12 Dec 2023 08:57:02 +0200 (EET) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9A3468D174 for ; Tue, 12 Dec 2023 08:56:55 +0200 (EET) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3333a3a599fso3344381f8f.0 for ; Mon, 11 Dec 2023 22:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702364214; x=1702969014; darn=ffmpeg.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=R5S1QxCMPa0/48LRXFZ9FzUamF/EjwSkYK6wwf6daLs=; b=SRqiVnqirAmO1pRM/7ailDbiIsjJNj1b4tCsTlyog1Q/hCjh0N3b4YPxyNdto07tRM dujQv6eiPHGggNNE0TJ4o8Se0yZ2W8ARRqLs5XTbpoWPbJNfiTc+AWtL6hEiqphkM+rZ CRGJwiu5xkKqgoyhq0Tr0RR2TO9oEZk7EFflbKnqeg/D4bvQJot80Cfj+Qu78GyWtk9h Rox3YwIkvaw7IFM1bBwOLNMtBYWBfsXIwvfTuHdlEaXkS2b8njOUzfSuvN0riiDQQUxK vTp7vAsBwDTj/RKRXE8PWgPuoZD/TE2dLIolPqVjrYH4UwFIEDambmHByCWkp/HVlSFd /Lcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702364214; x=1702969014; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R5S1QxCMPa0/48LRXFZ9FzUamF/EjwSkYK6wwf6daLs=; b=IRfz+CBqvutQ1gosAilA98++7dDzc83xMsRiXfNv6slbdWikJuaj7g0iWWNc3YTI52 8WNkv3bSS1XJS+poBnW6+K/CHe2gXCBMlsXFIMq64SoCwYyoIpjcdnjCkVrl/d43payY 8THJWyWHzydYdzjIq+GidLO8TgS4hIUHV5c93vDiL5tWh0hvvXosTaqILrH20/Qp/AH8 nSyCa5zis0DHc7yfMUokxctcVpCX0jDQxgylEco0yormYEXpSrdwwbiYAr5Kk/a4opJy EULHNrGy2zvbG1bp1Poy6HJiUaqQ7q3tMogadLuYRx4k4MoiGJwKuPmnA1z+FbeY6Ca4 Z83Q== X-Gm-Message-State: AOJu0YyqPgcPHPOSU7xsAKKnEW154ma0pZDbEAwngzgECqg2nu8UsSAx zeirFO7tDzhKCmJPvIV3ZDOJMQnYgkg= X-Google-Smtp-Source: AGHT+IGMa/ar+WR5TBPh9TjKfAQ1Yr4G0TKhLDqZ8KtU0sPaW2o6UW3MUNu5cdFvSC0RaB2nADtbSg== X-Received: by 2002:a05:600c:19c9:b0:40b:51c7:7ad7 with SMTP id u9-20020a05600c19c900b0040b51c77ad7mr3402804wmq.18.1702364214168; Mon, 11 Dec 2023 22:56:54 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id w6-20020a5d6806000000b00336103442d2sm8709317wru.76.2023.12.11.22.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 22:56:53 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 0FDC9BFCDA; Tue, 12 Dec 2023 07:56:52 +0100 (CET) Date: Tue, 12 Dec 2023 07:56:52 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , =?iso-8859-15?Q?Cl=E9ment_B=BDsch?= References: <20231211014429.1841681-1-u@pkh.me> <20231211014429.1841681-3-u@pkh.me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231211014429.1841681-3-u@pkh.me> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 02/35] avcodec/proresenc_kostya: remove unused plane factor variables 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: =?iso-8859-15?Q?Cl=E9ment_B=BDsch?= Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Monday 2023-12-11 02:35:03 +0100, Cl=E9ment B=BDsch wrote: > --- > libavcodec/proresenc_kostya.c | 36 ++++++++++++----------------------- > 1 file changed, 12 insertions(+), 24 deletions(-) > = > diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c > index 58fc340879..7aed3974c3 100644 > --- a/libavcodec/proresenc_kostya.c > +++ b/libavcodec/proresenc_kostya.c > @@ -459,7 +459,6 @@ static void encode_dcs(PutBitContext *pb, int16_t *bl= ocks, > = > static void encode_acs(PutBitContext *pb, int16_t *blocks, > int blocks_per_slice, > - int plane_size_factor, > const uint8_t *scan, const int16_t *qmat) > { > int idx, i; > @@ -494,14 +493,13 @@ static void encode_acs(PutBitContext *pb, int16_t *= blocks, > static void encode_slice_plane(ProresContext *ctx, PutBitContext *pb, > const uint16_t *src, ptrdiff_t linesize, > int mbs_per_slice, int16_t *blocks, > - int blocks_per_mb, int plane_size_factor, > + int blocks_per_mb, > const int16_t *qmat) > { > int blocks_per_slice =3D mbs_per_slice * blocks_per_mb; > = > encode_dcs(pb, blocks, blocks_per_slice, qmat[0]); > - encode_acs(pb, blocks, blocks_per_slice, plane_size_factor, > - ctx->scantable, qmat); > + encode_acs(pb, blocks, blocks_per_slice, ctx->scantable, qmat); > } > = > static void put_alpha_diff(PutBitContext *pb, int cur, int prev, int abi= ts) > @@ -575,10 +573,9 @@ static int encode_slice(AVCodecContext *avctx, const= AVFrame *pic, > int i, xp, yp; > int total_size =3D 0; > const uint16_t *src; > - int slice_width_factor =3D av_log2(mbs_per_slice); > int num_cblocks, pwidth, line_add; > ptrdiff_t linesize; > - int plane_factor, is_chroma; > + int is_chroma; > uint16_t *qmat; > uint16_t *qmat_chroma; > = > @@ -604,9 +601,6 @@ static int encode_slice(AVCodecContext *avctx, const = AVFrame *pic, > = > for (i =3D 0; i < ctx->num_planes; i++) { > is_chroma =3D (i =3D=3D 1 || i =3D=3D 2); > - plane_factor =3D slice_width_factor + 2; > - if (is_chroma) > - plane_factor +=3D ctx->chroma_factor - 3; > if (!is_chroma || ctx->chroma_factor =3D=3D CFACTOR_Y444) { > xp =3D x << 4; > yp =3D y << 4; > @@ -631,11 +625,11 @@ static int encode_slice(AVCodecContext *avctx, cons= t AVFrame *pic, > if (!is_chroma) {/* luma quant */ > encode_slice_plane(ctx, pb, src, linesize, > mbs_per_slice, ctx->blocks[0], > - num_cblocks, plane_factor, qmat); > + num_cblocks, qmat); > } else { /* chroma plane */ > encode_slice_plane(ctx, pb, src, linesize, > mbs_per_slice, ctx->blocks[0], > - num_cblocks, plane_factor, qmat_chrom= a); > + num_cblocks, qmat_chroma); > } > } else { > get_alpha_data(ctx, src, linesize, xp, yp, > @@ -704,7 +698,6 @@ static int estimate_dcs(int *error, int16_t *blocks, = int blocks_per_slice, > } > = > static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slic= e, > - int plane_size_factor, > const uint8_t *scan, const int16_t *qmat) > { > int idx, i; > @@ -742,7 +735,7 @@ static int estimate_acs(int *error, int16_t *blocks, = int blocks_per_slice, > static int estimate_slice_plane(ProresContext *ctx, int *error, int plan= e, > const uint16_t *src, ptrdiff_t linesize, > int mbs_per_slice, > - int blocks_per_mb, int plane_size_factor, > + int blocks_per_mb, > const int16_t *qmat, ProresThreadData *t= d) > { > int blocks_per_slice; > @@ -751,8 +744,7 @@ static int estimate_slice_plane(ProresContext *ctx, i= nt *error, int plane, > blocks_per_slice =3D mbs_per_slice * blocks_per_mb; > = > bits =3D estimate_dcs(error, td->blocks[plane], blocks_per_slice, q= mat[0]); > - bits +=3D estimate_acs(error, td->blocks[plane], blocks_per_slice, > - plane_size_factor, ctx->scantable, qmat); > + bits +=3D estimate_acs(error, td->blocks[plane], blocks_per_slice, c= tx->scantable, qmat); > = > return FFALIGN(bits, 8); > } > @@ -821,9 +813,8 @@ static int find_slice_quant(AVCodecContext *avctx, > ProresContext *ctx =3D avctx->priv_data; > int i, q, pq, xp, yp; > const uint16_t *src; > - int slice_width_factor =3D av_log2(mbs_per_slice); > int num_cblocks[MAX_PLANES], pwidth; > - int plane_factor[MAX_PLANES], is_chroma[MAX_PLANES]; > + int is_chroma[MAX_PLANES]; > const int min_quant =3D ctx->profile_info->min_quant; > const int max_quant =3D ctx->profile_info->max_quant; > int error, bits, bits_limit; > @@ -843,9 +834,6 @@ static int find_slice_quant(AVCodecContext *avctx, > = > for (i =3D 0; i < ctx->num_planes; i++) { > is_chroma[i] =3D (i =3D=3D 1 || i =3D=3D 2); > - plane_factor[i] =3D slice_width_factor + 2; > - if (is_chroma[i]) > - plane_factor[i] +=3D ctx->chroma_factor - 3; > if (!is_chroma[i] || ctx->chroma_factor =3D=3D CFACTOR_Y444) { > xp =3D x << 4; > yp =3D y << 4; > @@ -889,13 +877,13 @@ static int find_slice_quant(AVCodecContext *avctx, > bits +=3D estimate_slice_plane(ctx, &error, 0, > src, linesize[0], > mbs_per_slice, > - num_cblocks[0], plane_factor[0], > + num_cblocks[0], > ctx->quants[q], td); /* estimate lu= ma plane */ > for (i =3D 1; i < ctx->num_planes - !!ctx->alpha_bits; i++) { /*= estimate chroma plane */ > bits +=3D estimate_slice_plane(ctx, &error, i, > src, linesize[i], > mbs_per_slice, > - num_cblocks[i], plane_factor[i], > + num_cblocks[i], > ctx->quants_chroma[q], td); > } > if (bits > 65000 * 8) > @@ -926,13 +914,13 @@ static int find_slice_quant(AVCodecContext *avctx, > bits +=3D estimate_slice_plane(ctx, &error, 0, > src, linesize[0], > mbs_per_slice, > - num_cblocks[0], plane_factor[0], > + num_cblocks[0], > qmat, td);/* estimate luma plan= e */ > for (i =3D 1; i < ctx->num_planes - !!ctx->alpha_bits; i++) = { /* estimate chroma plane */ > bits +=3D estimate_slice_plane(ctx, &error, i, > src, linesize[i], > mbs_per_slice, > - num_cblocks[i], plane_facto= r[i], > + num_cblocks[i], > qmat_chroma, td); LGTM. _______________________________________________ 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".