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 5A12244728 for ; Tue, 25 Oct 2022 09:18:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC00D68BD6B; Tue, 25 Oct 2022 12:17:28 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 228EC68BCCC for ; Tue, 25 Oct 2022 12:17:26 +0300 (EEST) Received: from f296a472bd3bb2872281fb67d2a4e36d ([1.145.236.2]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 29P9HKMS009166 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Tue, 25 Oct 2022 09:17:24 GMT Date: Tue, 25 Oct 2022 20:17:17 +1100 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: References: <4d64fe7e88a98a833ec603e1a21b8b90fb9ed1a4.1666689283.git.pross@xvid.org> MIME-Version: 1.0 In-Reply-To: <4d64fe7e88a98a833ec603e1a21b8b90fb9ed1a4.1666689283.git.pross@xvid.org> Subject: [FFmpeg-devel] [PATCHv3 2/4] avcodec/svq1enc: output ident string in extradata field 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="===============7711592635228735766==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7711592635228735766== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sCezMakDriig6sVK" Content-Disposition: inline --sCezMakDriig6sVK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This will enable the acurate identification of FFmpeg produced SVQ1 streams, should there be new bugs found in the encoder. --- libavcodec/svq1enc.c | 16 +++++++++++++++- tests/ref/vsynth/vsynth1-svq1 | 4 ++-- tests/ref/vsynth/vsynth2-svq1 | 4 ++-- tests/ref/vsynth/vsynth3-svq1 | 4 ++-- tests/ref/vsynth/vsynth_lena-svq1 | 4 ++-- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 9bd5a04368..73c85bff6b 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -41,6 +41,7 @@ #include "svq1.h" #include "svq1encdsp.h" #include "svq1enc_cb.h" +#include "version.h" =20 #include "libavutil/avassert.h" #include "libavutil/frame.h" @@ -567,6 +568,19 @@ static av_cold int svq1_encode_end(AVCodecContext *avc= tx) return 0; } =20 +static av_cold int write_ident(AVCodecContext *avctx, const char *ident) +{ + int size =3D strlen(ident); + avctx->extradata =3D av_malloc(size + 8); + if (!avctx->extradata) + return AVERROR(ENOMEM); + AV_WB32(avctx->extradata, size + 8); + AV_WL32(avctx->extradata + 4, MKTAG('S', 'V', 'Q', '1')); + memcpy(avctx->extradata + 8, ident, size); + avctx->extradata_size =3D size + 8; + return 0; +} + static av_cold int svq1_encode_init(AVCodecContext *avctx) { SVQ1EncContext *const s =3D avctx->priv_data; @@ -628,7 +642,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avc= tx) =20 ff_h263_encode_init(&s->m); // mv_penalty =20 - return 0; + return write_ident(avctx, s->avctx->flags & AV_CODEC_FLAG_BITEXACT ? "= Lavc" : LIBAVCODEC_IDENT); } =20 static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, diff --git a/tests/ref/vsynth/vsynth1-svq1 b/tests/ref/vsynth/vsynth1-svq1 index e91ef46f17..6a517f6b7b 100644 --- a/tests/ref/vsynth/vsynth1-svq1 +++ b/tests/ref/vsynth/vsynth1-svq1 @@ -1,4 +1,4 @@ -78cdca850b19faf3aac0b0682207451e *tests/data/fate/vsynth1-svq1.mov -1333541 tests/data/fate/vsynth1-svq1.mov +89b1ec4d7bbee1ed2710c8cc8c1e269d *tests/data/fate/vsynth1-svq1.mov +1333561 tests/data/fate/vsynth1-svq1.mov 0b9ee47ee4bf735fe3697daad64fc409 *tests/data/fate/vsynth1-svq1.out.rawvideo stddev: 9.57 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-svq1 b/tests/ref/vsynth/vsynth2-svq1 index b50ba45e20..01d78bd279 100644 --- a/tests/ref/vsynth/vsynth2-svq1 +++ b/tests/ref/vsynth/vsynth2-svq1 @@ -1,4 +1,4 @@ -42578021105a2f526179c5601e635312 *tests/data/fate/vsynth2-svq1.mov -940337 tests/data/fate/vsynth2-svq1.mov +14f355a06d475dcf6a90ac6ab3ae2970 *tests/data/fate/vsynth2-svq1.mov +940357 tests/data/fate/vsynth2-svq1.mov ba8f6b721a8e19fe8a6ef92a8cff7479 *tests/data/fate/vsynth2-svq1.out.rawvideo stddev: 3.71 PSNR: 36.72 MAXDIFF: 210 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth3-svq1 b/tests/ref/vsynth/vsynth3-svq1 index ba1d3d5082..05fd497336 100644 --- a/tests/ref/vsynth/vsynth3-svq1 +++ b/tests/ref/vsynth/vsynth3-svq1 @@ -1,4 +1,4 @@ -03805cb764c00c2162b2bed24b7f34bd *tests/data/fate/vsynth3-svq1.mov -40757 tests/data/fate/vsynth3-svq1.mov +969dcdd69774b9c42dcf81e8dd393364 *tests/data/fate/vsynth3-svq1.mov +40777 tests/data/fate/vsynth3-svq1.mov a99efde992a2e3efcc085ecc6920a1e3 *tests/data/fate/vsynth3-svq1.out.rawvideo stddev: 14.49 PSNR: 24.91 MAXDIFF: 183 bytes: 86700/ 86700 diff --git a/tests/ref/vsynth/vsynth_lena-svq1 b/tests/ref/vsynth/vsynth_le= na-svq1 index 94f260865a..0889eba5bb 100644 --- a/tests/ref/vsynth/vsynth_lena-svq1 +++ b/tests/ref/vsynth/vsynth_lena-svq1 @@ -1,4 +1,4 @@ -7534b2c6b7fc7201f193e9b4514cdb90 *tests/data/fate/vsynth_lena-svq1.mov -766817 tests/data/fate/vsynth_lena-svq1.mov +8890d9ca13934391b6891ac5f67897c6 *tests/data/fate/vsynth_lena-svq1.mov +766837 tests/data/fate/vsynth_lena-svq1.mov 85261558fa744ef468fe77dbe4d91d8d *tests/data/fate/vsynth_lena-svq1.out.raw= video stddev: 3.23 PSNR: 37.93 MAXDIFF: 61 bytes: 7603200/ 7603200 --=20 2.35.1 -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --sCezMakDriig6sVK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCY1epnQAKCRBnYHnFrEDd a3j2AKDCyaIbDjRApfFeYhVjEgr4FHHvlwCdEIEuQxCcmE68e633dornYbP5bBM= =Kyfq -----END PGP SIGNATURE----- --sCezMakDriig6sVK-- --===============7711592635228735766== 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". --===============7711592635228735766==--