29 #include "libavutil/avassert.h"
41 uint32_t
flags, in_format;
45 in_format = UTVF_YV12;
50 in_format = UTVF_YUYV;
104 utv->
codec = CCodec::CreateInstance(UNFCC(avctx->
codec_tag),
"libavcodec");
108 CBGROSSWIDTH_WINDOWS);
114 CBGROSSWIDTH_WINDOWS);
118 utv->
codec->SetState(&flags,
sizeof(flags));
124 const AVFrame *pic,
int *got_packet)
128 int ret, rgb_size, i;
145 for (i = 0; i < h; i++) {
149 for (i = 0; i < h / 2; i++) {
157 for (i = 0; i < h; i++)
158 memcpy(utv->
buffer + i * (w << 1),
165 for (i = 0; i < h; i++)
166 memcpy(utv->
buffer + (h - i - 1) * w * rgb_size,
205 utv->
codec->EncodeEnd();
206 CCodec::DeleteInstance(utv->
codec);
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
This structure describes decoded (raw) audio or video data.
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
#define CODEC_CAP_LOSSLESS
Codec is lossless.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int utvideo_encode_init(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
packed RGB 8:8:8, 24bpp, BGRBGR...
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Known FOURCCs: 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA), 'ULH0' (YCbCr 4:2:0 BT.709), 'ULH2' (YCbCr 4:2:2 BT.709)
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
#define MKTAG(a, b, c, d)
AVFrame * coded_frame
the picture in the bitstream
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static av_cold int utvideo_encode_close(AVCodecContext *avctx)
common internal api header.
int prediction_method
prediction method (needed for huffyuv)
#define AVERROR_INVALIDDATA
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.
AVCodec ff_libutvideo_encoder
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define UTVF_NFCC_BGRA_BU
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.