FFmpeg
|
#include <math.h>
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.h"
#include "framesync.h"
Go to the source code of this file.
Data Structures | |
struct | Map2D |
struct | HeatmapList |
struct | SampleParams |
struct | BilinearMap |
struct | SSIM360Context |
Macros | |
#define | RIGHT 0 |
Copyright (c) 2015-2021, Facebook, Inc. More... | |
#define | LEFT 1 |
#define | TOP 2 |
#define | BOTTOM 3 |
#define | FRONT 4 |
#define | BACK 5 |
#define | DEFAULT_HEATMAP_W 32 |
#define | DEFAULT_HEATMAP_H 16 |
#define | M_PI_F ((float)M_PI) |
#define | M_PI_2_F ((float)M_PI_2) |
#define | M_PI_4_F ((float)M_PI_4) |
#define | M_SQRT2_F ((float)M_SQRT2) |
#define | DEFAULT_EXPANSION_COEF 1.01f |
#define | BARREL_THETA_RANGE (DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F) |
#define | BARREL_PHI_RANGE (DEFAULT_EXPANSION_COEF * M_PI_2_F) |
#define | FIXED_POINT_PRECISION 16 |
#define | SSIM360_HIST_SIZE 131072 |
#define | OFFSET(x) offsetof(SSIM360Context, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | PF(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf, AV_PIX_FMT_GBR##suf |
Enumerations | |
enum | StereoFormat { STEREO_FORMAT_TB, STEREO_FORMAT_LR, STEREO_FORMAT_MONO, STEREO_FORMAT_N } |
enum | Projection { PROJECTION_CUBEMAP32, PROJECTION_CUBEMAP23, PROJECTION_BARREL, PROJECTION_BARREL_SPLIT, PROJECTION_EQUIRECT, PROJECTION_N } |
Functions | |
FRAMESYNC_DEFINE_CLASS (ssim360, SSIM360Context, fs) | |
static void | set_meta (AVDictionary **metadata, const char *key, char comp, float d) |
static void | map_uninit (Map2D *map) |
static int | map_init (Map2D *map, int w, int h) |
static void | map_list_free (HeatmapList **pl) |
static int | map_alloc (HeatmapList **pl, int w, int h) |
static void | ssim360_4x4xn_16bit (const uint8_t *main8, ptrdiff_t main_stride, const uint8_t *ref8, ptrdiff_t ref_stride, int64_t(*sums)[4], int width) |
static void | ssim360_4x4xn_8bit (const uint8_t *main, ptrdiff_t main_stride, const uint8_t *ref, ptrdiff_t ref_stride, int(*sums)[4], int width) |
static float | ssim360_end1x (int64_t s1, int64_t s2, int64_t ss, int64_t s12, int max) |
static float | ssim360_end1 (int s1, int s2, int ss, int s12) |
static double | ssim360_endn_16bit (const int64_t(*sum0)[4], const int64_t(*sum1)[4], int width, int max, double *density_map, int map_width, double *total_weight) |
static double | ssim360_endn_8bit (const int(*sum0)[4], const int(*sum1)[4], int width, double *density_map, int map_width, double *total_weight) |
static double | ssim360_plane_16bit (uint8_t *main, int main_stride, uint8_t *ref, int ref_stride, int width, int height, void *temp, int max, Map2D density) |
static double | ssim360_plane_8bit (uint8_t *main, int main_stride, uint8_t *ref, int ref_stride, int width, int height, void *temp, int max, Map2D density) |
static double | ssim360_db (double ssim360, double weight) |
static int | get_bilinear_sample (const uint8_t *data, BilinearMap *m, int max_value) |
static void | ssim360_4x4x2_tape (const uint8_t *main, BilinearMap *main_maps, const uint8_t *ref, BilinearMap *ref_maps, int offset_y, int max_value, int(*sums)[4]) |
static float | get_radius_between_negative_and_positive_pi (float theta) |
static float | get_heat (HeatmapList *heatmaps, float angular_resoluation, float norm_tape_pos) |
static double | ssim360_tape (uint8_t *main, BilinearMap *main_maps, uint8_t *ref, BilinearMap *ref_maps, int tape_length, int max_value, void *temp, double *ssim360_hist, double *ssim360_hist_net, float angular_resolution, HeatmapList *heatmaps) |
static void | compute_bilinear_map (SampleParams *p, BilinearMap *m, float x, float y) |
static void | get_equirect_map (float phi, float theta, float *x, float *y) |
static void | get_barrel_map (float phi, float theta, float *x, float *y) |
static void | get_barrel_split_map (float phi, float theta, float expand_coef, float *x, float *y) |
static int | get_cubemap_face_map (float axis_vec_x, float axis_vec_y, float axis_vec_z, float *face_x, float *face_y) |
static void | get_cubemap32_map (float phi, float theta, float *x, float *y) |
static void | get_rotated_cubemap_map (float phi, float theta, float expand_coef, float *x, float *y) |
static void | get_projected_map (float phi, float theta, SampleParams *p, BilinearMap *m) |
static int | tape_supports_projection (int projection) |
static float | get_tape_angular_resolution (int projection, float expand_coef, int image_width, int image_height) |
static int | generate_eye_tape_map (SSIM360Context *s, int plane, int eye, SampleParams *ref_sample_params, SampleParams *main_sample_params) |
static int | generate_tape_maps (SSIM360Context *s, AVFrame *main, const AVFrame *ref) |
static int | do_ssim360 (FFFrameSync *fs) |
static int | parse_heatmaps (void *logctx, HeatmapList **proot, const char *data, int w, int h) |
static av_cold int | init (AVFilterContext *ctx) |
static int | config_input_main (AVFilterLink *inlink) |
static int | generate_density_map (SSIM360Context *s, int w, int h) |
static int | config_input_ref (AVFilterLink *inlink) |
static int | config_output (AVFilterLink *outlink) |
static int | activate (AVFilterContext *ctx) |
static av_cold void | uninit (AVFilterContext *ctx) |
Variables | |
static const double | PERCENTILE_LIST [] |
static const AVOption | ssim360_options [] |
static enum AVPixelFormat | ssim360_pixfmts [] |
static const AVFilterPad | ssim360_inputs [] |
static const AVFilterPad | ssim360_outputs [] |
const AVFilter | ff_vf_ssim360 |
#define RIGHT 0 |
Copyright (c) 2015-2021, Facebook, Inc.
All rights reserved.
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Definition at line 57 of file vf_ssim360.c.
#define LEFT 1 |
Definition at line 58 of file vf_ssim360.c.
#define TOP 2 |
Definition at line 59 of file vf_ssim360.c.
#define BOTTOM 3 |
Definition at line 60 of file vf_ssim360.c.
#define FRONT 4 |
Definition at line 61 of file vf_ssim360.c.
#define BACK 5 |
Definition at line 62 of file vf_ssim360.c.
#define DEFAULT_HEATMAP_W 32 |
Definition at line 64 of file vf_ssim360.c.
#define DEFAULT_HEATMAP_H 16 |
Definition at line 65 of file vf_ssim360.c.
Definition at line 67 of file vf_ssim360.c.
Definition at line 68 of file vf_ssim360.c.
Definition at line 69 of file vf_ssim360.c.
Definition at line 70 of file vf_ssim360.c.
#define DEFAULT_EXPANSION_COEF 1.01f |
Definition at line 72 of file vf_ssim360.c.
#define BARREL_THETA_RANGE (DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F) |
Definition at line 74 of file vf_ssim360.c.
#define BARREL_PHI_RANGE (DEFAULT_EXPANSION_COEF * M_PI_2_F) |
Definition at line 75 of file vf_ssim360.c.
#define FIXED_POINT_PRECISION 16 |
Definition at line 78 of file vf_ssim360.c.
#define SSIM360_HIST_SIZE 131072 |
Definition at line 81 of file vf_ssim360.c.
#define OFFSET | ( | x | ) | offsetof(SSIM360Context, x) |
Definition at line 202 of file vf_ssim360.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 203 of file vf_ssim360.c.
#define PF | ( | suf | ) | AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf, AV_PIX_FMT_GBR##suf |
Definition at line 1714 of file vf_ssim360.c.
enum StereoFormat |
Enumerator | |
---|---|
STEREO_FORMAT_TB | |
STEREO_FORMAT_LR | |
STEREO_FORMAT_MONO | |
STEREO_FORMAT_N |
Definition at line 89 of file vf_ssim360.c.
enum Projection |
Enumerator | |
---|---|
PROJECTION_CUBEMAP32 | |
PROJECTION_CUBEMAP23 | |
PROJECTION_BARREL | |
PROJECTION_BARREL_SPLIT | |
PROJECTION_EQUIRECT | |
PROJECTION_N |
Definition at line 96 of file vf_ssim360.c.
FRAMESYNC_DEFINE_CLASS | ( | ssim360 | , |
SSIM360Context | , | ||
fs | |||
) |
|
static |
Definition at line 278 of file vf_ssim360.c.
Referenced by do_ssim360().
|
static |
Definition at line 291 of file vf_ssim360.c.
Referenced by do_ssim360(), map_list_free(), and uninit().
|
static |
Definition at line 296 of file vf_ssim360.c.
Referenced by generate_density_map(), and map_alloc().
|
static |
Definition at line 308 of file vf_ssim360.c.
Referenced by parse_heatmaps(), and uninit().
|
static |
Definition at line 322 of file vf_ssim360.c.
Referenced by parse_heatmaps().
|
static |
Definition at line 342 of file vf_ssim360.c.
Referenced by ssim360_plane_16bit().
|
static |
Definition at line 378 of file vf_ssim360.c.
Referenced by ssim360_plane_8bit().
Definition at line 407 of file vf_ssim360.c.
Referenced by ssim360_endn_16bit().
|
static |
Definition at line 423 of file vf_ssim360.c.
Referenced by ssim360_endn_8bit().
|
static |
Definition at line 440 of file vf_ssim360.c.
Referenced by ssim360_plane_16bit().
|
static |
Definition at line 460 of file vf_ssim360.c.
Referenced by ssim360_plane_8bit().
|
static |
Definition at line 478 of file vf_ssim360.c.
Referenced by config_input_ref().
|
static |
Definition at line 510 of file vf_ssim360.c.
Referenced by config_input_ref().
Definition at line 541 of file vf_ssim360.c.
Referenced by do_ssim360(), and uninit().
|
static |
Definition at line 546 of file vf_ssim360.c.
Referenced by ssim360_4x4x2_tape().
|
static |
Definition at line 576 of file vf_ssim360.c.
Referenced by ssim360_tape().
Definition at line 611 of file vf_ssim360.c.
Referenced by generate_eye_tape_map(), and get_heat().
|
static |
Definition at line 625 of file vf_ssim360.c.
Referenced by ssim360_tape().
|
static |
Definition at line 648 of file vf_ssim360.c.
Referenced by do_ssim360().
|
static |
Definition at line 716 of file vf_ssim360.c.
Referenced by get_projected_map().
Definition at line 748 of file vf_ssim360.c.
Referenced by get_projected_map().
Definition at line 755 of file vf_ssim360.c.
Referenced by get_projected_map().
|
static |
Definition at line 782 of file vf_ssim360.c.
Referenced by get_projected_map().
|
static |
Definition at line 832 of file vf_ssim360.c.
Referenced by get_cubemap32_map(), and get_rotated_cubemap_map().
Definition at line 872 of file vf_ssim360.c.
Referenced by get_projected_map().
|
static |
Definition at line 896 of file vf_ssim360.c.
Referenced by get_projected_map().
|
static |
Definition at line 949 of file vf_ssim360.c.
Referenced by generate_eye_tape_map().
|
static |
Definition at line 975 of file vf_ssim360.c.
Referenced by config_output().
|
static |
Definition at line 989 of file vf_ssim360.c.
Referenced by generate_eye_tape_map().
|
static |
Definition at line 1017 of file vf_ssim360.c.
Referenced by generate_tape_maps().
|
static |
Definition at line 1068 of file vf_ssim360.c.
Referenced by do_ssim360().
|
static |
Definition at line 1128 of file vf_ssim360.c.
Referenced by init().
|
static |
Definition at line 1250 of file vf_ssim360.c.
Referenced by init().
|
static |
Definition at line 1312 of file vf_ssim360.c.
|
static |
Definition at line 1342 of file vf_ssim360.c.
|
static |
Definition at line 1369 of file vf_ssim360.c.
Referenced by config_output().
|
static |
Definition at line 1547 of file vf_ssim360.c.
|
static |
Definition at line 1588 of file vf_ssim360.c.
|
static |
Definition at line 1657 of file vf_ssim360.c.
|
static |
Definition at line 1663 of file vf_ssim360.c.
|
static |
Definition at line 84 of file vf_ssim360.c.
Referenced by do_ssim360(), and uninit().
|
static |
Definition at line 205 of file vf_ssim360.c.
|
static |
Definition at line 1715 of file vf_ssim360.c.
|
static |
Definition at line 1727 of file vf_ssim360.c.
|
static |
Definition at line 1740 of file vf_ssim360.c.
const AVFilter ff_vf_ssim360 |
Definition at line 1748 of file vf_ssim360.c.