24 #include "libavutil/intreadwrite.h"
25 #include "libavutil/imgutils.h"
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) {
79 pal = (uint32_t *) p->
data[1];
80 for (y = 0; y < 256; y++) {
81 v = bytestream2_get_be32(&gb);
82 pal[
y] = (v >> 8) + (v << 24);
91 }
else if (depth == 16) {
110 }
else if (depth == 32) {
111 switch (d3d_format) {
116 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_PATCHWELCOME
This structure describes decoded (raw) audio or video data.
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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)
const char * name
Name of the codec implementation.
#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)
Libavcodec external API header.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
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.
int width
picture width / height.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
#define AVERROR_INVALIDDATA
8 bit with PIX_FMT_RGB32 palette
static int unsupported(AVCodecContext *avctx)
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.