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 {{29891, 32800, 11559, -2849, -5763, -102},
104 {-2627, -2479, -1033, 24804, 48080, -1209},
105 { -997, -1350, -358, -4729, -7403, 80373}},
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 {{65535,-12650,18451, -987, -7590, -1049},
136 {-1604, 56032, 4196, 370, 3826, -1049},
137 {-2345,-10676, 1358, 5801, 11416, 56217}},
157 #define OFFSET(x) offsetof(Stereo3DContext, x)
158 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
280 switch (
s->out.format) {
315 return av_clip_uint8(sum >> 16);
319 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
321 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
325 for (y = 0; y <
height; y++) {
326 for (o = 0, x = 0; x <
width; x++, o+= 3) {
327 dst[o ] =
ana_convert(ana_matrix_r, lsrc + o * 2, rsrc + o * 2);
328 dst[o + 1] =
ana_convert(ana_matrix_g, lsrc + o * 2, rsrc + o * 2);
329 dst[o + 2] =
ana_convert(ana_matrix_b, lsrc + o * 2, rsrc + o * 2);
339 ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize,
341 const int *ana_matrix_r,
const int *ana_matrix_g,
const int *ana_matrix_b)
345 for (y = 0; y <
height; y++) {
346 for (o = 0, x = 0; x <
width; x++, o+= 3) {
347 dst[o ] =
ana_convert(ana_matrix_r, lsrc + o, rsrc + o);
348 dst[o + 1] =
ana_convert(ana_matrix_g, lsrc + o, rsrc + o);
349 dst[o + 2] =
ana_convert(ana_matrix_b, lsrc + o, rsrc + o);
367 s->aspect =
inlink->sample_aspect_ratio;
369 switch (
s->in.format) {
406 switch (
s->in.format) {
411 s->in.off_right =
s->width;
417 s->in.off_left =
s->width;
456 s->out.width =
s->width;
457 s->out.height =
s->height;
463 s->out.row_right = 0;
466 switch (
s->out.format) {
484 s->ana_matrix[rgba_map[0]] = &
ana_coeff[
s->out.format][0][0];
485 s->ana_matrix[rgba_map[1]] = &
ana_coeff[
s->out.format][1][0];
486 s->ana_matrix[rgba_map[2]] = &
ana_coeff[
s->out.format][2][0];
492 s->out.width =
s->width * 2;
493 s->out.off_right =
s->width;
498 s->out.width =
s->width * 2;
499 s->out.off_left =
s->width;
504 s->out.height =
s->height * 2;
505 s->out.row_right =
s->height;
508 if (
s->height != 720 &&
s->height != 1080) {
513 s->blanks =
s->height / 24;
514 s->out.height =
s->height * 2 +
s->blanks;
515 s->out.row_right =
s->height +
s->blanks;
520 s->out.height =
s->height * 2;
521 s->out.row_left =
s->height;
526 s->out.height =
s->height * 2;
527 s->out.off_rstep = 1;
532 s->out.height =
s->height * 2;
533 s->out.off_lstep = 1;
537 s->in.off_left =
s->in.off_right;
538 s->in.row_left =
s->in.row_right;
541 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
545 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
554 s->out.width =
s->width * 2;
558 s->out.width =
s->width * 2;
566 if ((
s->in.format & 1) != (
s->out.format & 1)) {
567 FFSWAP(
int,
s->in.row_left,
s->in.row_right);
568 FFSWAP(
int,
s->in.off_lstep,
s->in.off_rstep);
569 FFSWAP(
int,
s->in.off_left,
s->in.off_right);
570 FFSWAP(
int,
s->out.row_left,
s->out.row_right);
571 FFSWAP(
int,
s->out.off_lstep,
s->out.off_rstep);
572 FFSWAP(
int,
s->out.off_left,
s->out.off_right);
576 outlink->
w =
s->out.width;
577 outlink->
h =
s->out.height;
587 s->pheight[0] =
s->pheight[3] =
s->height;
588 s->hsub =
desc->log2_chroma_w;
589 s->vsub =
desc->log2_chroma_h;
612 int end = (
height * (jobnr+1)) / nb_jobs;
613 const int **ana_matrix =
s->ana_matrix;
615 s->dsp.anaglyph(
out->data[0] +
out->linesize[0] *
start,
622 ana_matrix[0], ana_matrix[1], ana_matrix[2]);
631 for (y = 0; y <
s->pheight[p]; y++) {
633 uint8_t *dst =
out->data[p] + out_off[p] + y *
out->linesize[p] *
s->out.row_step;
635 switch (
s->pixstep[p]) {
637 for (x = 0; x <
s->linesize[p]; x++)
641 for (x = 0; x <
s->linesize[p]; x+=2)
645 for (x = 0; x <
s->linesize[p]; x+=3)
649 for (x = 0; x <
s->linesize[p]; x+=4)
653 for (x = 0; x <
s->linesize[p]; x+=6)
657 for (x = 0; x <
s->linesize[p]; x+=8)
669 AVFrame *
out, *oleft, *oright, *ileft, *iright;
670 int out_off_left[4], out_off_right[4];
673 if (
s->in.format ==
s->out.format)
676 switch (
s->out.format) {
686 switch (
s->in.format) {
699 ileft = iright = inpicref;
716 if (!oright || !oleft) {
723 }
else if ((
s->out.format ==
MONO_L ||
782 for (
i = 0;
i < 4;
i++) {
783 int hsub =
i == 1 ||
i == 2 ?
s->hsub : 0;
784 int vsub =
i == 1 ||
i == 2 ?
s->vsub : 0;
791 switch (
s->out.format) {
794 switch (
s->in.format) {
797 for (
i = 0;
i <
s->nb_planes;
i++) {
809 oleft->
width = outlink->
w;
810 oright->
width = outlink->
w;
814 for (
i = 0;
i <
s->nb_planes;
i++) {
815 oleft->
data[
i] +=
s->in_off_left[
i];
816 oright->
data[
i] +=
s->in_off_right[
i];
825 for (
i = 0;
i <
s->nb_planes;
i++) {
826 int j,
h =
s->height >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
827 int b = (
s->blanks) >> ((
i == 1 ||
i == 2) ?
s->vsub : 0);
829 for (j =
h; j <
h +
b; j++)
830 memset(oleft->
data[
i] + j *
s->linesize[
i], 0,
s->linesize[
i]);
845 for (
i = 0;
i <
s->nb_planes;
i++) {
846 int d = (
s->in.format & 1) != (
s->out.format & 1);
852 for (
i = 0;
i <
s->nb_planes;
i++) {
855 ileft->
data[
i] +
s->in_off_left[
i],
857 s->linesize[
i],
s->pheight[
i]);
860 iright->
data[
i] +
s->in_off_right[
i],
862 s->linesize[
i],
s->pheight[
i]);
869 switch (
s->in.format) {
872 for (
i = 0;
i <
s->nb_planes;
i++) {
873 out->linesize[
i] *= 2;
883 out->width = outlink->
w;
884 out->height = outlink->
h;
886 for (
i = 0;
i <
s->nb_planes;
i++) {
887 out->data[
i] +=
s->in_off_left[
i];
892 for (
i = 0;
i <
s->nb_planes;
i++) {
893 const int d = (
s->in.format & 1) != (
s->out.format & 1);
899 for (
i = 0;
i <
s->nb_planes;
i++) {
901 iright->
data[
i] +
s->in_off_left[
i],
903 s->linesize[
i],
s->pheight[
i]);
924 const int d = (
s->in.format & 1);
927 ileft ->
data[0] +
s->in_off_left [0] + d * 3,
928 iright->
data[0] +
s->in_off_right[0] + (!d) * 3,
932 s->out.width,
s->out.height,
933 s->ana_matrix[0],
s->ana_matrix[1],
s->ana_matrix[2]);
937 td.ileft = ileft;
td.iright = iright;
td.out =
out;
945 for (
i = 0;
i <
s->nb_planes;
i++) {
948 for (y = 0; y <
s->pheight[
i]; y++) {
959 switch (
s->pixstep[
i]) {
961 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
962 dst[x ] = (
b&1) == (y&1) ?
left[p*m] : right[p*m];
963 dst[x+1] = (
b&1) != (y&1) ?
left[p*m] : right[p*m];
967 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
973 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
979 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
985 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
991 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1002 for (
i = 0;
i <
s->nb_planes;
i++) {
1004 const int m = 1 + d;
1007 for (y = 0; y <
s->pheight[
i]; y++) {
1016 switch (
s->pixstep[
i]) {
1018 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=2, p++,
b+=2) {
1019 dst[x ] =
b&1 ?
left[p*m] : right[p*m];
1020 dst[x+1] = !(
b&1) ?
left[p*m] : right[p*m];
1024 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=4, p+=2,
b+=2) {
1030 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=6, p+=3,
b+=2) {
1036 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=8, p+=4,
b+=2) {
1042 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=12, p+=6,
b+=2) {
1048 for (x = 0,
b = 0, p = 0; x <
s->linesize[
i] * 2; x+=16, p+=8,
b+=2) {
1061 if (oright != oleft) {
1064 oright->
pts =
s->prev->pts * 2;
1067 oleft->
pts =
s->prev->pts + inpicref->
pts;
1072 out->pts =
s->prev->pts / 2;
1079 out->sample_aspect_ratio =
s->aspect;
1116 .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...
#define FFSWAP(type, a, b)
@ 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.
static av_cold int end(AVCodecContext *avctx)
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[]
AVFormatInternal * internal
An opaque field for libavformat internal usage.
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.
static const AVFilterPad outputs[]
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[]
@ 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
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
@ 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)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
@ 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
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...
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
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
@ 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)
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