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 5C6534A47B for ; Tue, 30 Apr 2024 18:57:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B53C68D618; Tue, 30 Apr 2024 21:57:51 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C60768CA55 for ; Tue, 30 Apr 2024 21:57:44 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A5EEAE0002 for ; Tue, 30 Apr 2024 18:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714503463; 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=AKezkqXRF2YrxlK6tl1CycZo2QKgWldbaB4rNS+5La8=; b=CSReItILWnLB/cQoowGPYeeX5AaV/7rCkQtza6qd6VyYhdue/zmKti9q7Ve54t8UW2BQDM P1uOtnFOoAVlXDshW0kcbvavXUSA3+SLKIEJX3Zn3wbOXuEHpXjnhATAjVh5HmP9L+OleR m64icx07JDOD3xjfzcWz3phC7nSvXkJl9TPQy7Xy7nH3WxRH0mqE0kWVui8fLedPB1WaGj ogOCNYo8ypDjhcyZoQxaFtbv6wWdGxkrSc2ukcyxdPUAewQgenojM6N+06HTHiEV2K2I08 kAYpYYvEPiFR47s0DCACE7gGPbLERGb/WC9vF9rGs0dAeQXUIz9Hr9yyTZwFUg== Date: Tue, 30 Apr 2024 20:57:42 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240430185742.GR6420@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 31/57] avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary Pic 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="===============3086388200175726619==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3086388200175726619== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gpR4EhI1z2cn2sYS" Content-Disposition: inline --gpR4EhI1z2cn2sYS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2024 at 11:14:12PM +0200, Andreas Rheinhardt wrote: > There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic) > that are directly part of MpegEncContext and an array of MPVPictures > that are separately allocated and are mostly accessed via pointers > (cur|last|next)_pic_ptr; they are also used to store AVFrames in the > encoder (necessary due to B-frames). As the name implies, each of the > former is directly associated with one of the _ptr pointers: > They actually share the same underlying buffers, but the ones > that are part of the context can have their data pointers offset > and their linesize doubled for field pictures. >=20 > Up until now, each of these had their own references; in particular, > there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr > etc. This is wasteful. >=20 > This commit changes this relationship: cur_pic, last_pic and next_pic > now become MPVWorkPictures; this structure does not have an AVFrame > at all any more, but only the cached values of data and linesize. > It also contains a pointer to the corresponding MPVPicture, establishing > a more natural relationsship between the two. > This already means that creating the context-pictures from the pointers > can no longer fail. >=20 > What has not been changed is the fact that the MPVPicture* pointers > are not ownership pointers and that the MPVPictures are part of an > array of MPVPictures that is owned by a single AVCodecContext. > Doing so will be done in a latter commit. >=20 > Signed-off-by: Andreas Rheinhardt segfaults [vc1 @ 0xa0c81c0] Failed to open codec in avformat_find_stream_info =3D=3D840294=3D=3D Invalid read of size 4 =3D=3D840294=3D=3D at 0xDB91F4: ff_vc1_mc_4mv_chroma4 (vc1_mc.c:893) =3D=3D840294=3D=3D by 0xDA4FD8: vc1_decode_p_mb_intfr (vc1_block.c:1661) =3D=3D840294=3D=3D by 0xDAD9CD: vc1_decode_p_blocks (vc1_block.c:2831) =3D=3D840294=3D=3D by 0xDAE6A4: ff_vc1_decode_blocks (vc1_block.c:2996) =3D=3D840294=3D=3D by 0xDC5EFB: vc1_decode_frame (vc1dec.c:1304) =3D=3D840294=3D=3D by 0x99B6D2: decode_simple_internal (decode.c:412) =3D=3D840294=3D=3D by 0x99BBFB: decode_simple_receive_frame (decode.c:58= 2) =3D=3D840294=3D=3D by 0x99BD7F: decode_receive_frame_internal (decode.c:= 611) =3D=3D840294=3D=3D by 0x99C135: avcodec_send_packet (decode.c:702) =3D=3D840294=3D=3D by 0x66BE65: try_decode_frame (demux.c:2156) =3D=3D840294=3D=3D by 0x66EB84: avformat_find_stream_info (demux.c:2840) =3D=3D840294=3D=3D by 0x24F991: ifile_open (ffmpeg_demux.c:1707) =3D=3D840294=3D=3D by 0x278387: open_files (ffmpeg_opt.c:1206) =3D=3D840294=3D=3D by 0x27854A: ffmpeg_parse_options (ffmpeg_opt.c:1246) =3D=3D840294=3D=3D by 0x28CBF7: main (ffmpeg.c:941) =3D=3D840294=3D=3D Address 0x9c is not stack'd, malloc'd or (recently) fre= e'd [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Some people wanted to paint the bikeshed green, some blue and some pink. People argued and fought, when they finally agreed, only rust was left. --gpR4EhI1z2cn2sYS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZjE/HAAKCRBhHseHBAsP qyLDAJ9xWxf0UM+XNjv0rNKR1xdRjSvHtgCeLJ9rqQCe+gbIj35fEq8CXZLrZ6k= =jFUH -----END PGP SIGNATURE----- --gpR4EhI1z2cn2sYS-- --===============3086388200175726619== 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". --===============3086388200175726619==--