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 ESMTPS id CF3E14E179 for ; Sat, 8 Mar 2025 20:20:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C41068E78D; Sat, 8 Mar 2025 22:20:13 +0200 (EET) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06CF068DF3B for ; Sat, 8 Mar 2025 22:20:06 +0200 (EET) Received: from b23210acc22a312b5f9efa84d03776bb ([1.145.192.95]) (authenticated (0 bits)) by mx.sdf.org (8.18.1/8.14.3) with ESMTPSA id 528KJvZ9003953 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sat, 8 Mar 2025 20:20:03 GMT Date: Sun, 9 Mar 2025 07:19:55 +1100 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/vp8: Fix wrong #endif comment 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="===============1543282597379665314==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1543282597379665314== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="atDVjpecDU9OSkAK" Content-Disposition: inline --atDVjpecDU9OSkAK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 08, 2025 at 04:29:06AM +0100, Andreas Rheinhardt wrote: > Patches attached >=20 > - Andreas > From 54e27b588e18fdfe277a77b0f385cb02731022b9 Mon Sep 17 00:00:00 2001 > From: Andreas Rheinhardt > Date: Thu, 6 Mar 2025 17:56:08 +0100 > Subject: [PATCH 1/4] avcodec/vp8: Fix wrong #endif comment >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vp8.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c > index 3651688c10..6337fa173b 100644 > --- a/libavcodec/vp8.c > +++ b/libavcodec/vp8.c > @@ -2984,4 +2984,4 @@ const FFCodec ff_vp8_decoder =3D { > NULL > }, > }; > -#endif /* CONFIG_VP7_DECODER */ > +#endif /* CONFIG_VP8_DECODER */ > --=20 > 2.45.2 >=20 > From 2360e180fabb2dc8577018283c8b3f5f46425a51 Mon Sep 17 00:00:00 2001 > From: Andreas Rheinhardt > Date: Thu, 6 Mar 2025 18:00:28 +0100 > Subject: [PATCH 2/4] avcodec/vp8: Move codec-specific init code out of co= mmon > init >=20 > While just at it, also move the init functions inside > the #if CONFIG_VP?_DECODER (to avoid linking failures). > While just at it, also declare these init functions > as av_cold and uninline the remaining common init function. >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vp8.c | 48 ++++++++++++++++++++++++------------------------ > 1 file changed, 24 insertions(+), 24 deletions(-) >=20 > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c > index 6337fa173b..be8dbde91e 100644 > --- a/libavcodec/vp8.c > +++ b/libavcodec/vp8.c > @@ -2858,8 +2858,7 @@ av_cold int ff_vp8_decode_free(AVCodecContext *avct= x) > return 0; > } > =20 > -static av_always_inline > -int vp78_decode_init(AVCodecContext *avctx, int is_vp7) > +static av_cold void vp78_decode_init(AVCodecContext *avctx) > { > VP8Context *s =3D avctx->priv_data; > =20 > @@ -2870,37 +2869,25 @@ int vp78_decode_init(AVCodecContext *avctx, int i= s_vp7) > ff_videodsp_init(&s->vdsp, 8); > =20 > ff_vp78dsp_init(&s->vp8dsp); > - if (CONFIG_VP7_DECODER && is_vp7) { > - ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP7, 8, 1); > - ff_vp7dsp_init(&s->vp8dsp); > - s->decode_mb_row_no_filter =3D vp7_decode_mb_row_no_filter; > - s->filter_mb_row =3D vp7_filter_mb_row; > - } else if (CONFIG_VP8_DECODER && !is_vp7) { > - ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1); > - ff_vp8dsp_init(&s->vp8dsp); > - s->decode_mb_row_no_filter =3D vp8_decode_mb_row_no_filter; > - s->filter_mb_row =3D vp8_filter_mb_row; > - } > =20 > /* does not change for VP8 */ > memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan)); > - > - return 0; > } > =20 > -#if CONFIG_VP7_DECODER > -static int vp7_decode_init(AVCodecContext *avctx) > -{ > - return vp78_decode_init(avctx, IS_VP7); > -} > -#endif /* CONFIG_VP7_DECODER */ > - > +#if CONFIG_VP8_DECODER > av_cold int ff_vp8_decode_init(AVCodecContext *avctx) > { > - return vp78_decode_init(avctx, IS_VP8); > + VP8Context *s =3D avctx->priv_data; > + > + vp78_decode_init(avctx); > + ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1); > + ff_vp8dsp_init(&s->vp8dsp); > + s->decode_mb_row_no_filter =3D vp8_decode_mb_row_no_filter; > + s->filter_mb_row =3D vp8_filter_mb_row; > + > + return 0; > } > =20 > -#if CONFIG_VP8_DECODER > #if HAVE_THREADS > static void vp8_replace_frame(VP8Frame *dst, const VP8Frame *src) > { > @@ -2944,6 +2931,19 @@ static int vp8_decode_update_thread_context(AVCode= cContext *dst, > #endif /* CONFIG_VP8_DECODER */ > =20 > #if CONFIG_VP7_DECODER > +av_cold static int vp7_decode_init(AVCodecContext *avctx) > +{ > + VP8Context *s =3D avctx->priv_data; > + > + vp78_decode_init(avctx); > + ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP7, 8, 1); > + ff_vp7dsp_init(&s->vp8dsp); > + s->decode_mb_row_no_filter =3D vp7_decode_mb_row_no_filter; > + s->filter_mb_row =3D vp7_filter_mb_row; > + > + return 0; > +} > + > const FFCodec ff_vp7_decoder =3D { > .p.name =3D "vp7", > CODEC_LONG_NAME("On2 VP7"), > --=20 > 2.45.2 >=20 > From 538cb0a9226066d4fe13ef07aad70e6f14273939 Mon Sep 17 00:00:00 2001 > From: Andreas Rheinhardt > Date: Thu, 6 Mar 2025 18:16:50 +0100 > Subject: [PATCH 3/4] avcodec/vp8: Move VPx specific functions inside #if > CONFIG_VPx block >=20 > where appropriate. Avoids including ff_vp8_decode_frame() > when the VP8 decoder is disabled. >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vp8.c | 74 +++++++++++++++++++++++------------------------- > 1 file changed, 36 insertions(+), 38 deletions(-) >=20 > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c > index be8dbde91e..77f7b4d4df 100644 > --- a/libavcodec/vp8.c > +++ b/libavcodec/vp8.c > @@ -2512,18 +2512,6 @@ static av_always_inline int decode_mb_row_no_filte= r(AVCodecContext *avctx, void > return 0; > } > =20 > -static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdat= a, > - int jobnr, int threadnr) > -{ > - return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1); > -} > - > -static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdat= a, > - int jobnr, int threadnr) > -{ > - return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0); > -} > - > static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *= tdata, > int jobnr, int threadnr, int is_vp7) > { > @@ -2583,18 +2571,6 @@ static av_always_inline void filter_mb_row(AVCodec= Context *avctx, void *tdata, > } > } > =20 > -static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata, > - int jobnr, int threadnr) > -{ > - filter_mb_row(avctx, tdata, jobnr, threadnr, 1); > -} > - > -static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata, > - int jobnr, int threadnr) > -{ > - filter_mb_row(avctx, tdata, jobnr, threadnr, 0); > -} > - > static av_always_inline > int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jo= bnr, > int threadnr, int is_vp7) > @@ -2837,20 +2813,6 @@ err: > return ret; > } > =20 > -int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, > - int *got_frame, AVPacket *avpkt) > -{ > - return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8); > -} > - > -#if CONFIG_VP7_DECODER > -static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame, > - int *got_frame, AVPacket *avpkt) > -{ > - return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7); > -} > -#endif /* CONFIG_VP7_DECODER */ > - > av_cold int ff_vp8_decode_free(AVCodecContext *avctx) > { > vp8_decode_flush_impl(avctx, 1); > @@ -2875,6 +2837,24 @@ static av_cold void vp78_decode_init(AVCodecContex= t *avctx) > } > =20 > #if CONFIG_VP8_DECODER > +static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdat= a, > + int jobnr, int threadnr) > +{ > + return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0); > +} > + > +static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata, > + int jobnr, int threadnr) > +{ > + filter_mb_row(avctx, tdata, jobnr, threadnr, 0); > +} > + > +int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, > + int *got_frame, AVPacket *avpkt) > +{ > + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8); > +} > + > av_cold int ff_vp8_decode_init(AVCodecContext *avctx) > { > VP8Context *s =3D avctx->priv_data; > @@ -2931,6 +2911,24 @@ static int vp8_decode_update_thread_context(AVCode= cContext *dst, > #endif /* CONFIG_VP8_DECODER */ > =20 > #if CONFIG_VP7_DECODER > +static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdat= a, > + int jobnr, int threadnr) > +{ > + return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1); > +} > + > +static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata, > + int jobnr, int threadnr) > +{ > + filter_mb_row(avctx, tdata, jobnr, threadnr, 1); > +} > + > +static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame, > + int *got_frame, AVPacket *avpkt) > +{ > + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7); > +} > + > av_cold static int vp7_decode_init(AVCodecContext *avctx) > { > VP8Context *s =3D avctx->priv_data; > --=20 > 2.45.2 >=20 > From 105f5edaa24b5ad0b4b1431cb04f22f3f5a106a6 Mon Sep 17 00:00:00 2001 > From: Andreas Rheinhardt > Date: Thu, 6 Mar 2025 18:20:32 +0100 > Subject: [PATCH 4/4] avcodec/vp8: Remove always-false hwaccel checks for = VP7 >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vp8.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c > index 77f7b4d4df..348744efd6 100644 > --- a/libavcodec/vp8.c > +++ b/libavcodec/vp8.c > @@ -2727,7 +2727,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFram= e *rframe, int *got_frame, > if (!is_vp7 && !s->actually_webp) > ff_thread_finish_setup(avctx); > =20 > - if (avctx->hwaccel) { > + if (!is_vp7 && avctx->hwaccel) { > const FFHWAccel *hwaccel =3D ffhwaccel(avctx->hwaccel); > ret =3D hwaccel->start_frame(avctx, avpkt->data, avpkt->size); > if (ret < 0) > --=20 no objections, lgtm -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --atDVjpecDU9OSkAK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCZ8ymZwAKCRBnYHnFrEDd ayDlAKCY7k5kDH9JJBout/VZO1CWKtk37QCfcFAKXU6fbHZUlF42Y94hkJxHaC8= =GJje -----END PGP SIGNATURE----- --atDVjpecDU9OSkAK-- --===============1543282597379665314== 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". --===============1543282597379665314==--