FFmpeg
Macros | Functions | Variables
v210enc.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "v210enc.h"

Go to the source code of this file.

Macros

#define CLIP(v)   av_clip(v, 4, 1019)
 
#define CLIP8(v)   av_clip(v, 1, 254)
 
#define WRITE_PIXELS(a, b, c)
 
#define WRITE_PIXELS8(a, b, c)
 

Functions

static void v210_planar_pack_8_c (const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, ptrdiff_t width)
 
static void v210_planar_pack_10_c (const uint16_t *y, const uint16_t *u, const uint16_t *v, uint8_t *dst, ptrdiff_t width)
 
av_cold void ff_v210enc_init (V210EncContext *s)
 
static av_cold int encode_init (AVCodecContext *avctx)
 
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
 

Variables

AVCodec ff_v210_encoder
 

Macro Definition Documentation

◆ CLIP

#define CLIP (   v)    av_clip(v, 4, 1019)

Definition at line 29 of file v210enc.c.

◆ CLIP8

#define CLIP8 (   v)    av_clip(v, 1, 254)

Definition at line 30 of file v210enc.c.

◆ WRITE_PIXELS

#define WRITE_PIXELS (   a,
  b,
  c 
)
Value:
do { \
val = CLIP(*a++); \
val |= (CLIP(*b++) << 10) | \
(CLIP(*c++) << 20); \
AV_WL32(dst, val); \
dst += 4; \
} while (0)

Definition at line 32 of file v210enc.c.

◆ WRITE_PIXELS8

#define WRITE_PIXELS8 (   a,
  b,
  c 
)
Value:
do { \
val = (CLIP8(*a++) << 2); \
val |= (CLIP8(*b++) << 12) | \
(CLIP8(*c++) << 22); \
AV_WL32(dst, val); \
dst += 4; \
} while (0)

Definition at line 41 of file v210enc.c.

Function Documentation

◆ v210_planar_pack_8_c()

static void v210_planar_pack_8_c ( const uint8_t y,
const uint8_t u,
const uint8_t v,
uint8_t dst,
ptrdiff_t  width 
)
static

Definition at line 50 of file v210enc.c.

Referenced by ff_v210enc_init().

◆ v210_planar_pack_10_c()

static void v210_planar_pack_10_c ( const uint16_t *  y,
const uint16_t *  u,
const uint16_t *  v,
uint8_t dst,
ptrdiff_t  width 
)
static

Definition at line 70 of file v210enc.c.

Referenced by ff_v210enc_init().

◆ ff_v210enc_init()

av_cold void ff_v210enc_init ( V210EncContext s)

Definition at line 85 of file v210enc.c.

Referenced by checkasm_check_v210enc(), and encode_init().

◆ encode_init()

static av_cold int encode_init ( AVCodecContext avctx)
static

Definition at line 96 of file v210enc.c.

◆ encode_frame()

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

Definition at line 119 of file v210enc.c.

Variable Documentation

◆ ff_v210_encoder

AVCodec ff_v210_encoder
Initial value:
= {
.name = "v210",
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
.priv_data_size = sizeof(V210EncContext),
.encode2 = encode_frame,
}

Definition at line 258 of file v210enc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
b
#define b
Definition: input.c:41
CLIP
#define CLIP(v)
Definition: v210enc.c:29
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
V210EncContext
Definition: v210enc.h:26
encode_frame
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
Definition: v210enc.c:119
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:388
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
AV_CODEC_ID_V210
@ AV_CODEC_ID_V210
Definition: avcodec.h:345
encode_init
static av_cold int encode_init(AVCodecContext *avctx)
Definition: v210enc.c:96
val
const char const char void * val
Definition: avisynth_c.h:863
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
CLIP8
#define CLIP8(v)
Definition: v210enc.c:30