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 5ABA944D6B for ; Sat, 21 Oct 2023 23:32:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 29CB568CA46; Sun, 22 Oct 2023 02:32:06 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD07568C603 for ; Sun, 22 Oct 2023 02:31:59 +0300 (EEST) Received: from 381ffcaa0aae670d3ff23e2d15497aef ([1.145.251.193]) (authenticated (0 bits)) by mx.sdf.org (8.16.1/8.14.5) with ESMTPSA id 39LNVfDR019616 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sat, 21 Oct 2023 23:31:56 GMT Date: Sun, 22 Oct 2023 10:31:32 +1100 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <04cb126b825dc1e39c3b4140af8813ddfd03dfdb.1697615459.git.pross@xvid.org> <7504e36707a4deaddc61e489839637137f7db7e5.1697615459.git.pross@xvid.org> <169764012197.32606.9720568022455222835@lain.khirnov.net> MIME-Version: 1.0 In-Reply-To: <169764012197.32606.9720568022455222835@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/rv60: RealVideo 6.0 decoder 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="===============1002140994868626000==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1002140994868626000== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cu4m9GDuKvRogjky" Content-Disposition: inline --Cu4m9GDuKvRogjky Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 18, 2023 at 04:42:01PM +0200, Anton Khirnov wrote: > Quoting Peter Ross (2023-10-18 10:03:54) [..] > I think you can simplify this into: > if (s->last_frame[NEXT_PIC]->data[0]) { > av_frame_move_ref(frame, s->last_frame[NEXT_PIC]); > *got_frame =3D 1; > } [..] > You just unreffed the frame above, what is the point of using > reget_buffer()? [..] > The generic code should be doing this already. [..] > You could change this into av_frame_move_ref() and drop the unref below. many thanks anton for these suggestions. i agree with all of them. > > + if (s->pict_type !=3D AV_PICTURE_TYPE_B) { > > + s->ref_pts[0] =3D s->ref_pts[1]; > > + s->ref_pts[1] =3D avpkt->pts; > > + > > + s->ref_ts[0] =3D s->ref_ts[1]; > > + s->ref_ts[1] =3D s->ts; > > + > > + if (s->ref_pts[1] > s->ref_pts[0] && s->ref_ts[1] > s->ref_ts[= 0]) > > + s->ts_scale =3D (s->ref_pts[1] - s->ref_pts[0]) / (s->ref_= ts[1] - s->ref_ts[0]); > > + } else { > > + frame->pts =3D s->ref_pts[0] + (s->ts - s->ref_ts[0]) * s->ts_= scale; >=20 > This looks immensely evil. Isn't ff_get_buffer() already setting the > timestamps correctly? no ff_reget_buffer() does not set pts correctly. the ref_ts ('s->ts') value is sent with every rv60 in the header, and is used to calculate the pts value. unsure how to make this less evil. cheers, -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --Cu4m9GDuKvRogjky Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCZTRfUQAKCRBnYHnFrEDd a8ZrAJ4vyQGCzB+uz/69FrQNbnsMMY5DTgCeI+REy4t1z2e2Kls4FiRCfI064ac= =U54E -----END PGP SIGNATURE----- --Cu4m9GDuKvRogjky-- --===============1002140994868626000== 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". --===============1002140994868626000==--