FFmpeg
Loading...
Searching...
No Matches
vf_stereo3d.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.h"
#include "formats.h"
#include "video.h"
#include "stereo3d.h"

Go to the source code of this file.

Data Structures

struct  StereoComponent
 
struct  Stereo3DContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  StereoCode {
  ANAGLYPH_RC_GRAY , ANAGLYPH_RC_HALF , ANAGLYPH_RC_COLOR , ANAGLYPH_RC_DUBOIS ,
  ANAGLYPH_GM_GRAY , ANAGLYPH_GM_HALF , ANAGLYPH_GM_COLOR , ANAGLYPH_GM_DUBOIS ,
  ANAGLYPH_YB_GRAY , ANAGLYPH_YB_HALF , ANAGLYPH_YB_COLOR , ANAGLYPH_YB_DUBOIS ,
  ANAGLYPH_RB_GRAY , ANAGLYPH_RG_GRAY , MONO_L , MONO_R ,
  INTERLEAVE_ROWS_LR , INTERLEAVE_ROWS_RL , SIDE_BY_SIDE_LR , SIDE_BY_SIDE_RL ,
  SIDE_BY_SIDE_2_LR , SIDE_BY_SIDE_2_RL , ABOVE_BELOW_LR , ABOVE_BELOW_RL ,
  ABOVE_BELOW_2_LR , ABOVE_BELOW_2_RL , ALTERNATING_LR , ALTERNATING_RL ,
  CHECKERBOARD_LR , CHECKERBOARD_RL , INTERLEAVE_COLS_LR , INTERLEAVE_COLS_RL ,
  HDMI , STEREO_CODE_COUNT
}
 

Functions

 AVFILTER_DEFINE_CLASS (stereo3d)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static uint8_t ana_convert (const int *coeff, const uint8_t *left, const uint8_t *right)
 
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)
 
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)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void interleave_cols_to_any (Stereo3DContext *s, int *out_off, int p, AVFrame *in, AVFrame *out, int d)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const int ana_coeff [][3][6]
 
static const AVOption stereo3d_options []
 
static enum AVPixelFormat anaglyph_pix_fmts []
 
static enum AVPixelFormat other_pix_fmts []
 
static const AVFilterPad stereo3d_inputs []
 
static const AVFilterPad stereo3d_outputs []
 
const FFFilter ff_vf_stereo3d
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 157 of file vf_stereo3d.c.

◆ FLAGS

Definition at line 158 of file vf_stereo3d.c.

Enumeration Type Documentation

◆ StereoCode

enum StereoCode
Enumerator
ANAGLYPH_RC_GRAY 
ANAGLYPH_RC_HALF 
ANAGLYPH_RC_COLOR 
ANAGLYPH_RC_DUBOIS 
ANAGLYPH_GM_GRAY 
ANAGLYPH_GM_HALF 
ANAGLYPH_GM_COLOR 
ANAGLYPH_GM_DUBOIS 
ANAGLYPH_YB_GRAY 
ANAGLYPH_YB_HALF 
ANAGLYPH_YB_COLOR 
ANAGLYPH_YB_DUBOIS 
ANAGLYPH_RB_GRAY 
ANAGLYPH_RG_GRAY 
MONO_L 
MONO_R 
INTERLEAVE_ROWS_LR 
INTERLEAVE_ROWS_RL 
SIDE_BY_SIDE_LR 
SIDE_BY_SIDE_RL 
SIDE_BY_SIDE_2_LR 
SIDE_BY_SIDE_2_RL 
ABOVE_BELOW_LR 
ABOVE_BELOW_RL 
ABOVE_BELOW_2_LR 
ABOVE_BELOW_2_RL 
ALTERNATING_LR 
ALTERNATING_RL 
CHECKERBOARD_LR 
CHECKERBOARD_RL 
INTERLEAVE_COLS_LR 
INTERLEAVE_COLS_RL 
HDMI 
STEREO_CODE_COUNT 

Definition at line 35 of file vf_stereo3d.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( stereo3d )

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 282 of file vf_stereo3d.c.

◆ ana_convert()

static uint8_t ana_convert ( const int * coeff,
const uint8_t * left,
const uint8_t * right )
inlinestatic

Definition at line 313 of file vf_stereo3d.c.

Referenced by anaglyph(), and anaglyph_ic().

◆ anaglyph_ic()

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 )
static

Definition at line 324 of file vf_stereo3d.c.

Referenced by filter_frame().

◆ anaglyph()

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 )
static

Definition at line 344 of file vf_stereo3d.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 364 of file vf_stereo3d.c.

◆ filter_slice()

static int filter_slice ( AVFilterContext * ctx,
void * arg,
int jobnr,
int nb_jobs )
static

Definition at line 618 of file vf_stereo3d.c.

◆ interleave_cols_to_any()

static void interleave_cols_to_any ( Stereo3DContext * s,
int * out_off,
int p,
AVFrame * in,
AVFrame * out,
int d )
static

Definition at line 642 of file vf_stereo3d.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * inpicref )
static

Definition at line 679 of file vf_stereo3d.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 1103 of file vf_stereo3d.c.

Variable Documentation

◆ ana_coeff

const int ana_coeff[][3][6]
static

Definition at line 81 of file vf_stereo3d.c.

Referenced by config_output().

◆ stereo3d_options

const AVOption stereo3d_options[]
static

Definition at line 160 of file vf_stereo3d.c.

◆ anaglyph_pix_fmts

enum AVPixelFormat anaglyph_pix_fmts[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76

Definition at line 223 of file vf_stereo3d.c.

Referenced by query_formats().

◆ other_pix_fmts

enum AVPixelFormat other_pix_fmts[]
static

Definition at line 228 of file vf_stereo3d.c.

Referenced by query_formats().

◆ stereo3d_inputs

const AVFilterPad stereo3d_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 1110 of file vf_stereo3d.c.

◆ stereo3d_outputs

const AVFilterPad stereo3d_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 1118 of file vf_stereo3d.c.

◆ ff_vf_stereo3d

const FFFilter ff_vf_stereo3d
Initial value:
= {
.p.name = "stereo3d",
.p.description = NULL_IF_CONFIG_SMALL("Convert video stereoscopic 3D view."),
.p.priv_class = &stereo3d_class,
.priv_size = sizeof(Stereo3DContext),
}
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static const AVFilterPad stereo3d_inputs[]
static const AVFilterPad stereo3d_outputs[]

Definition at line 1126 of file vf_stereo3d.c.