From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 5/7] avcodec/texturedsp: Add separate TextureDSPEncContext Date: Wed, 24 Jan 2024 20:52:37 +0100 Message-ID: <AS8P250MB074475FE61DF6EF1F0DEF2E88F7B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB0744B4D31626D49493AE03358F7B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> ff_texturedspenc_init() doesn't support most of the function types supported for decoding; add a separate context containing only pointers for the actually supported types. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/dxvenc.c | 2 +- libavcodec/hapenc.c | 2 +- libavcodec/texturedsp.h | 8 +++++++- libavcodec/texturedspenc.c | 2 +- libavcodec/vbnenc.c | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libavcodec/dxvenc.c b/libavcodec/dxvenc.c index 796f70da02..280a965685 100644 --- a/libavcodec/dxvenc.c +++ b/libavcodec/dxvenc.c @@ -266,7 +266,7 @@ static int dxv_encode(AVCodecContext *avctx, AVPacket *pkt, static av_cold int dxv_init(AVCodecContext *avctx) { DXVEncContext *ctx = avctx->priv_data; - TextureDSPContext texdsp; + TextureDSPEncContext texdsp; int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); if (ret < 0) { diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 2c8bc8e16a..92cd9c4d31 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -232,7 +232,7 @@ static int hap_encode(AVCodecContext *avctx, AVPacket *pkt, static av_cold int hap_init(AVCodecContext *avctx) { HapContext *ctx = avctx->priv_data; - TextureDSPContext dxtc; + TextureDSPEncContext dxtc; int corrected_chunk_count; int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); diff --git a/libavcodec/texturedsp.h b/libavcodec/texturedsp.h index e15d3c2b02..6de8fda690 100644 --- a/libavcodec/texturedsp.h +++ b/libavcodec/texturedsp.h @@ -62,6 +62,12 @@ typedef struct TextureDSPContext { int (*dxn3dc_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); } TextureDSPContext; +typedef struct TextureDSPEncContext { + int (*dxt1_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5ys_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); +} TextureDSPEncContext; + typedef struct TextureDSPThreadContext { union { const uint8_t *in; // Input frame data @@ -81,7 +87,7 @@ typedef struct TextureDSPThreadContext { } TextureDSPThreadContext; void ff_texturedsp_init(TextureDSPContext *c); -void ff_texturedspenc_init(TextureDSPContext *c); +void ff_texturedspenc_init(TextureDSPEncContext *c); int ff_texturedsp_decompress_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb); int ff_texturedsp_compress_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb); diff --git a/libavcodec/texturedspenc.c b/libavcodec/texturedspenc.c index 54cf6fe6e0..ffacf96d56 100644 --- a/libavcodec/texturedspenc.c +++ b/libavcodec/texturedspenc.c @@ -647,7 +647,7 @@ static int dxt5ys_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block) return 16; } -av_cold void ff_texturedspenc_init(TextureDSPContext *c) +av_cold void ff_texturedspenc_init(TextureDSPEncContext *c) { c->dxt1_block = dxt1_block; c->dxt5_block = dxt5_block; diff --git a/libavcodec/vbnenc.c b/libavcodec/vbnenc.c index 7ce91863d7..01c2482bff 100644 --- a/libavcodec/vbnenc.c +++ b/libavcodec/vbnenc.c @@ -36,7 +36,7 @@ typedef struct VBNContext { AVClass *class; - TextureDSPContext dxtc; + TextureDSPEncContext dxtc; int format; TextureDSPThreadContext enc; } VBNContext; -- 2.34.1 _______________________________________________ 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".
next prev parent reply other threads:[~2024-01-24 20:05 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-24 19:50 [FFmpeg-devel] [PATCH 1/7] avcodec/dxvenc: Don't cast const away Andreas Rheinhardt 2024-01-24 19:52 ` [FFmpeg-devel] [PATCH 2/7] avcodec/dxvenc: Fix data races with slice threading Andreas Rheinhardt 2024-01-24 19:52 ` [FFmpeg-devel] [PATCH 3/7] avcodec/texturedspenc: Remove unused rgtc1_u_alpha encoding func Andreas Rheinhardt 2024-01-24 19:52 ` [FFmpeg-devel] [PATCH 4/7] avcodec/dxvenc, hap(dec|enc): Move TextureDSPContext to stack Andreas Rheinhardt 2024-01-24 19:52 ` Andreas Rheinhardt [this message] 2024-01-24 19:52 ` [FFmpeg-devel] [PATCH 6/7] avcodec/hap: Avoid unnecessary opt.h inclusion Andreas Rheinhardt 2024-01-25 19:27 ` Vittorio Giovara 2024-01-26 6:41 ` Andreas Rheinhardt 2024-01-24 19:52 ` [FFmpeg-devel] [PATCH 7/7] avcodec/texturedsp: Factor common code out Andreas Rheinhardt 2024-01-24 20:49 ` [FFmpeg-devel] [PATCH 1/7] avcodec/dxvenc: Don't cast const away Connor Worley 2024-01-25 3:04 ` Andreas Rheinhardt 2024-01-26 19:00 ` Andreas Rheinhardt 2024-01-26 19:15 ` Connor Worley
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS8P250MB074475FE61DF6EF1F0DEF2E88F7B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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