From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 594534E216 for ; Sat, 7 Jun 2025 18:01:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id BA94B68C109; Sat, 7 Jun 2025 21:01:42 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 05E2568BE4A for ; Sat, 7 Jun 2025 21:01:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 50AC444304 for ; Sat, 7 Jun 2025 18:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1749319295; 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=sIARID+Y3qBCqNGd8+4Yg/4Zgc6myfkzWc8Qqev9Q5Q=; b=Iq/8cwRBytmFj3aEgTgWxM/HvwSG7h9sZyTCi9k/iSfK3nW3WmaCNego+CdzLJBDgSjAcL 3LEzOwCayaOS55/gdGvJq2RykbDypFbgHO4eOwOO4Vdrtxf5dSNPL7XOp+vGMmtRUp57ix CEUD7bz3v+KFW6MCCQ7mvdEjuzdmN8BJXFMKNl8yuHQ7UNIf/EnCh1bN+dyBEFWQIBzUjs mmHya0BO8QQFHkYu01V97j8Ij/h2ioeOZUTwgrcgf8cHJ0oVTJ3jDvvh9ktLkwbbJoAUbP lOr8zA2eZ4U8iMkTtGwuV6JSZ2xB8kwMgubPnjRkAVUCe8dHwyODP5zpKM0UTw== Date: Sat, 7 Jun 2025 20:01:34 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250607180134.GI29660@pb2> References: <20250518122639.2958966-1-michael@niedermayer.cc> <20250518195116.GG29660@pb2> MIME-Version: 1.0 In-Reply-To: <20250518195116.GG29660@pb2> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdeikeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/framecrcenc: List types and checksums for for side data 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="===============4765074511956727443==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4765074511956727443== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="F189UyHGeeDOy5bN" Content-Disposition: inline --F189UyHGeeDOy5bN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 18, 2025 at 09:51:16PM +0200, Michael Niedermayer wrote: > Hi >=20 > On Sun, May 18, 2025 at 04:43:01PM +0200, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > This allows detecting changes and regressions in side data related co= de, same as what > > > framecrc does for before already for packet data itself. > > >=20 > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavformat/framecrcenc.c | 116 +- > > > tests/ref/fate/autorotate | 2 +- > > > tests/ref/fate/cover-art-mp3-id3v2-remux | 2 +- > > > tests/ref/fate/ffmpeg-bsf-input | 10 +- > > > tests/ref/fate/ffmpeg-spec-disposition | 2 +- > > > tests/ref/fate/force_key_frames-source | 784 ++++++------ > > > tests/ref/fate/force_key_frames-source-drop | 34 +- > > > tests/ref/fate/force_key_frames-source-dup | 1224 +++++++++--------= -- > > > tests/ref/fate/gapless-mp3 | 6 +- > > > tests/ref/fate/h264_redundant_pps-side_data | 2 +- > > > tests/ref/fate/id3v2-priv-remux | 2 +- > > > tests/ref/fate/matroska-hdr10-plus-remux | 2 +- > > > tests/ref/fate/matroska-ogg-opus-remux | 2 +- > > > tests/ref/fate/matroska-opus-remux | 2 +- > > > tests/ref/fate/matroska-vp8-alpha-remux | 14 +- > > > tests/ref/fate/mov-cover-image | 2 +- > > > tests/ref/fate/segment-mp4-to-ts | 250 ++-- > > > tests/ref/fate/shortest | 100 +- > > > tests/ref/fate/webm-hdr10-plus-remux | 2 +- > > > tests/ref/fate/webm-webvtt-remux | 24 +- > > > 20 files changed, 1346 insertions(+), 1236 deletions(-) > > >=20 > > > diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c > > > index 2ba20f3aab4..96c2a82eb2a 100644 > > > --- a/libavformat/framecrcenc.c > > > +++ b/libavformat/framecrcenc.c > > > @@ -21,8 +21,11 @@ > > > =20 > > > #include > > > =20 > > > +#include "config.h" > > > #include "libavutil/adler32.h" > > > #include "libavutil/avstring.h" > > > +#include "libavutil/intreadwrite.h" > > > +#include "libavutil/hdr_dynamic_metadata.h" > >=20 > > Use proper alphabetical ordering >=20 > Is there a inproper alphabetical ordering ? >=20 >=20 >=20 > [...] >=20 > >=20 > > > + const AVPacketSideData *const sd =3D &pkt->side_data[i]; > > > + const uint8_t *data =3D sd->data; > > > + uint32_t side_data_crc =3D 0; > > > + > > > + switch (sd->type) { > > > +#if HAVE_BIGENDIAN > > > + uint8_t bswap_buf[FFMAX3(sizeof(AVCPBProperties), > > > + sizeof(AVProducerReferenceT= ime), > > > + sizeof(AVDynamicHDRPlus))]; > > > + case AV_PKT_DATA_PALETTE: > > > + case AV_PKT_DATA_REPLAYGAIN: > > > + case AV_PKT_DATA_DISPLAYMATRIX: > > > + case AV_PKT_DATA_STEREO3D: > > > + case AV_PKT_DATA_AUDIO_SERVICE_TYPE: > > > + case AV_PKT_DATA_FALLBACK_TRACK: > > > + case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: > > > + case AV_PKT_DATA_SPHERICAL: > > > + case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: > > > + case AV_PKT_DATA_S12M_TIMECODE: > > > + for (size_t j =3D 0; j < sd->size / 4; j++) { > > > + uint8_t buf[4]; > > > + AV_WL32(buf, AV_RB32(sd->data + 4 * j)); > > > + side_data_crc =3D av_adler32_update(side_data_cr= c, buf, 4); > > > + } > > > + break; > > > + case AV_PKT_DATA_CPB_PROPERTIES: > > > +#define BSWAP(struct, field) bswap(bswap_buf, offsetof(struct, field= ), sizeof(((struct){0}).field)) > > > +#define BSWAP_RAT(struct, field) do{BSWAP(struct, field.num); BSWAP(= struct, field.den);}while(0) > >=20 > > Missing spaces. >=20 > Ill try to find them and tell them to return, i hope they will pick the > right places, because iam not sure which are the right places >=20 >=20 > >=20 > > > + if (sd->size =3D=3D sizeof(AVCPBProperties)) { > > > + memcpy(bswap_buf, sd->data, sizeof(AVCPBProperti= es)); > > > + data =3D bswap_buf; > > > + BSWAP(AVCPBProperties, max_bitrate); > > > + BSWAP(AVCPBProperties, min_bitrate); > > > + BSWAP(AVCPBProperties, avg_bitrate); > > > + BSWAP(AVCPBProperties, buffer_size); > > > + BSWAP(AVCPBProperties, vbv_delay); > > > + } > > > + goto pod; > > > + case AV_PKT_DATA_PRFT: > > > + if (sd->size =3D=3D sizeof(AVProducerReferenceTime))= { > > > + memcpy(bswap_buf, sd->data, sizeof(AVProducerRef= erenceTime)); > > > + data =3D bswap_buf; > > > + BSWAP(AVProducerReferenceTime, wallclock); > > > + BSWAP(AVProducerReferenceTime, flags); > > > + } > > > + goto pod; > > > + case AV_PKT_DATA_DYNAMIC_HDR10_PLUS: > > > + if (sd->size =3D=3D sizeof(AVDynamicHDRPlus)) { > > > + memcpy(bswap_buf, sd->data, sizeof(AVDynamicHDRP= lus)); > > > + data =3D bswap_buf; > > > + for(int i =3D 0; i<3; i++) { > >=20 > > Missing space after for and around "<". Also, why not use FF_ARRAY_ELEM= S? > > Same below. >=20 > I could do: > FF_ARRAY_ELEMS(((AVDynamicHDRPlus*)0)->params) will apply the patch with these changes [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answe= r. --F189UyHGeeDOy5bN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaER+cAAKCRBhHseHBAsP qzP8AJ9ljke/wWPSN0YHNkh072pOoEIyFwCcCcmq3u0/g1TMalmTA1Ls2O4BTpE= =4b/W -----END PGP SIGNATURE----- --F189UyHGeeDOy5bN-- --===============4765074511956727443== 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". --===============4765074511956727443==--