* [FFmpeg-devel] [PATCH 1/3] lvac/svqenc: add ff_svq1enc_init
@ 2023-12-29 11:56 flow gg
0 siblings, 0 replies; only message in thread
From: flow gg @ 2023-12-29 11:56 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-lvac-svqenc-add-ff_svq1enc_init.patch --]
[-- Type: text/x-patch, Size: 2142 bytes --]
From 55fe9e001545ed3ae1f2c64666d07aebaeb83a2a Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Fri, 29 Dec 2023 13:08:25 +0800
Subject: [PATCH 1/3] lvac/svqenc: add ff_svq1enc_init
This is for clarity and use in testing, consistent with other parts of the code
---
libavcodec/svq1enc.c | 18 ++++++++++++------
libavcodec/svq1encdsp.h | 1 +
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 764d047799..0dea405dec 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -634,18 +634,13 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
s->y_block_height * sizeof(int32_t));
s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map));
s->m.new_picture = av_frame_alloc();
- s->svq1encdsp.ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
if (!s->m.me.scratchpad || !s->m.me.map ||
!s->mb_type || !s->dummy || !s->m.new_picture)
return AVERROR(ENOMEM);
s->m.me.score_map = s->m.me.map + ME_MAP_SIZE;
-#if ARCH_PPC
- ff_svq1enc_init_ppc(&s->svq1encdsp);
-#elif ARCH_X86
- ff_svq1enc_init_x86(&s->svq1encdsp);
-#endif
+ ff_svq1enc_init(&s->svq1encdsp);
ff_h263_encode_init(&s->m); // mv_penalty
@@ -764,3 +759,14 @@ const FFCodec ff_svq1_encoder = {
AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
+
+void ff_svq1enc_init(SVQ1EncDSPContext *c)
+{
+ c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
+
+#if ARCH_PPC
+ ff_svq1enc_init_ppc(c);
+#elif ARCH_X86
+ ff_svq1enc_init_x86(c);
+#endif
+}
diff --git a/libavcodec/svq1encdsp.h b/libavcodec/svq1encdsp.h
index 91b36735d7..618bf8463b 100644
--- a/libavcodec/svq1encdsp.h
+++ b/libavcodec/svq1encdsp.h
@@ -28,6 +28,7 @@ typedef struct SVQ1EncDSPContext {
intptr_t size);
} SVQ1EncDSPContext;
+void ff_svq1enc_init(SVQ1EncDSPContext *c);
void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c);
void ff_svq1enc_init_x86(SVQ1EncDSPContext *c);
--
2.43.0
[-- Attachment #3: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-29 11:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-29 11:56 [FFmpeg-devel] [PATCH 1/3] lvac/svqenc: add ff_svq1enc_init flow gg
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git