31#define TXD_DXT1 0x31545844
32#define TXD_DXT3 0x33545844
52 version = bytestream2_get_le32(&gb);
55 w = bytestream2_get_le16(&gb);
56 h = bytestream2_get_le16(&gb);
57 depth = bytestream2_get_byte(&gb);
59 flags = bytestream2_get_byte(&gb);
70 }
else if (depth == 16) {
85 }
else if (depth == 32) {
109 pal = (uint32_t *) p->data[1];
110 for (y = 0; y < 256; y++) {
111 v = bytestream2_get_be32(&gb);
112 pal[y] = (v >> 8) + (v << 24);
115 for (y=0; y<
h; y++) {
119 }
else if (depth == 16) {
124 for (j = 0; j < avctx->
height; j += 4) {
125 for (
i = 0;
i < avctx->
width;
i += 4) {
126 uint8_t *p = ptr +
i * 4 + j *
stride;
133 for (j = 0; j < avctx->
height; j += 4) {
134 for (
i = 0;
i < avctx->
width;
i += 4) {
135 uint8_t *p = ptr +
i * 4 + j *
stride;
144 }
else if (depth == 32) {
148 for (y=0; y<
h; y++) {
const FFCodec ff_txd_decoder
Libavcodec external API header.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define AV_CEIL_RSHIFT(a, b)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ AV_PICTURE_TYPE_I
Intra.
static int unsupported(AVCodecContext *avctx)
static int txd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Macro definitions for various function/variable attributes.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int coded_width
Bitstream width / height, may be different from width/height e.g.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
int(* dxt1_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
int(* dxt3_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
av_cold void ff_texturedsp_init(TextureDSPContext *c)
Texture block (4x4) module.