FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions | Variables
vsrc_mptestsrc.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MPTestContext
 

Macros

#define WIDTH   512
 
#define HEIGHT   512
 
#define OFFSET(x)   offsetof(MPTestContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  test_type {
  TEST_DC_LUMA, TEST_DC_CHROMA, TEST_FREQ_LUMA, TEST_FREQ_CHROMA,
  TEST_AMP_LUMA, TEST_AMP_CHROMA, TEST_CBP, TEST_MV,
  TEST_RING1, TEST_RING2, TEST_ALL, TEST_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (mptestsrc)
 
static void init_idct (void)
 
static void idct (uint8_t *dst, int dst_linesize, int src[64])
 
static void draw_dc (uint8_t *dst, int dst_linesize, int color, int w, int h)
 
static void draw_basis (uint8_t *dst, int dst_linesize, int amp, int freq, int dc)
 
static void draw_cbp (uint8_t *dst[3], int dst_linesize[3], int cbp, int amp, int dc)
 
static void dc_test (uint8_t *dst, int dst_linesize, int w, int h, int off)
 
static void freq_test (uint8_t *dst, int dst_linesize, int off)
 
static void amp_test (uint8_t *dst, int dst_linesize, int off)
 
static void cbp_test (uint8_t *dst[3], int dst_linesize[3], int off)
 
static void mv_test (uint8_t *dst, int dst_linesize, int off)
 
static void ring1_test (uint8_t *dst, int dst_linesize, int off)
 
static void ring2_test (uint8_t *dst, int dst_linesize, int off)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption mptestsrc_options []
 
static double c [64]
 
static const AVFilterPad mptestsrc_outputs []
 
AVFilter ff_vsrc_mptestsrc
 

Detailed Description

MP test source, ported from MPlayer libmpcodecs/vf_test.c

Definition in file vsrc_mptestsrc.c.

Macro Definition Documentation

◆ WIDTH

#define WIDTH   512

Definition at line 35 of file vsrc_mptestsrc.c.

◆ HEIGHT

#define HEIGHT   512

Definition at line 36 of file vsrc_mptestsrc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(MPTestContext, x)

Definition at line 62 of file vsrc_mptestsrc.c.

◆ FLAGS

Definition at line 63 of file vsrc_mptestsrc.c.

Enumeration Type Documentation

◆ test_type

enum test_type
Enumerator
TEST_DC_LUMA 
TEST_DC_CHROMA 
TEST_FREQ_LUMA 
TEST_FREQ_CHROMA 
TEST_AMP_LUMA 
TEST_AMP_CHROMA 
TEST_CBP 
TEST_MV 
TEST_RING1 
TEST_RING2 
TEST_ALL 
TEST_NB 

Definition at line 38 of file vsrc_mptestsrc.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( mptestsrc  )

◆ init_idct()

static void init_idct ( void  )
static

Definition at line 94 of file vsrc_mptestsrc.c.

Referenced by init().

◆ idct()

static void idct ( uint8_t dst,
int  dst_linesize,
int  src[64] 
)
static

Definition at line 106 of file vsrc_mptestsrc.c.

Referenced by draw_basis().

◆ draw_dc()

static void draw_dc ( uint8_t dst,
int  dst_linesize,
int  color,
int  w,
int  h 
)
static

Definition at line 134 of file vsrc_mptestsrc.c.

Referenced by dc_test(), and ring1_test().

◆ draw_basis()

static void draw_basis ( uint8_t dst,
int  dst_linesize,
int  amp,
int  freq,
int  dc 
)
static

Definition at line 143 of file vsrc_mptestsrc.c.

Referenced by amp_test(), draw_cbp(), and freq_test().

◆ draw_cbp()

static void draw_cbp ( uint8_t dst[3],
int  dst_linesize[3],
int  cbp,
int  amp,
int  dc 
)
static

Definition at line 154 of file vsrc_mptestsrc.c.

Referenced by cbp_test().

◆ dc_test()

static void dc_test ( uint8_t dst,
int  dst_linesize,
int  w,
int  h,
int  off 
)
static

Definition at line 164 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ freq_test()

static void freq_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 177 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ amp_test()

static void amp_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 189 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ cbp_test()

static void cbp_test ( uint8_t dst[3],
int  dst_linesize[3],
int  off 
)
static

Definition at line 201 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ mv_test()

static void mv_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 218 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ ring1_test()

