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 431B24780D for ; Mon, 23 Oct 2023 16:39:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F385E68C9B8; Mon, 23 Oct 2023 19:38:57 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7E1E68C825 for ; Mon, 23 Oct 2023 19:38:50 +0300 (EEST) Received: from 381ffcaa0aae670d3ff23e2d15497aef ([1.145.252.210]) (authenticated (0 bits)) by mx.sdf.org (8.16.1/8.14.5) with ESMTPSA id 39NGcXPo027193 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Mon, 23 Oct 2023 16:38:47 GMT Date: Tue, 24 Oct 2023 03:38:29 +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> <169805609212.23937.3884949016595644745@lain.khirnov.net> MIME-Version: 1.0 In-Reply-To: <169805609212.23937.3884949016595644745@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="===============7892473931853037620==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7892473931853037620== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o/wCU09MFeukNx+S" Content-Disposition: inline --o/wCU09MFeukNx+S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 23, 2023 at 12:14:52PM +0200, Anton Khirnov wrote: > Quoting Peter Ross (2023-10-22 01:31:32) > > 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 bel= ow. > >=20 > > many thanks anton for these suggestions. i agree with all of them. > >=20 > > > > + 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? > >=20 > > 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. >=20 > Typically the timestamps come from the container, so the decoder merely > copies them from packet to frame. Does the container not provide valid > timestamps here? the container (rm) does not provide meaningful pts, even though there b-frames are present in the stream. should this fixup be done in a bitstream filter? rv30/rv40 also uses rm container and suffers this problem. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --o/wCU09MFeukNx+S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCZTahgQAKCRBnYHnFrEDd ayn/AKCW9evtYLHDySCTqiSgxfwRGUq50gCgjh3akAs7hM5ICylWP9QArdTZqx4= =R3we -----END PGP SIGNATURE----- --o/wCU09MFeukNx+S-- --===============7892473931853037620== 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". --===============7892473931853037620==--