30#include "config_components.h"
42#define ASTC_HEADER_SIZE 16
43#define ASTC_BLOCK_BYTES 16
44static const uint8_t
astc_magic[4] = { 0x13, 0xAB, 0xA1, 0x5C };
65 unsigned int bx, by, bz,
w,
h, dz;
86 if (!bx || !by || !bz || !
w || !
h || dz != 1) {
88 "Invalid ASTC header: block %ux%ux%u, image %ux%ux%u.\n",
89 bx, by, bz,
w,
h, dz);
96 expected = (((uint64_t)
w + bx - 1) / bx) *
97 (((uint64_t)
h + by - 1) / by) *
99 if (expected > INT_MAX) {
152 "Truncated ASTC image: got %d of %"PRIu64
" bytes.\n",
160 pkt->stream_index = 0;
168 .p.mime_type =
"image/astc",
169 .p.extensions =
"astc",
static int astc_read_header(AVFormatContext *s)
static const uint8_t astc_magic[4]
static int astc_read_packet(AVFormatContext *s, AVPacket *pkt)
static int astc_probe(const AVProbeData *p)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
static int read_header(FFV1Context *f, RangeCoder *c)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.