44 const uint8_t *buf = avpkt->
data;
51 const uint8_t *cur = buf;
52 const uint32_t *
palette = (
const uint32_t *)(cur + 88);
60 mipmap_count =
AV_RL8 (cur+85);
64 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++) {
101 pal[y] = (v>>8) + (v<<24);
103 for (y=0; y<h; y++) {
108 }
else if (depth == 16) {
109 switch (d3d_format) {
122 }
else if (depth == 32) {
123 switch (d3d_format) {
126 for (y=0; y<h; y++) {
127 memcpy(ptr, cur, w*4);
137 for (; mipmap_count > 1; mipmap_count--)
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
AV_WL32 AV_WL24 AV_WL16 AV_RB32
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
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
void ff_decode_dxt1(const uint8_t *s, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride)
Decode DXT1 encoded data to RGB32.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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...
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
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)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
struct AVPicture AVPicture
four components are given, that's all.
static av_cold int txd_end(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void ff_decode_dxt3(const uint8_t *s, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride)
Decode DXT3 encoded data to RGB32.
8 bit with PIX_FMT_RGB32 palette
void avcodec_get_frame_defaults(AVFrame *pic)
Set the fields of the given AVFrame to default values.
struct TXDContext TXDContext