66 ctx->enc.raw_ratio = 16;
70 switch (
ctx->format) {
72 linesize =
frame->width / 2;
73 ctx->enc.tex_funct =
ctx->dxtc.dxt1_block;
74 ctx->enc.tex_ratio = 8;
77 linesize =
frame->width;
78 ctx->enc.tex_funct =
ctx->dxtc.dxt5_block;
79 ctx->enc.tex_ratio = 16;
92 if (pkt_size > INT_MAX)
103 bytestream2_put_le32u(pb,
frame->width);
104 bytestream2_put_le32u(pb,
frame->height);
106 bytestream2_put_le32u(pb,
ctx->format);
108 bytestream2_put_le32u(pb, 0);
115 ctx->enc.stride = -
frame->linesize[0];
121 const uint8_t *flipped =
frame->data[0] +
frame->linesize[0] * (
frame->height - 1);
136#define OFFSET(x) offsetof(VBNContext, x)
137#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
147 .class_name =
"VBN encoder",
static const char *const format[]
const FFCodec ff_vbn_encoder
Libavcodec external API header.
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, int whence)
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
reference-counted frame API
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
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.
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
Compute the size of an image line with format pix_fmt and width width for the plane plane.
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
#define LIBAVUTIL_VERSION_INT
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Describe the class of an AVClass context structure.
main external API structure.
int width
picture width / height.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
TextureDSPThreadContext enc
TextureDSPEncContext dxtc
static AVFormatContext * ctx
Texture block (4x4) module.
void ff_texturedspenc_init(TextureDSPEncContext *c)
int ff_texturedsp_exec_compress_threads(struct AVCodecContext *avctx, TextureDSPThreadContext *ctx)
static av_cold int vbn_init(AVCodecContext *avctx)
static const AVClass vbnenc_class
static int vbn_encode(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
static av_cold int vbn_init(AVCodecContext *avctx)