29 #define CLIP(v) av_clip(v, 4, 1019)
30 #define CLIP8(v) av_clip(v, 1, 254)
32 #define WRITE_PIXELS(a, b, c) \
35 val |= (CLIP(*b++) << 10) | \
41 #define WRITE_PIXELS8(a, b, c) \
43 val = (CLIP8(*a++) << 2); \
44 val |= (CLIP8(*b++) << 12) | \
45 (CLIP8(*c++) << 22); \
58 for (i = 0; i < width - 11; i += 12) {
77 for (i = 0; i < width - 5; i += 6) {
89 if (avctx->
width & 1) {
94 #if FF_API_CODED_FRAME
110 const AVFrame *pic,
int *got_packet)
113 int aligned_width = ((avctx->
width + 47) / 48) * 48;
114 int stride = aligned_width * 8 / 3;
115 int line_padding = stride - ((avctx->
width * 8 + 11) / 12) * 4;
127 const uint16_t *
y = (
const uint16_t *)pic->
data[0];
128 const uint16_t *
u = (
const uint16_t *)pic->
data[1];
129 const uint16_t *
v = (
const uint16_t *)pic->
data[2];
132 w = (avctx->
width / 6) * 6;
139 if (w < avctx->
width - 1) {
143 if (w == avctx->
width - 2) {
148 if (w < avctx->
width - 3) {
149 val |= (
CLIP(*
u++) << 10) | (
CLIP(*y++) << 20);
153 val =
CLIP(*v++) | (
CLIP(*y++) << 10);
158 memset(dst, 0, line_padding);
168 for (h = 0; h < avctx->
height; h++) {
170 w = (avctx->
width / 12) * 12;
176 dst += (w / 12) * 32;
178 for (; w < avctx->
width - 5; w += 6) {
184 if (w < avctx->
width - 1) {
187 val =
CLIP8(*y++) << 2;
188 if (w == avctx->
width - 2) {
193 if (w < avctx->
width - 3) {
194 val |= (
CLIP8(*u++) << 12) | (
CLIP8(*y++) << 22);
198 val = (
CLIP8(*v++) << 2) | (
CLIP8(*y++) << 12);
202 memset(dst, 0, line_padding);
const char const char void * val
This structure describes decoded (raw) audio or video data.
static av_cold int init(AVCodecContext *avctx)
#define WRITE_PIXELS(a, b, 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 av_cold int encode_init(AVCodecContext *avctx)
#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. ...
const char * name
Name of the codec implementation.
void(* pack_line_8)(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, ptrdiff_t width)
Libavcodec external API header.
int flags
A combination of AV_PKT_FLAG values.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
main external API structure.
void ff_v210enc_init_x86(V210EncContext *s)
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_YUV422P10
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
GLint GLenum GLboolean GLsizei stride
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
#define FF_ENABLE_DEPRECATION_WARNINGS
void(* pack_line_10)(const uint16_t *y, const uint16_t *u, const uint16_t *v, uint8_t *dst, ptrdiff_t width)
#define WRITE_PIXELS8(a, b, c)
AVPixelFormat
Pixel format.
This structure stores compressed data.
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)