Go to the documentation of this file.
44 uint8_t
block[8] = { 0 };
47 for (
int y = 0; y <
height; y += 4) {
48 for (
int x = 0; x <
width * 4; x += 16) {
59 a = bytestream2_get_le16u(gb);
60 b = bytestream2_get_le16u(gb);
63 }
else if (
a == 1 &&
b == 0xffff) {
65 }
else if (
b &&
a == 0) {
82 for (
int by = 0; by < 4; by++) {
83 for (
int bx = 0; bx < 4; bx++)
84 AV_WL32(dst + x + bx * 4 + by * linesize, bytestream2_get_le24u(gb));
105 if (avpkt->
size < 22)
110 if (bytestream2_get_le32(&gb) !=
MKTAG(
'D',
'X',
'T',
'1'))
112 flags = bytestream2_get_le32(&gb);
114 width = bytestream2_get_le32(&gb);
115 height = bytestream2_get_le32(&gb);
int(* dxt1_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
This structure describes decoded (raw) audio or video data.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
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.
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have so the codec calls ff_thread_report set FF_CODEC_CAP_ALLOCATE_PROGRESS in FFCodec caps_internal and use ff_thread_get_buffer() to allocate frames. Otherwise decode directly into the user-supplied frames. Call ff_thread_report_progress() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
AVCodec p
The public AVCodec.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define FF_CODEC_DECODE_CB(func)
av_cold void ff_texturedsp_init(TextureDSPContext *c)
#define CODEC_LONG_NAME(str)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
const FFCodec ff_rtv1_decoder
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
enum AVPictureType pict_type
Picture type of the frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_init(AVCodecContext *avctx)
main external API structure.
static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, int width, int height, int flag, int(*dxt1_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block))
This structure stores compressed data.
static int dxt1_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
Decompress one block of a DXT1 texture and store the resulting RGBA pixels in 'dst'.
int width
picture width / height.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)