static void ring1_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 230 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ ring2_test()

static void ring2_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 242 of file vsrc_mptestsrc.c.

Referenced by request_frame().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 261 of file vsrc_mptestsrc.c.

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 277 of file vsrc_mptestsrc.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 293 of file vsrc_mptestsrc.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 305 of file vsrc_mptestsrc.c.

Variable Documentation

◆ mptestsrc_options

const AVOption mptestsrc_options[]
static
Initial value:
= {
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },
{ "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "test", "set test to perform", OFFSET(test), AV_OPT_TYPE_INT, {.i64=TEST_ALL}, 0, INT_MAX, FLAGS, "test" },
{ "t", "set test to perform", OFFSET(test), AV_OPT_TYPE_INT, {.i64=TEST_ALL}, 0, INT_MAX, FLAGS, "test" },
{ "dc_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_DC_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "dc_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_DC_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "freq_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_FREQ_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "freq_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_FREQ_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "amp_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_AMP_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "amp_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_AMP_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "cbp", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_CBP}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "mv", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_MV}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "ring1", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING1}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "ring2", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING2}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "all", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_ALL}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "max_frames", "Set the maximum number of frames generated for each test", OFFSET(max_frames),
AV_OPT_TYPE_INT64, {.i64 = 30}, 1, INT64_MAX, FLAGS },
{ "m", "Set the maximum number of frames generated for each test", OFFSET(max_frames),
AV_OPT_TYPE_INT64, {.i64 = 30}, 1, INT64_MAX, FLAGS },
{ NULL }
}

Definition at line 64 of file vsrc_mptestsrc.c.

◆ c

double c[64]
static

Definition at line 92 of file vsrc_mptestsrc.c.

Referenced by idct(), and init_idct().

◆ mptestsrc_outputs

const AVFilterPad mptestsrc_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
}

Definition at line 350 of file vsrc_mptestsrc.c.

◆ ff_vsrc_mptestsrc

AVFilter ff_vsrc_mptestsrc
Initial value:
= {
.name = "mptestsrc",
.description = NULL_IF_CONFIG_SMALL("Generate various test pattern."),
.priv_size = sizeof(MPTestContext),
.priv_class = &mptestsrc_class,
.init = init,
}

Definition at line 360 of file vsrc_mptestsrc.c.

AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:236
TEST_ALL
@ TEST_ALL
Definition: vsrc_mptestsrc.c:49
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:237
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vsrc_mptestsrc.c:293
init
static av_cold int init(AVFilterContext *ctx)
Definition: vsrc_mptestsrc.c:261
duration
int64_t duration
Definition: movenc.c:63
TEST_AMP_CHROMA
@ TEST_AMP_CHROMA
Definition: vsrc_mptestsrc.c:44
TEST_DC_CHROMA
@ TEST_DC_CHROMA
Definition: vsrc_mptestsrc.c:40
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
TEST_FREQ_CHROMA
@ TEST_FREQ_CHROMA
Definition: vsrc_mptestsrc.c:42
OFFSET
#define OFFSET(x)
Definition: vsrc_mptestsrc.c:62
TEST_RING2
@ TEST_RING2
Definition: vsrc_mptestsrc.c:48
NULL
#define NULL
Definition: coverity.c:32
TEST_FREQ_LUMA
@ TEST_FREQ_LUMA
Definition: vsrc_mptestsrc.c:41
inputs
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
Definition: filter_design.txt:243
MPTestContext
Definition: vsrc_mptestsrc.c:53
FLAGS
#define FLAGS
Definition: vsrc_mptestsrc.c:63
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
TEST_CBP
@ TEST_CBP
Definition: vsrc_mptestsrc.c:45
test
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the test
Definition: fate.txt:76
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vsrc_mptestsrc.c:305
mptestsrc_outputs
static const AVFilterPad mptestsrc_outputs[]
Definition: vsrc_mptestsrc.c:350
TEST_DC_LUMA
@ TEST_DC_LUMA
Definition: vsrc_mptestsrc.c:39
TEST_RING1
@ TEST_RING1
Definition: vsrc_mptestsrc.c:47
TEST_AMP_LUMA
@ TEST_AMP_LUMA
Definition: vsrc_mptestsrc.c:43
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
TEST_MV
@ TEST_MV
Definition: vsrc_mptestsrc.c:46
config_props
static int config_props(AVFilterLink *outlink)
Definition: vsrc_mptestsrc.c:277
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232