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) {
154 frame->key_frame = 1;
157 uint8_t *flipped =
frame->data[0] +
frame->linesize[0] * (
frame->height - 1);
161 ctx->dec.tex_data.in = image_buf ? image_buf : gb->
buffer;
162 ctx->dec.raw_ratio = 16;
164 ctx->dec.stride = -
frame->linesize[0];
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 ff_texturedsp_decompress_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb)
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 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
av_cold void ff_texturedsp_init(TextureDSPContext *c)
static enum AVPixelFormat pix_fmt
@ 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_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.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const FFCodec ff_vbn_decoder
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
int coded_width
Bitstream width / height, may be different from width/height e.g.
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.
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)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
static av_cold int vbn_init(AVCodecContext *avctx)