Go to the documentation of this file.
48 int compression, uint8_t **outbuf)
63 uint8_t *image_buf =
NULL;
75 if (bytestream2_get_le32u(gb) !=
VBN_MAGIC ||
82 width = bytestream2_get_le32u(gb);
83 height = bytestream2_get_le32u(gb);
84 components = bytestream2_get_le32u(gb);
85 format = bytestream2_get_le32u(gb);
86 pix_fmt = bytestream2_get_le32u(gb);
87 bytestream2_get_le32u(gb);
88 data_size = bytestream2_get_le32u(gb);
91 compression =
format & 0xffffff00;
111 linesize = avctx->
width * 3;
114 linesize = avctx->
width * 4;
121 av_log(avctx,
AV_LOG_ERROR,
"DXTx compression only supports 4 pixel aligned resolutions\n");
127 ctx->dec.tex_funct =
ctx->texdsp.dxt1_block;
128 ctx->dec.tex_ratio = 8;
131 ctx->dec.tex_funct =
ctx->texdsp.dxt5_block;
132 ctx->dec.tex_ratio = 16;
140 image_len =
decompress(avctx, gb, compression, &image_buf);
144 if (image_len < linesize * avctx->coded_height) {
155 uint8_t *flipped =
frame->data[0] +
frame->linesize[0] * (
frame->height - 1);
159 ctx->dec.tex_data.in = image_buf ? image_buf : gb->
buffer;
160 ctx->dec.raw_ratio = 16;
162 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_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
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
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.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
int ff_texturedsp_exec_decompress_threads(struct AVCodecContext *avctx, TextureDSPThreadContext *ctx)
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
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.
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.
static av_cold int vbn_init(AVCodecContext *avctx)