FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavfilter
dnn_backend_native.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Sergey Lavrushkin
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
/**
22
* @file
23
* DNN inference functions interface for native backend.
24
*/
25
26
27
#ifndef AVFILTER_DNN_BACKEND_NATIVE_H
28
#define AVFILTER_DNN_BACKEND_NATIVE_H
29
30
#include "
dnn_interface.h
"
31
#include "
libavformat/avio.h
"
32
33
typedef
enum
{
INPUT
,
CONV
,
DEPTH_TO_SPACE
}
DNNLayerType
;
34
35
typedef
enum
{
RELU
,
TANH
,
SIGMOID
}
DNNActivationFunc
;
36
37
typedef
struct
Layer
{
38
DNNLayerType
type
;
39
float
*
output
;
40
void
*
params
;
41
}
Layer
;
42
43
typedef
struct
ConvolutionalParams
{
44
int32_t
input_num
,
output_num
,
kernel_size
;
45
DNNActivationFunc
activation
;
46
float
*
kernel
;
47
float
*
biases
;
48
}
ConvolutionalParams
;
49
50
typedef
struct
InputParams
{
51
int
height
,
width
,
channels
;
52
}
InputParams
;
53
54
typedef
struct
DepthToSpaceParams
{
55
int
block_size
;
56
}
DepthToSpaceParams
;
57
58
// Represents simple feed-forward convolutional network.
59
typedef
struct
ConvolutionalNetwork
{
60
Layer
*
layers
;
61
int32_t
layers_num
;
62
}
ConvolutionalNetwork
;
63
64
DNNModel
*
ff_dnn_load_model_native
(
const
char
*model_filename);
65
66
DNNReturnType
ff_dnn_execute_model_native
(
const
DNNModel
*model);
67
68
void
ff_dnn_free_model_native
(
DNNModel
**model);
69
70
#endif
TANH
Definition:
dnn_backend_native.h:35
avio.h
Buffered I/O operations.
ConvolutionalParams::output_num
int32_t output_num
Definition:
dnn_backend_native.h:44
ConvolutionalParams::input_num
int32_t input_num
Definition:
dnn_backend_native.h:44
ConvolutionalParams::activation
DNNActivationFunc activation
Definition:
dnn_backend_native.h:45
RELU
Definition:
dnn_backend_native.h:35
Layer::output
float * output
Definition:
dnn_backend_native.h:39
InputParams::height
int height
Definition:
dnn_backend_native.h:51
InputParams
Definition:
dnn_backend_native.h:50
InputParams::width
int width
Definition:
dnn_backend_native.h:51
ConvolutionalParams::biases
float * biases
Definition:
dnn_backend_native.h:47
InputParams::channels
int channels
Definition:
dnn_backend_native.h:51
DEPTH_TO_SPACE
Definition:
dnn_backend_native.h:33
ConvolutionalNetwork::layers_num
int32_t layers_num
Definition:
dnn_backend_native.h:61
ConvolutionalNetwork
Definition:
dnn_backend_native.h:59
int32_t
int32_t
Definition:
audio_convert.c:194
dnn_interface.h
DNN inference engine interface.
DNNReturnType
DNNReturnType
Definition:
dnn_interface.h:29
DepthToSpaceParams
Definition:
dnn_backend_native.h:54
CONV
Definition:
dnn_backend_native.h:33
ff_dnn_load_model_native
DNNModel * ff_dnn_load_model_native(const char *model_filename)
Definition:
dnn_backend_native.c:96
ff_dnn_free_model_native
void ff_dnn_free_model_native(DNNModel **model)
Definition:
dnn_backend_native.c:328
DepthToSpaceParams::block_size
int block_size
Definition:
dnn_backend_native.h:55
ConvolutionalParams::kernel_size
int32_t kernel_size
Definition:
dnn_backend_native.h:44
ConvolutionalParams::kernel
float * kernel
Definition:
dnn_backend_native.h:46
Layer::type
DNNLayerType type
Definition:
dnn_backend_native.h:38
DNNLayerType
DNNLayerType
Definition:
dnn_backend_native.h:33
SIGMOID
Definition:
dnn_backend_native.h:35
DNNActivationFunc
DNNActivationFunc
Definition:
dnn_backend_native.h:35
ConvolutionalNetwork::layers
Layer * layers
Definition:
dnn_backend_native.h:60
ff_dnn_execute_model_native
DNNReturnType ff_dnn_execute_model_native(const DNNModel *model)
Definition:
dnn_backend_native.c:283
Layer::params
void * params
Definition:
dnn_backend_native.h:40
ConvolutionalParams
Definition:
dnn_backend_native.h:43
DNNModel
Definition:
dnn_interface.h:38
Layer
Definition:
dnn_backend_native.h:37
INPUT
Definition:
dnn_backend_native.h:33
Generated on Tue Nov 6 2018 18:11:21 for FFmpeg by
1.8.6