FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
utvideoenc.c File Reference

Ut Video encoder. More...

#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "bswapdsp.h"
#include "bytestream.h"
#include "put_bits.h"
#include "huffyuvencdsp.h"
#include "mathops.h"
#include "utvideo.h"
#include "huffman.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(UtvideoContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int huff_cmp_sym (const void *a, const void *b)
 
static av_cold int utvideo_encode_close (AVCodecContext *avctx)
 
static av_cold int utvideo_encode_init (AVCodecContext *avctx)
 
static void mangle_rgb_planes (uint8_t *dst[4], int dst_stride, uint8_t *src, int step, int stride, int width, int height)
 
static void left_predict (uint8_t *src, uint8_t *dst, int stride, int width, int height)
 
static void median_predict (UtvideoContext *c, uint8_t *src, uint8_t *dst, int stride, int width, int height)
 
static void count_usage (uint8_t *src, int width, int height, uint64_t *counts)
 
static void calculate_codes (HuffEntry *he)
 
static int write_huff_codes (uint8_t *src, uint8_t *dst, int dst_size, int width, int height, HuffEntry *he)
 
static int encode_plane (AVCodecContext *avctx, uint8_t *src, uint8_t *dst, int stride, int plane_no, int width, int height, PutByteContext *pb)
 
static int utvideo_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
 

Variables

static const AVOption options []
 
static const AVClass utvideo_class
 
AVCodec ff_utvideo_encoder
 

Detailed Description

Ut Video encoder.

Definition in file utvideoenc.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(UtvideoContext, x)

Definition at line 639 of file utvideoenc.c.

Definition at line 640 of file utvideoenc.c.

Function Documentation

static int huff_cmp_sym ( const void a,
const void b 
)
static

Definition at line 42 of file utvideoenc.c.

Referenced by calculate_codes().

static av_cold int utvideo_encode_close ( AVCodecContext avctx)
static

Definition at line 48 of file utvideoenc.c.

Referenced by utvideo_encode_init().

static av_cold int utvideo_encode_init ( AVCodecContext avctx)
static

Definition at line 60 of file utvideoenc.c.

static void mangle_rgb_planes ( uint8_t dst[4],
int  dst_stride,
uint8_t src,
int  step,
int  stride,
int  width,
int  height 
)
static

Definition at line 237 of file utvideoenc.c.

Referenced by utvideo_encode_frame().

static void left_predict ( uint8_t src,
uint8_t dst,
int  stride,
int  width,
int  height 
)
static

Definition at line 271 of file utvideoenc.c.

Referenced by encode_plane().

static void median_predict ( UtvideoContext c,
uint8_t src,
uint8_t dst,
int  stride,
int  width,
int  height 
)
static

Definition at line 288 of file utvideoenc.c.

Referenced by encode_plane().

static void count_usage ( uint8_t src,
int  width,
int  height,
uint64_t *  counts 
)
static

Definition at line 322 of file utvideoenc.c.

Referenced by encode_plane().

static void calculate_codes ( HuffEntry he)
static

Definition at line 336 of file utvideoenc.c.

Referenced by encode_plane().

static int write_huff_codes ( uint8_t src,
uint8_t dst,
int  dst_size,
int  width,
int  height,
HuffEntry he 
)
static

Definition at line 357 of file utvideoenc.c.

Referenced by encode_plane().

static int encode_plane ( AVCodecContext avctx,
uint8_t src,
uint8_t dst,
int  stride,
int  plane_no,
int  width,
int  height,
PutByteContext pb 
)
static

Definition at line 389 of file utvideoenc.c.

Referenced by utvideo_encode_frame().

static int utvideo_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pic,
int *  got_packet 
)
static

Definition at line 531 of file utvideoenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "pred", "Prediction method", OFFSET(frame_pred), AV_OPT_TYPE_INT, { .i64 = PRED_LEFT }, PRED_NONE, PRED_MEDIAN, VE, "pred" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_NONE }, INT_MIN, INT_MAX, VE, "pred" },
{ "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_LEFT }, INT_MIN, INT_MAX, VE, "pred" },
{ "gradient", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_GRADIENT }, INT_MIN, INT_MAX, VE, "pred" },
{ "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRED_MEDIAN }, INT_MIN, INT_MAX, VE, "pred" },
{ NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: utvideoenc.c:639
#define VE
Definition: utvideoenc.c:640

Definition at line 641 of file utvideoenc.c.

const AVClass utvideo_class
static
Initial value:
= {
.class_name = "utvideo",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:70
av_default_item_name
static const AVOption options[]
Definition: utvideoenc.c:641

Definition at line 651 of file utvideoenc.c.

AVCodec ff_utvideo_encoder
Initial value:
= {
.name = "utvideo",
.long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
.priv_data_size = sizeof(UtvideoContext),
.priv_class = &utvideo_class,
.pix_fmts = (const enum AVPixelFormat[]) {
},
}
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:64
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int utvideo_encode_init(AVCodecContext *avctx)
Definition: utvideoenc.c:60
#define AV_CODEC_CAP_INTRA_ONLY
Codec is intra only.
Definition: avcodec.h:1039
static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
Definition: utvideoenc.c:531
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1019
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:94
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
static const AVClass utvideo_class
Definition: utvideoenc.c:651
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
static av_cold int utvideo_encode_close(AVCodecContext *avctx)
Definition: utvideoenc.c:48

Definition at line 658 of file utvideoenc.c.