56 version = bytestream2_get_le32(&gb);
58 d3d_format = bytestream2_get_le32(&gb);
59 w = bytestream2_get_le16(&gb);
60 h = bytestream2_get_le16(&gb);
61 depth = bytestream2_get_byte(&gb);
63 flags = bytestream2_get_byte(&gb);
65 if (version < 8 || version > 9) {
73 }
else if (depth == 16 || depth == 32) {
98 pal = (uint32_t *) p->
data[1];
99 for (y = 0; y < 256; y++) {
100 v = bytestream2_get_be32(&gb);
101 pal[y] = (v >> 8) + (v << 24);
104 for (y=0; y<h; y++) {
108 }
else if (depth == 16) {
110 switch (d3d_format) {
123 }
else if (depth == 32) {
124 switch (d3d_format) {
127 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.
This structure describes decoded (raw) audio or video data.
static av_cold int txd_init(AVCodecContext *avctx)
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
AVFrame * coded_frame
the picture in the bitstream
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
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)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
static int init(AVCodecParserContext *s)
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
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)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
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, see ?_TYPE below.
int width
picture width / height.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
static av_cold int txd_end(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
This structure stores compressed data.
struct TXDContext TXDContext