Go to the documentation of this file.
83 {{19595, 38470, 7471, 0, 0, 0},
85 { 0, 0, 0, 19595, 38470, 7471}},
87 {{19595, 38470, 7471, 0, 0, 0},
88 { 0, 0, 0, 19595, 38470, 7471},
91 {{19595, 38470, 7471, 0, 0, 0},
92 { 0, 0, 0, 19595, 38470, 7471},
93 { 0, 0, 0, 19595, 38470, 7471}},
95 {{19595, 38470, 7471, 0, 0, 0},
96 { 0, 0, 0, 0, 65536, 0},
97 { 0, 0, 0, 0, 0, 65536}},
99 {{65536, 0, 0, 0, 0, 0},
100 { 0, 0, 0, 0, 65536, 0},
101 { 0, 0, 0, 0, 0, 65536}},
103 {{29884, 32768, 11534, -2818, -5767, -131},
104 {-2621, -2490, -1049, 24773, 48103, -1180},
105 { -983, -1376, -328, -4719, -7406, 80347}},
107 {{ 0, 0, 0, 19595, 38470, 7471},
108 {19595, 38470, 7471, 0, 0, 0},
109 { 0, 0, 0, 19595, 38470, 7471}},
111 {{ 0, 0, 0, 65536, 0, 0},
112 {19595, 38470, 7471, 0, 0, 0},
113 { 0, 0, 0, 0, 0, 65536}},
115 {{ 0, 0, 0, 65536, 0, 0},
116 { 0, 65536, 0, 0, 0, 0},
117 { 0, 0, 0, 0, 0, 65536}},
119 {{-4063,-10354, -2556, 34669, 46203, 1573},
120 {18612, 43778, 9372, -1049, -983, -4260},
121 { -983, -1769, 1376, 590, 4915, 61407}},
123 {{ 0, 0, 0, 19595, 38470, 7471},
124 { 0, 0, 0, 19595, 38470, 7471},
125 {19595, 38470, 7471, 0, 0, 0}},
127 {{ 0, 0, 0, 65536, 0, 0},
128 { 0, 0, 0, 0, 65536, 0},
129 {19595, 38470, 7471, 0, 0, 0}},
131 {{ 0, 0, 0, 65536, 0, 0},
132 { 0, 0, 0, 0, 65536, 0},
133 { 0, 0, 65536, 0, 0, 0}},
135 {{69599,-13435,19595, -1048, -8061, -1114},
136 {-1704, 59507, 4456, 393, 4063, -1114},
137 {-2490,-11338, 1442, 6160, 12124, 59703}},
157 #define OFFSET(x) offsetof(Stereo3DContext, x)
158 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
287 switch (
s->out.format) {
322 static void anaglyph_ic(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
323 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
325 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
329 for (y = 0; y <
height; y++) {
330 for (o = 0, x = 0; x <
width; x++, o+= 3) {
331 dst[o ] =
ana_convert(ana_matrix_r, lsrc + o * 2, rsrc + o * 2);
332 dst[o + 1] =
ana_convert(ana_matrix_g, lsrc + o * 2, rsrc + o * 2);
333 dst[o + 2] =
ana_convert(ana_matrix_b, lsrc + o * 2, rsrc + o * 2);
342 static void anaglyph(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
343 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
345 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
349 for (y = 0; y <
height; y++) {
350 for (o = 0, x = 0; x <
width; x++, o+= 3) {
351 dst[o ] =
ana_convert(ana_matrix_r, lsrc + o, rsrc + o);
352 dst[o + 1] =
ana_convert(ana_matrix_g, lsrc + o, rsrc + o);
353 dst[o + 2] =
ana_convert(ana_matrix_b, lsrc + o, rsrc + o);
371 s->aspect =
inlink->sample_aspect_ratio;
373 switch (
s->in.format) {
410 switch (
s->in.format) {
415 s->in.off_right =
s->width;
421 s->in.off_left =
s->width;
460 s->out.width =
s->width;
461 s->out.height =
s->height;
467 s->out.row_right = 0;
470 switch (
s->out.format) {
488 s->ana_matrix[rgba_map[0]] = &
ana_coeff[
s->out.format][0][0];
489 s->ana_matrix[rgba_map[1]] = &
ana_coeff[
s->out.format][1][0];
490 s->ana_matrix[rgba_map[2]] = &
ana_coeff[
s->out.format][2][0];
496 s->out.width =
s->width * 2;
497 s->out.off_right =
s->width;
502 s->out.width =
s->width * 2;
503 s->out.off_left =
s->width;
508 s->out.height =
s->height * 2;
509 s->out.row_right =
s->height;
512 if (
s->height != 720 &&
s->height != 1080) {
517 s->blanks =
s->height / 24;
518 s->out.height =
s->height * 2 +
s->blanks;
519 s->out.row_right =
s->height +
s->blanks;
524 s->out.height =
s->height * 2;
525 s->out.row_left =
s->height;
530 s->out.height =
s->height * 2;
531 s->out.off_rstep = 1;
536 s->out.height =
s->height * 2;
537 s->out.off_lstep = 1;
541 s->in.off_left =
s->in.off_right;
542 s->in.row_left =
s->in.row_right;
545 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
549 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
560 s->out.width =
s->width * 2;
568 if ((
s->in.format & 1) != (
s->out.format & 1)) {
569 FFSWAP(
int,
s->in.row_left,
s->in.row_right);
570 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
571 FFSWAP(
int,
s->in.off_left,
s->in.off_right);
572 FFSWAP(
int,
s->out.row_left,
s->out.row_right);
573 FFSWAP(
int,
s->out.off_lstep,
s->out.off_rstep);
574 FFSWAP(
int,
s->out.off_left,
s->out.off_right);
578 outlink->
w =
s->out.width;
579 outlink->
h =
s->out.height;
589 s->pheight[0] =
s->pheight[3] =
s->height;
590 s->hsub =
desc->log2_chroma_w;
591 s->vsub =
desc->log2_chroma_h;
614 int start = (
height * jobnr ) / nb_jobs;
615 int end = (
height * (jobnr+1)) / nb_jobs;
616 const int **ana_matrix =
s->ana_matrix;
618 s->dsp.anaglyph(
out->data[0] +
out->linesize[0] * start,
619 ileft ->
data[0] +
s->in_off_left [0] + ileft->
linesize[0] * start *
s->in.row_step,
620 iright->
data[0] +
s->in_off_right[0] + iright->
linesize[0] * start *
s->in.row_step,
624 s->out.width, end - start,
625 ana_matrix[0], ana_matrix[1], ana_matrix[2]);
634 for (y = 0; y <
s->pheight[p]; y++) {
635 const uint8_t *
src = (
const uint8_t*)in->
data[p] + y * in->
linesize[p] +
d *
s->pixstep[p];
636 uint8_t *dst =
out->data[p] + out_off[p] + y *
out->linesize[p] *
s->out.row_step;
638 switch (
s->pixstep[p]) {
640 for (x = 0; x <
s->linesize[p]; x++)
644 for (x = 0; x <
s->linesize[p]; x+=2)
648 for (x = 0; x <
s->linesize[p]; x+=3)
652 for (x = 0; x <
s->linesize[p]; x+=4)
656 for (x = 0; x <
s->linesize[p]; x+=6)
660 for (x = 0; x <
s->linesize[p]; x+=8)
673 int out_off_left[4], out_off_right[4];
676 if (
s->in.format ==
s->out.format)
679 switch (
s->out.format) {
689 switch (
s->in.format) {
702 ileft = iright = inpicref;
719 if (!oright || !oleft) {
726 }
else if ((
s->out.format ==
MONO_L ||
785 for (
i = 0;
i < 4;
i++) {
786 int hsub =
i == 1 ||
i == 2 ?
s->hsub : 0;
787 int vsub =
i == 1 ||
i == 2 ?
s->vsub : 0;
794 switch (
s->out.format) {
797 switch (
s->in.format) {
800 for (
i = 0;
i <
s->nb_planes;
i++) {
801 oleft->linesize[
i] *= 2;
802 oright->linesize[
i] *= 2;
812 oleft->width = outlink->
w;
813 oright->width = outlink->
w;
814 oleft->height = outlink->
h;
815 oright->height = outlink->
h;
817 for (
i = 0;
i <
s->nb_planes;
i++) {
818 oleft->data[
i] +=
s->in_off_left[
i];
819 oright->data[
i] +=
s->in_off_right[
i];
828 for (
i = 0;
i <
s->nb_planes;
i++) {
829 int j,
h =
s->height >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
830 int b = (
s->blanks) >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
832 for (j =
h; j <
h +
b; j++)
833 memset(oleft->data[
i] + j *
s->linesize[
i], 0,
s->linesize[
i]);
848 for (
i = 0;
i <
s->nb_planes;
i++) {
849 int d = (
s->in.format & 1) != (
s->out.format & 1);
855 for (
i = 0;
i <
s->nb_planes;
i++) {
857 oleft->linesize[
i] *
s->out.row_step,
858 ileft->data[
i] +
s->in_off_left[
i],
859 ileft->linesize[
i] *
s->in.row_step,
860 s->linesize[
i],
s->pheight[
i]);
862 oright->linesize[
i] *
s->out.row_step,
863 iright->data[
i] +
s->in_off_right[
i],
864 iright->linesize[
i] *
s->in.row_step,
865 s->linesize[
i],
s->pheight[
i]);
872 switch (
s->in.format) {
875 for (
i = 0;
i <
s->nb_planes;
i++) {
876 out->linesize[
i] *= 2;
886 out->width = outlink->
w;
887 out->height = outlink->
h;
889 for (
i = 0;
i <
s->nb_planes;
i++) {
890 out->data[
i] +=
s->in_off_left[
i];
895 for (
i = 0;
i <
s->nb_planes;
i++) {
896 const int d = (
s->in.format & 1) != (
s->out.format & 1);
902 for (
i = 0;
i <
s->nb_planes;
i++) {
904 iright->data[
i] +
s->in_off_left[
i],
905 iright->linesize[
i] *
s->in.row_step,
906 s->linesize[
i],
s->pheight[
i]);
927 const int d = (
s->in.format & 1);
930 ileft ->data[0] +
s->in_off_left [0] +
d * 3,
931 iright->data[0] +
s->in_off_right[0] + (!
d) * 3,
933 ileft->linesize[0] *
s->in.row_step,
934 iright->linesize[0] *
s->in.row_step,
935 s->out.width,
s->out.height,
936 s->ana_matrix[0],
s->ana_matrix[1],
s->ana_matrix[2]);
940 td.ileft = ileft;
td.iright = iright;
td.out =
out;
948 for (
i = 0;
i <
s->nb_planes;
i++) {
951 for (y = 0; y <
s->pheight[
i]; y++) {
952 uint8_t *dst =
out->data[
i] +
out->linesize[
i] * y;
956 uint8_t *
left = ileft->data[
i] + ileft->linesize[
i] * y +
s->in_off_left[
i] + d1 *
s->pixstep[
i];
957 uint8_t *right = iright->data[
i] + iright->linesize[
i] * y +
s->in_off_right[
i] + d2 *
s->pixstep[
i];
962 switch (
s->pixstep[
i]) {
964 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
965 dst[x ] = (
b&1) == (y&1) ?
left[p*m] : right[p*m];
966 dst[x+1] = (
b&1) != (y&1) ?
left[p*m] : right[p*m];
970 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
976 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
982 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
988 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
994 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1005 for (
i = 0;
i <
s->nb_planes;
i++) {
1007 const int m = 1 +
d;
1010 for (y = 0; y <
s->pheight[
i]; y++) {
1011 uint8_t *dst =
out->data[
i] +
out->linesize[
i] * y;
1012 uint8_t *
left = ileft->data[
i] + ileft->linesize[
i] * y *
s->in.row_step +
s->in_off_left[
i] +
d *
s->pixstep[
i];
1013 uint8_t *right = iright->data[
i] + iright->linesize[
i] * y *
s->in.row_step +
s->in_off_right[
i];
1019 switch (
s->pixstep[
i]) {
1021 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
1022 dst[x ] =
b&1 ?
left[p*m] : right[p*m];
1023 dst[x+1] = !(
b&1) ?
left[p*m] : right[p*m];
1027 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
1033 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
1039 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
1045 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
1051 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1064 if (oright != oleft) {
1067 oright->pts =
s->prev->pts * 2;
1070 oleft->pts =
s->prev->pts + inpicref->
pts;
1075 out->pts =
s->prev->pts / 2;
1083 out->sample_aspect_ratio =
s->aspect;
1118 .priv_class = &stereo3d_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
static uint8_t ana_convert(const int *coeff, const uint8_t *left, const uint8_t *right)
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
@ AV_PIX_FMT_BGRA64BE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
static int config_output(AVFilterLink *outlink)
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
@ AV_PIX_FMT_YUVA444P10BE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define FILTER_QUERY_FUNC(func)
@ AV_PIX_FMT_YUV420P14BE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
const char * name
Filter name.
@ AV_PIX_FMT_YUVA444P9BE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
@ AV_PIX_FMT_YUV422P9BE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
static const AVFilterPad stereo3d_inputs[]
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
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.
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
static const int ana_coeff[][3][6]
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUVA444P16BE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUV444P10BE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
A filter pad used for either input or output.
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
@ AV_PIX_FMT_YUV422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_CEIL_RSHIFT(a, b)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
static enum AVPixelFormat pix_fmts[]
@ AV_PIX_FMT_YUVA420P16BE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static enum AVPixelFormat anaglyph_pix_fmts[]
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_YUVA422P10LE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
@ AV_PIX_FMT_YUV444P9BE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_YUV422P10BE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
@ AV_PIX_FMT_YUV422P16LE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Describe the class of an AVClass context structure.
static enum AVPixelFormat other_pix_fmts[]
static const AVOption stereo3d_options[]
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Rational number (pair of numerator and denominator).
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
static const AVFilterPad stereo3d_outputs[]
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUV444P14BE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_YUV420P9BE
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
const int * ana_matrix[3]
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static void copy(const float *p1, float *p2, const int length)
@ AV_PIX_FMT_YUV420P12BE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_YUV422P14BE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
int format
agreed upon media format
static int query_formats(AVFilterContext *ctx)
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
@ AV_PIX_FMT_YUV420P10BE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
AVFilterContext * src
source filter
AVFILTER_DEFINE_CLASS(stereo3d)
static void interleave_cols_to_any(Stereo3DContext *s, int *out_off, int p, AVFrame *in, AVFrame *out, int d)
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
static av_cold void uninit(AVFilterContext *ctx)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_BGRA64LE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_YUVA422P10BE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUVA422P9BE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define i(width, name, range_min, range_max)
int w
agreed upon image width
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
const char * name
Pad name.
@ AV_PIX_FMT_YUV444P16BE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
#define FFSWAP(type, a, b)
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled left
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
@ AV_PIX_FMT_YUV444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
int h
agreed upon image height
void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
@ AV_PIX_FMT_YUVA420P10BE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUV420P16BE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P16BE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
const AVFilter ff_vf_stereo3d
#define FILTER_OUTPUTS(array)
static void anaglyph(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize, int width, int height, const int *ana_matrix_r, const int *ana_matrix_g, const int *ana_matrix_b)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
@ AV_PIX_FMT_YUVA422P16BE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
@ AV_PIX_FMT_YUV422P9LE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_YUVA422P16LE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static const double coeff[2][5]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void anaglyph_ic(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize, int width, int height, const int *ana_matrix_r, const int *ana_matrix_g, const int *ana_matrix_b)
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
@ AV_PIX_FMT_YUVA420P9BE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_BGR48BE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_YUVA422P9LE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian