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 D4C1849D6F for ; Mon, 10 Jun 2024 11:41:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 49F4168D718; Mon, 10 Jun 2024 14:41:39 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 90FA068D5F9 for ; Mon, 10 Jun 2024 14:41:32 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EA98724000A for ; Mon, 10 Jun 2024 11:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718019692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JF92wLUgOz3alnUc9ZmQalTdUQH45/EOQQS4zqU1IfI=; b=cn4dCLut38zOGDYJYy6CZebziN65wGlXyCsdlv+Xdrb3V/JSbM6dSRLP/h+Vf37vU91QQc L7CwEq08TTkaqD5pVgnPiK/AEV65X/pzlPJfwc+VL3vewn6ZFmGb3lWlIsGHUmBIYeRmu8 Q7jLcaIhhfOLumCtyaODECTtkk5CLwP6eGJ/DvuI01P8YDtklIhX0uto3Orm1RwE+9qiIt kMjF8/siTPc3E65UNHcphOgKihKqLdcjAP2ugTTa0WXt/YpoEKzFKlCsO8PAaFbRyZF4ci JEFi4Mf6TsTzuhFKIi0YnUuCyDbu5SrSDQvb61NYb5eSwAwIXfG6oUIvQjYJ/A== Date: Mon, 10 Jun 2024 13:41:31 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240610114131.GB2821752@pb2> References: <20240609162347.2541907-1-remi@remlab.net> <20240609162347.2541907-2-remi@remlab.net> MIME-Version: 1.0 In-Reply-To: <20240609162347.2541907-2-remi@remlab.net> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/4] lavc/mpegvideo: use H263DSP dequant function 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 Content-Type: multipart/mixed; boundary="===============7516728198020186359==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7516728198020186359== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="odPpP5ru0JScGiDm" Content-Disposition: inline --odPpP5ru0JScGiDm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 09, 2024 at 07:23:45PM +0300, R=E9mi Denis-Courmont wrote: > --- > libavcodec/mpegvideo.c | 44 ++++++++++-------------------------------- > 1 file changed, 10 insertions(+), 34 deletions(-) >=20 > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c > index 7af823b8bd..9be0fecc8d 100644 > --- a/libavcodec/mpegvideo.c > +++ b/libavcodec/mpegvideo.c > @@ -201,13 +201,11 @@ static void dct_unquantize_mpeg2_inter_c(MpegEncCon= text *s, > static void dct_unquantize_h263_intra_c(MpegEncContext *s, > int16_t *block, int n, int qscale) > { > - int i, level, qmul, qadd; > - int nCoeffs; > + int qmul =3D qscale << 1; > + int qadd, nCoeffs; > =20 > av_assert2(s->block_last_index[n]>=3D0 || s->h263_aic); > =20 > - qmul =3D qscale << 1; > - > if (!s->h263_aic) { > block[0] *=3D n < 4 ? s->y_dc_scale : s->c_dc_scale; > qadd =3D (qscale - 1) | 1; > @@ -215,47 +213,24 @@ static void dct_unquantize_h263_intra_c(MpegEncCont= ext *s, > qadd =3D 0; > } > if(s->ac_pred) > - nCoeffs=3D63; > + nCoeffs =3D 64; > else > - nCoeffs=3D s->intra_scantable.raster_end[ s->block_last_index[n]= ]; > + nCoeffs =3D s->intra_scantable.raster_end[s->block_last_index[n]= ] + 1; > =20 > - for(i=3D1; i<=3DnCoeffs; i++) { > - level =3D block[i]; > - if (level) { > - if (level < 0) { > - level =3D level * qmul - qadd; > - } else { > - level =3D level * qmul + qadd; > - } > - block[i] =3D level; > - } > - } > + s->h263dsp.h263_dct_unquantize_intra(block, nCoeffs, qmul, qadd); > } > =20 > static void dct_unquantize_h263_inter_c(MpegEncContext *s, > int16_t *block, int n, int qscale) > { > - int i, level, qmul, qadd; > + int qmul =3D qscale << 1; > + int qadd =3D (qscale - 1) | 1; > int nCoeffs; > =20 > av_assert2(s->block_last_index[n]>=3D0); > =20 > - qadd =3D (qscale - 1) | 1; > - qmul =3D qscale << 1; > - > - nCoeffs=3D s->inter_scantable.raster_end[ s->block_last_index[n] ]; > - > - for(i=3D0; i<=3DnCoeffs; i++) { > - level =3D block[i]; > - if (level) { > - if (level < 0) { > - level =3D level * qmul - qadd; > - } else { > - level =3D level * qmul + qadd; > - } > - block[i] =3D level; > - } > - } > + nCoeffs =3D s->inter_scantable.raster_end[s->block_last_index[n]] + = 1; > + s->h263dsp.h263_dct_unquantize_inter(block, nCoeffs, qmul, qadd); It would be better if the "+ 1" would not be needed and teh functions would keep using "<=3D" thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell --odPpP5ru0JScGiDm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZmbmYQAKCRBhHseHBAsP qzk+AJwKKlSjSJhwWIjmNU/IzRjwURnMxgCfdhxp70xizmdSEik21oaG5+0+/n4= =IGsv -----END PGP SIGNATURE----- --odPpP5ru0JScGiDm-- --===============7516728198020186359== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7516728198020186359==--