aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-01-24 18:58:17 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-01-28 10:52:48 +0100
commita3fc9fb9fbc0c7154d874cc6740345bfc0102282 (patch)
tree899956ba264c898f52878b12442de30dfc8800f0
parent8f791304f2e7bc70d6d6c404301a5c3a1de7da57 (diff)
downloadffmpeg-a3fc9fb9fbc0c7154d874cc6740345bfc0102282.tar.gz
avcodec/texturedsp: Add separate TextureDSPEncContext
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>
-rw-r--r--libavcodec/dxvenc.c2
-rw-r--r--libavcodec/hapenc.c2
-rw-r--r--libavcodec/texturedsp.h8
-rw-r--r--libavcodec/texturedspenc.c2
-rw-r--r--libavcodec/vbnenc.c2
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;