Go to the source code of this file.
|
| AVFILTER_DEFINE_CLASS (thumbnail) |
|
static av_cold int | init (AVFilterContext *ctx) |
|
static double | frame_sum_square_err (const int *hist, const double *median) |
| Compute Sum-square deviation to estimate "closeness". More...
|
|
static AVFrame * | get_best_frame (AVFilterContext *ctx) |
|
static void | get_hist8 (int *hist, const uint8_t *p, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height) |
|
static void | get_hist16 (int *hist, const uint8_t *p, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int shift) |
|
static int | do_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
|
static int | filter_frame (AVFilterLink *inlink, AVFrame *frame) |
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
static int | request_frame (AVFilterLink *link) |
|
static int | config_props (AVFilterLink *inlink) |
|
static int | query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out) |
|
Potential thumbnail lookup filter to reduce the risk of an inappropriate selection (such as a black frame) we could get with an absolute seek.
Simplified version of algorithm by Vadim Zaliva lord@.nosp@m.croc.nosp@m.odile.nosp@m..org.
- See also
- http://notbrainsurgery.livejournal.com/29773.html
Definition in file vf_thumbnail.c.
◆ HIST_SIZE
#define HIST_SIZE (3*256) |
◆ OFFSET
◆ FLAGS
◆ AVFILTER_DEFINE_CLASS()
◆ init()
◆ frame_sum_square_err()
static double frame_sum_square_err |
( |
const int * |
hist, |
|
|
const double * |
median |
|
) |
| |
|
static |
Compute Sum-square deviation to estimate "closeness".
- Parameters
-
hist | color distribution histogram |
median | average color distribution histogram |
- Returns
- sum of squared errors
Definition at line 96 of file vf_thumbnail.c.
Referenced by get_best_frame().
◆ get_best_frame()
◆ get_hist8()
static void get_hist8 |
( |
int * |
hist, |
|
|
const uint8_t * |
p, |
|
|
ptrdiff_t |
stride, |
|
|
ptrdiff_t |
width, |
|
|
ptrdiff_t |
height |
|
) |
| |
|
static |
◆ get_hist16()
static void get_hist16 |
( |
int * |
hist, |
|
|
const uint8_t * |
p, |
|
|
ptrdiff_t |
stride, |
|
|
ptrdiff_t |
width, |
|
|
ptrdiff_t |
height, |
|
|
int |
shift |
|
) |
| |
|
static |
◆ do_slice()
static int do_slice |
( |
AVFilterContext * |
ctx, |
|
|
void * |
arg, |
|
|
int |
jobnr, |
|
|
int |
nb_jobs |
|
) |
| |
|
static |
◆ filter_frame()
◆ uninit()
◆ request_frame()
◆ config_props()
◆ query_formats()
◆ thumbnail_options
◆ packed_rgb_fmts
◆ thumbnail_inputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 390 of file vf_thumbnail.c.
◆ thumbnail_outputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 399 of file vf_thumbnail.c.
◆ ff_vf_thumbnail
Initial value:= {
.p.name = "thumbnail",
.p.description =
NULL_IF_CONFIG_SMALL(
"Select the most representative frame in a given sequence of consecutive frames."),
.p.priv_class = &thumbnail_class,
}
Definition at line 407 of file vf_thumbnail.c.
#define AV_LOG_QUIET
Print no output.
#define FILTER_INPUTS(array)
#define AV_LOG_VERBOSE
Detailed information.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int config_props(AVFilterLink *inlink)
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ 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 int request_frame(AVFilterLink *link)
static const AVFilterPad thumbnail_outputs[]
static av_cold void uninit(AVFilterContext *ctx)
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
#define AV_LOG_INFO
Standard information.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define FILTER_QUERY_FUNC2(func)
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
@ AV_OPT_TYPE_INT
Underlying C type is int.
static const AVFilterPad thumbnail_inputs[]
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
static av_cold int init(AVFilterContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.