Go to the documentation of this file.
47 int compression, uint8_t **outbuf)
62 uint8_t *image_buf =
NULL;
74 if (bytestream2_get_le32u(gb) !=
VBN_MAGIC ||
81 width = bytestream2_get_le32u(gb);
82 height = bytestream2_get_le32u(gb);
83 components = bytestream2_get_le32u(gb);
84 format = bytestream2_get_le32u(gb);
85 pix_fmt = bytestream2_get_le32u(gb);
86 bytestream2_get_le32u(gb);
87 data_size = bytestream2_get_le32u(gb);
90 compression =
format & 0xffffff00;
110 linesize = avctx->
width * 3;
113 linesize = avctx->
width * 4;
120 av_log(avctx,
AV_LOG_ERROR,
"DXTx compression only supports 4 pixel aligned resolutions\n");
126 ctx->dec.tex_funct =
ctx->texdsp.dxt1_block;
127 ctx->dec.tex_ratio = 8;
130 ctx->dec.tex_funct =
ctx->texdsp.dxt5_block;
131 ctx->dec.tex_ratio = 16;
139 image_len =
decompress(avctx, gb, compression, &image_buf);
143 if (image_len < linesize * avctx->coded_height) {
161 ctx->dec.tex_data.in = image_buf ? image_buf : gb->
buffer;
162 ctx->dec.raw_ratio = 16;
static int decompress(AVCodecContext *avctx, GetByteContext *gb, int compression, uint8_t **outbuf)
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
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.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
AVCodec p
The public AVCodec.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define VBN_COMPRESSION_NONE
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define FF_CODEC_DECODE_CB(func)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
static enum AVPixelFormat pix_fmt
av_cold void ff_texturedsp_init(TextureDSPContext *c)
#define CODEC_LONG_NAME(str)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
int ff_texturedsp_exec_decompress_threads(struct AVCodecContext *avctx, TextureDSPThreadContext *ctx)
enum AVPictureType pict_type
Picture type of the frame.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static int vbn_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
TextureDSPThreadContext dec
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const FFCodec ff_vbn_decoder
main external API structure.
int coded_width
Bitstream width / height, may be different from width/height e.g.
This structure stores compressed data.
int width
picture width / height.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static av_cold int vbn_init(AVCodecContext *avctx)