FFmpeg  4.3
Macros | Functions | Variables
vf_fspp.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "vf_fspp.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(FSPPContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define STORE(pos)
 
#define STORE2(pos)
 

Functions

 AVFILTER_DEFINE_CLASS (fspp)
 
static void store_slice_c (uint8_t *dst, int16_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride, ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale)
 
static void store_slice2_c (uint8_t *dst, int16_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride, ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale)
 
static void mul_thrmat_c (int16_t *thr_adr_noq, int16_t *thr_adr, int q)
 
static void filter (FSPPContext *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma)
 
static void column_fidct_c (int16_t *thr_adr, int16_t *data, int16_t *output, int cnt)
 
static void row_idct_c (int16_t *workspace, int16_t *output_adr, ptrdiff_t output_stride, int cnt)
 
static void row_fdct_c (int16_t *data, const uint8_t *pixels, ptrdiff_t line_size, int cnt)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption fspp_options []
 
static const uint8_t dither [8][8]
 
static const short custom_threshold [64]
 
static const AVFilterPad fspp_inputs []
 
static const AVFilterPad fspp_outputs []
 
AVFilter ff_vf_fspp
 

Detailed Description

Fast Simple Post-processing filter This implementation is based on an algorithm described in "Aria Nosratinia Embedded Post-Processing for Enhancement of Compressed Images (1999)" (http://www.utdallas.edu/~aria/papers/vlsisp99.pdf) Further, with splitting (I)DCT into horizontal/vertical passes, one of them can be performed once per block, not per pixel. This allows for much higher speed.

Originally written by Michael Niedermayer and Nikolaj for the MPlayer project, and ported by Arwa Arif for FFmpeg.

Definition in file vf_fspp.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 45 of file vf_fspp.c.

◆ FLAGS

Definition at line 46 of file vf_fspp.c.

◆ STORE

#define STORE (   pos)
Value:
temp = (src[x + pos] + (d[pos] >> log2_scale)) >> (6 - log2_scale); \
src[x + pos] = src[x + pos - 8 * src_stride] = 0; \
if (temp & 0x100) temp = ~(temp >> 31); \
dst[x + pos] = temp;

◆ STORE2

#define STORE2 (   pos)
Value:
temp = (src[x + pos] + src[x + pos + 16 * src_stride] + (d[pos] >> log2_scale)) >> (6 - log2_scale); \
src[x + pos + 16 * src_stride] = 0; \
if (temp & 0x100) temp = ~(temp >> 31); \
dst[x + pos] = temp;

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( fspp  )

◆ store_slice_c()

static void store_slice_c ( uint8_t dst,
int16_t *  src,
ptrdiff_t  dst_stride,
ptrdiff_t  src_stride,
ptrdiff_t  width,
ptrdiff_t  height,
ptrdiff_t  log2_scale 
)
static

Definition at line 83 of file vf_fspp.c.

Referenced by config_input().

◆ store_slice2_c()

static void store_slice2_c ( uint8_t dst,
int16_t *  src,
ptrdiff_t  dst_stride,
ptrdiff_t  src_stride,
ptrdiff_t  width,
ptrdiff_t  height,
ptrdiff_t  log2_scale 
)
static

Definition at line 113 of file vf_fspp.c.

Referenced by config_input().

◆ mul_thrmat_c()

static void mul_thrmat_c ( int16_t *  thr_adr_noq,
int16_t *  thr_adr,
int  q 
)
static

Definition at line 142 of file vf_fspp.c.

Referenced by config_input().

◆ filter()

static void filter ( FSPPContext p,
uint8_t dst,
uint8_t src,
int  dst_stride,
int  src_stride,
int  width,
int  height,
uint8_t qp_store,
int  qp_stride,
int  is_luma 
)
static

Definition at line 149 of file vf_fspp.c.

Referenced by filter_frame().

◆ column_fidct_c()

static void column_fidct_c ( int16_t *  thr_adr,
int16_t *  data,
int16_t *  output,
int  cnt 
)
static

Definition at line 247 of file vf_fspp.c.

Referenced by config_input().

◆ row_idct_c()

static void row_idct_c ( int16_t *  workspace,
int16_t *  output_adr,
ptrdiff_t  output_stride,
int  cnt 
)
static

Definition at line 370 of file vf_fspp.c.

Referenced by config_input().

◆ row_fdct_c()

static void row_fdct_c ( int16_t *  data,
const uint8_t pixels,
ptrdiff_t  line_size,
int  cnt 
)
static

Definition at line 432 of file vf_fspp.c.

Referenced by config_input().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 493 of file vf_fspp.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 511 of file vf_fspp.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 548 of file vf_fspp.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 657 of file vf_fspp.c.

Variable Documentation

◆ fspp_options

const AVOption fspp_options[]
static
Initial value:
= {
{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 4}, 4, MAX_LEVEL, FLAGS },
{ "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
{ "strength", "set filter strength", OFFSET(strength), AV_OPT_TYPE_INT, {.i64 = 0}, -15, 32, FLAGS },
{ "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_BOOL,{.i64 = 0}, 0, 1, FLAGS },
{ NULL }
}

Definition at line 47 of file vf_fspp.c.

◆ dither

const uint8_t dither[8][8]
static
Initial value:
= {
{ 0, 48, 12, 60, 3, 51, 15, 63, },
{ 32, 16, 44, 28, 35, 19, 47, 31, },
{ 8, 56, 4, 52, 11, 59, 7, 55, },
{ 40, 24, 36, 20, 43, 27, 39, 23, },
{ 2, 50, 14, 62, 1, 49, 13, 61, },
{ 34, 18, 46, 30, 33, 17, 45, 29, },
{ 10, 58, 6, 54, 9, 57, 5, 53, },
{ 42, 26, 38, 22, 41, 25, 37, 21, },
}

Definition at line 57 of file vf_fspp.c.

Referenced by ac3_decode_transform_coeffs_ch(), aptx_invert_quantization(), aptx_process_subband(), aptx_quantize_difference(), encode_frame(), quantize_c(), quantize_triangular_ns(), render_charset(), rv40_loop_filter(), set_frame(), store_slice16_c(), store_slice2_c(), store_slice_c(), yuv2NBPS(), yuv2plane1_8_c(), yuv2planeX(), yuv2planeX_8_16(), yuv2planeX_u(), and yuv2yuvX().

◆ custom_threshold

const short custom_threshold[64]
static
Initial value:
= {
71, 296, 295, 237, 71, 40, 38, 19,
245, 193, 185, 121, 102, 73, 53, 27,
158, 129, 141, 107, 97, 73, 50, 26,
102, 116, 109, 98, 82, 66, 45, 23,
71, 94, 95, 81, 70, 56, 38, 20,
56, 77, 74, 66, 56, 44, 30, 15,
38, 53, 50, 45, 38, 30, 21, 11,
20, 27, 26, 23, 20, 15, 11, 5
}

Definition at line 68 of file vf_fspp.c.

Referenced by filter_frame().

◆ fspp_inputs

const AVFilterPad fspp_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 665 of file vf_fspp.c.

◆ fspp_outputs

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

Definition at line 675 of file vf_fspp.c.

◆ ff_vf_fspp

AVFilter ff_vf_fspp
Initial value:
= {
.name = "fspp",
.description = NULL_IF_CONFIG_SMALL("Apply Fast Simple Post-processing filter."),
.priv_size = sizeof(FSPPContext),
.priv_class = &fspp_class,
}

Definition at line 683 of file vf_fspp.c.

FLAGS
#define FLAGS
Definition: vf_fspp.c:46
x
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 pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
fspp_inputs
static const AVFilterPad fspp_inputs[]
Definition: vf_fspp.c:665
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_fspp.c:511
NULL
#define NULL
Definition: coverity.c:32
src
#define src
Definition: vp8dsp.c:254
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
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_fspp.c:493
MAX_LEVEL
#define MAX_LEVEL
Definition: rl.h:36
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
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_fspp.c:657
OFFSET
#define OFFSET(x)
Definition: vf_fspp.c:45
fspp_outputs
static const AVFilterPad fspp_outputs[]
Definition: vf_fspp.c:675
pos
unsigned int pos
Definition: spdifenc.c:410
FSPPContext
Definition: vf_fspp.h:53
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
temp
else temp
Definition: vf_mcdeint.c:256
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_fspp.c:548
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:133
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564