Go to the documentation of this file.
57 int32_t input_operand_index = input_operand_indexes[0];
58 int number = operands[input_operand_index].
dims[0];
59 int height = operands[input_operand_index].
dims[1];
60 int width = operands[input_operand_index].
dims[2];
62 const float *
input = operands[input_operand_index].
data;
65 int new_channels =
channels / (block_size * block_size);
67 int by_linesize = output_linesize / block_size;
68 int x_linesize = new_channels * block_size;
70 DnnOperand *output_operand = &operands[output_operand_index];
71 output_operand->
dims[0] = number;
73 output_operand->
dims[2] =
width * block_size;
74 output_operand->
dims[3] = new_channels;
77 if (output_operand->
length <= 0) {
82 if (!output_operand->
data) {
88 for (y = 0; y <
height; ++y){
89 for (x = 0; x <
width; ++x){
90 for (by = 0; by < block_size; ++by){
91 for (bx = 0; bx < block_size; ++bx){
92 for (ch = 0; ch < new_channels; ++ch){
93 output[by * by_linesize + x * x_linesize + bx * new_channels + ch] =
input[ch];
95 input += new_channels;
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
int32_t ff_calculate_operand_data_length(const DnnOperand *oprd)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * data
data pointer with data length in bytes.
DNNDataType data_type
support different kinds of data type such as float, half float, int8 etc, first support float now.
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
int ff_dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
Load the Depth to Space Layer.
int32_t dims[4]
there are two memory layouts, NHWC or NCHW, so we use dims, dims[0] is Number.
unsigned int avio_rl32(AVIOContext *s)
int32_t output_operand_index
int32_t input_operand_indexes[4]
a layer can have multiple inputs and one output.
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
int ff_dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx)
Execute the Depth to Space Layer.