42 version = bytestream2_get_le32(&gb);
44 d3d_format = bytestream2_get_le32(&gb);
45 w = bytestream2_get_le16(&gb);
46 h = bytestream2_get_le16(&gb);
47 depth = bytestream2_get_byte(&gb);
49 flags = bytestream2_get_byte(&gb);
51 if (version < 8 || version > 9) {
59 }
else if (depth == 16 || depth == 32) {
78 pal = (uint32_t *) p->
data[1];
79 for (y = 0; y < 256; y++) {
80 v = bytestream2_get_be32(&gb);
81 pal[
y] = (v >> 8) + (v << 24);
90 }
else if (depth == 16) {
109 }
else if (depth == 32) {
110 switch (d3d_format) {
115 for (y=0; y<
h; y++) {
void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride)
Decode DXT3 encoded data to RGB32.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
8 bit with AV_PIX_FMT_RGB32 palette
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
const char * name
Name of the codec implementation.
Libavcodec external API header.
void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride)
Decode DXT1 encoded data to RGB32.
enum AVPictureType pict_type
Picture type of the frame.
#define FF_CEIL_RSHIFT(a, b)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static int unsupported(AVCodecContext *avctx)
This structure stores compressed data.