History

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.

Andreas Rheinhardt committed 2 years ago

Commit a3fc9fb1 parent 8f791305 files · +11 −5Browse files

Unified · Split

5 files
  1. libavcodec/dxvenc.c +1 −1
  2. libavcodec/hapenc.c +1 −1
  3. libavcodec/texturedsp.h +7 −1
  4. libavcodec/texturedspenc.c +1 −1
  5. libavcodec/vbnenc.c +1 −1
libavcodec/dxvenc.c+1−1
@@ -266,7 +266,7 @@ static int dxv_encode(AVCodecContext *avctx, AVPacket *pkt, · 265 unmodified lines
266266 static av_cold int dxv_init(AVCodecContext *avctx)
267267 {
268268 DXVEncContext *ctx = avctx->priv_data;
269− TextureDSPContext texdsp;
269+ TextureDSPEncContext texdsp;
270270 int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
271271
272272 if (ret < 0) {
libavcodec/hapenc.c+1−1
@@ -232,7 +232,7 @@ static int hap_encode(AVCodecContext *avctx, AVPacket *pkt, · 231 unmodified lines
232232 static av_cold int hap_init(AVCodecContext *avctx)
233233 {
234234 HapContext *ctx = avctx->priv_data;
235− TextureDSPContext dxtc;
235+ TextureDSPEncContext dxtc;
236236 int corrected_chunk_count;
237237 int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
238238
libavcodec/texturedsp.h+7−1
@@ -62,6 +62,12 @@ typedef struct TextureDSPContext { · 61 unmodified lines
6262 int (*dxn3dc_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
6363 } TextureDSPContext;
6464
65+typedef struct TextureDSPEncContext {
66+ int (*dxt1_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
67+ int (*dxt5_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
68+ int (*dxt5ys_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
69+} TextureDSPEncContext;
70+
6571 typedef struct TextureDSPThreadContext {
6672 union {
6773 const uint8_t *in; // Input frame data
@@ -81,7 +87,7 @@ typedef struct TextureDSPThreadContext { · 13 unmodified lines
8187 } TextureDSPThreadContext;
8288
8389 void ff_texturedsp_init(TextureDSPContext *c);
84−void ff_texturedspenc_init(TextureDSPContext *c);
90+void ff_texturedspenc_init(TextureDSPEncContext *c);
8591
8692 int ff_texturedsp_decompress_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb);
8793 int ff_texturedsp_compress_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb);
libavcodec/texturedspenc.c+1−1
@@ -647,7 +647,7 @@ static int dxt5ys_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block) · 646 unmodified lines
647647 return 16;
648648 }
649649
650−av_cold void ff_texturedspenc_init(TextureDSPContext *c)
650+av_cold void ff_texturedspenc_init(TextureDSPEncContext *c)
651651 {
652652 c->dxt1_block = dxt1_block;
653653 c->dxt5_block = dxt5_block;
libavcodec/vbnenc.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636
3737 typedef struct VBNContext {
3838 AVClass *class;
39− TextureDSPContext dxtc;
39+ TextureDSPEncContext dxtc;
4040 int format;
4141 TextureDSPThreadContext enc;
4242 } VBNContext;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t