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
289 switch (
s->out.format) {
325 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
327 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
331 for (y = 0; y <
height; y++) {
332 for (o = 0, x = 0; x <
width; x++, o+= 3) {
334 dst[o + 1] =
ana_convert(ana_matrix_g, lsrc + o * 2, rsrc + o * 2);
335 dst[o + 2] =
ana_convert(ana_matrix_b, lsrc + o * 2, rsrc + o * 2);
345 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
347 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
351 for (y = 0; y <
height; y++) {
352 for (o = 0, x = 0; x <
width; x++, o+= 3) {
375 s->aspect =
inlink->sample_aspect_ratio;
377 switch (
s->in.format) {
414 switch (
s->in.format) {
419 s->in.off_right =
s->width;
425 s->in.off_left =
s->width;
464 s->out.width =
s->width;
465 s->out.height =
s->height;
471 s->out.row_right = 0;
474 switch (
s->out.format) {
492 s->ana_matrix[rgba_map[0]] = &
ana_coeff[
s->out.format][0][0];
493 s->ana_matrix[rgba_map[1]] = &
ana_coeff[
s->out.format][1][0];
494 s->ana_matrix[rgba_map[2]] = &
ana_coeff[
s->out.format][2][0];
500 s->out.width =
s->width * 2;
501 s->out.off_right =
s->width;
506 s->out.width =
s->width * 2;
507 s->out.off_left =
s->width;
512 s->out.height =
s->height * 2;
513 s->out.row_right =
s->height;
516 if (
s->height != 720 &&
s->height != 1080) {
521 s->blanks =
s->height / 24;
522 s->out.height =
s->height * 2 +
s->blanks;
523 s->out.row_right =
s->height +
s->blanks;
528 s->out.height =
s->height * 2;
529 s->out.row_left =
s->height;
534 s->out.height =
s->height * 2;
535 s->out.off_rstep = 1;
540 s->out.height =
s->height * 2;
541 s->out.off_lstep = 1;
545 s->in.off_left =
s->in.off_right;
546 s->in.row_left =
s->in.row_right;
549 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
553 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
564 s->out.width =
s->width * 2;
572 if ((
s->in.format & 1) != (
s->out.format & 1)) {
573 FFSWAP(
int,
s->in.row_left,
s->in.row_right);
574 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
575 FFSWAP(
int,
s->in.off_left,
s->in.off_right);
576 FFSWAP(
int,
s->out.row_left,
s->out.row_right);
577 FFSWAP(
int,
s->out.off_lstep,
s->out.off_rstep);
578 FFSWAP(
int,
s->out.off_left,
s->out.off_right);
582 outlink->
w =
s->out.width;
583 outlink->
h =
s->out.height;
593 s->pheight[0] =
s->pheight[3] =
s->height;
594 s->hsub =
desc->log2_chroma_w;
595 s->vsub =
desc->log2_chroma_h;
618 int start = (
height * jobnr ) / nb_jobs;
619 int end = (
height * (jobnr+1)) / nb_jobs;
620 const int **ana_matrix =
s->ana_matrix;
622 s->dsp.anaglyph(
out->data[0] +
out->linesize[0] * start,
623 ileft ->
data[0] +
s->in_off_left [0] + ileft->
linesize[0] * start *
s->in.row_step,
624 iright->
data[0] +
s->in_off_right[0] + iright->
linesize[0] * start *
s->in.row_step,
628 s->out.width, end - start,
629 ana_matrix[0], ana_matrix[1], ana_matrix[2]);
638 for (y = 0; y <
s->pheight[p]; y++) {
639 const uint8_t *
src = (
const uint8_t*)in->
data[p] + y * in->
linesize[p] + d *
s->pixstep[p];
640 uint8_t *
dst =
out->data[p] + out_off[p] + y *
out->linesize[p] *
s->out.row_step;
642 switch (
s->pixstep[p]) {
644 for (x = 0; x <
s->linesize[p]; x++)
648 for (x = 0; x <
s->linesize[p]; x+=2)
652 for (x = 0; x <
s->linesize[p]; x+=3)
656 for (x = 0; x <
s->linesize[p]; x+=4)
660 for (x = 0; x <
s->linesize[p]; x+=6)
664 for (x = 0; x <
s->linesize[p]; x+=8)
677 int out_off_left[4], out_off_right[4];
680 if (
s->in.format ==
s->out.format)
683 switch (
s->out.format) {
693 switch (
s->in.format) {
706 ileft = iright = inpicref;
723 if (!oright || !oleft) {
730 }
else if ((
s->out.format ==
MONO_L ||
789 for (
i = 0;
i < 4;
i++) {
790 int hsub =
i == 1 ||
i == 2 ?
s->hsub : 0;
791 int vsub =
i == 1 ||
i == 2 ?
s->vsub : 0;
798 switch (
s->out.format) {
801 switch (
s->in.format) {
804 for (
i = 0;
i <
s->nb_planes;
i++) {
805 oleft->linesize[
i] *= 2;
806 oright->linesize[
i] *= 2;
816 oleft->width = outlink->
w;
817 oright->width = outlink->
w;
818 oleft->height = outlink->
h;
819 oright->height = outlink->
h;
821 for (
i = 0;
i <
s->nb_planes;
i++) {
822 oleft->data[
i] +=
s->in_off_left[
i];
823 oright->data[
i] +=
s->in_off_right[
i];
832 for (
i = 0;
i <
s->nb_planes;
i++) {
833 int j,
h =
s->height >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
834 int b = (
s->blanks) >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
836 for (j =
h; j <
h +
b; j++)
837 memset(oleft->data[
i] + j *
s->linesize[
i], 0,
s->linesize[
i]);
852 for (
i = 0;
i <
s->nb_planes;
i++) {
853 int d = (
s->in.format & 1) != (
s->out.format & 1);
859 for (
i = 0;
i <
s->nb_planes;
i++) {
861 oleft->linesize[
i] *
s->out.row_step,
862 ileft->data[
i] +
s->in_off_left[
i],
863 ileft->linesize[
i] *
s->in.row_step,
864 s->linesize[
i],
s->pheight[
i]);
866 oright->linesize[
i] *
s->out.row_step,
867 iright->data[
i] +
s->in_off_right[
i],
868 iright->linesize[
i] *
s->in.row_step,
869 s->linesize[
i],
s->pheight[
i]);
876 switch (
s->in.format) {
879 for (
i = 0;
i <
s->nb_planes;
i++) {
880 out->linesize[
i] *= 2;
890 out->width = outlink->
w;
891 out->height = outlink->
h;
893 for (
i = 0;
i <
s->nb_planes;
i++) {
894 out->data[
i] +=
s->in_off_left[
i];
899 for (
i = 0;
i <
s->nb_planes;
i++) {
900 const int d = (
s->in.format & 1) != (
s->out.format & 1);
906 for (
i = 0;
i <
s->nb_planes;
i++) {
908 iright->data[
i] +
s->in_off_left[
i],
909 iright->linesize[
i] *
s->in.row_step,
910 s->linesize[
i],
s->pheight[
i]);
931 const int d = (
s->in.format & 1);
934 ileft ->data[0] +
s->in_off_left [0] + d * 3,
935 iright->data[0] +
s->in_off_right[0] + (!d) * 3,
937 ileft->linesize[0] *
s->in.row_step,
938 iright->linesize[0] *
s->in.row_step,
939 s->out.width,
s->out.height,
940 s->ana_matrix[0],
s->ana_matrix[1],
s->ana_matrix[2]);
952 for (
i = 0;
i <
s->nb_planes;
i++) {
955 for (y = 0; y <
s->pheight[
i]; y++) {
956 uint8_t *
dst =
out->data[
i] +
out->linesize[
i] * y;
960 uint8_t *
left = ileft->data[
i] + ileft->linesize[
i] * y +
s->in_off_left[
i] + d1 *
s->pixstep[
i];
961 uint8_t *right = iright->data[
i] + iright->linesize[
i] * y +
s->in_off_right[
i] + d2 *
s->pixstep[
i];
966 switch (
s->pixstep[
i]) {
968 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
969 dst[x ] = (
b&1) == (y&1) ?
left[p*m] : right[p*m];
970 dst[x+1] = (
b&1) != (y&1) ?
left[p*m] : right[p*m];
974 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
980 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
986 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
992 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
998 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1009 for (
i = 0;
i <
s->nb_planes;
i++) {
1011 const int m = 1 + d;
1014 for (y = 0; y <
s->pheight[
i]; y++) {
1015 uint8_t *
dst =
out->data[
i] +
out->linesize[
i] * y;
1016 uint8_t *
left = ileft->data[
i] + ileft->linesize[
i] * y *
s->in.row_step +
s->in_off_left[
i] + d *
s->pixstep[
i];
1017 uint8_t *right = iright->data[
i] + iright->linesize[
i] * y *
s->in.row_step +
s->in_off_right[
i];
1023 switch (
s->pixstep[
i]) {
1025 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
1026 dst[x ] =
b&1 ?
left[p*m] : right[p*m];
1027 dst[x+1] = !(
b&1) ?
left[p*m] : right[p*m];
1031 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
1037 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
1043 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
1049 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
1055 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1068 if (oright != oleft) {
1071 oright->pts =
s->prev->pts * 2;
1074 oleft->pts =
s->prev->pts + inpicref->
pts;
1079 out->pts =
s->prev->pts / 2;
1087 out->sample_aspect_ratio =
s->aspect;
1122 .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.
#define FILTER_INPUTS(array)
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).
@ 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.
Link properties exposed to filter code, but not external callers.
@ 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.
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_OUTPUTS(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...
static FilterLink * ff_filter_link(AVFilterLink *link)
@ 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)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
@ 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
@ 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.
#define FILTER_QUERY_FUNC2(func)
@ 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
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ 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...
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const AVFilter ff_vf_stereo3d
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)
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
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_OPT_TYPE_CONST
Special option type for declaring named constants.
@ 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