提交 f912b14b 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!4675 fix bug

Merge pull request !4675 from fuzhiye/tmp
...@@ -296,16 +296,6 @@ int ConvolutionBaseCPUKernel::SetQuantParam() { ...@@ -296,16 +296,6 @@ int ConvolutionBaseCPUKernel::SetQuantParam() {
MS_LOG(ERROR) << "Set Output Tensor Quant Param Failed."; MS_LOG(ERROR) << "Set Output Tensor Quant Param Failed.";
return ret; return ret;
} }
ret = SetQuantMultiplier();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Set Quant Multiplier Failed.";
return ret;
}
// now only consider per tensor for output
CalculateActivationRangeQuantized(
conv_param_->is_relu_, conv_param_->is_relu6_, conv_param_->conv_quant_arg_.output_quant_args_[0].zp_,
conv_param_->conv_quant_arg_.output_quant_args_[0].scale_, &conv_param_->conv_quant_arg_.out_act_min_[0],
&conv_param_->conv_quant_arg_.out_act_max_[0]);
ret = SetIfPerChannel(); ret = SetIfPerChannel();
if (ret != RET_OK) { if (ret != RET_OK) {
...@@ -317,6 +307,18 @@ int ConvolutionBaseCPUKernel::SetQuantParam() { ...@@ -317,6 +307,18 @@ int ConvolutionBaseCPUKernel::SetQuantParam() {
MS_LOG(ERROR) << "Set if per asymmetric failed."; MS_LOG(ERROR) << "Set if per asymmetric failed.";
return ret; return ret;
} }
ret = SetQuantMultiplier();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Set Quant Multiplier Failed.";
return ret;
}
// now only consider per tensor for output
CalculateActivationRangeQuantized(
conv_param_->is_relu_, conv_param_->is_relu6_, conv_param_->conv_quant_arg_.output_quant_args_[0].zp_,
conv_param_->conv_quant_arg_.output_quant_args_[0].scale_, &conv_param_->conv_quant_arg_.out_act_min_[0],
&conv_param_->conv_quant_arg_.out_act_max_[0]);
return RET_OK; return RET_OK;
} }
} // namespace mindspore::kernel } // namespace mindspore::kernel
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "src/runtime/kernel/arm/fp16/convolution_fp16.h" #include "src/runtime/kernel/arm/fp16/convolution_fp16.h"
#include <vector> #include <vector>
#include "src/runtime/kernel/arm/fp16/convolution_sw_fp16.h" #include "src/runtime/kernel/arm/fp16/convolution_sw_fp16.h"
#include "src/runtime/kernel/arm/fp16/convolution_winograd_fp16.h"
#include "src/runtime/kernel/arm/fp16/convolution_3x3_fp16.h" #include "src/runtime/kernel/arm/fp16/convolution_3x3_fp16.h"
#include "src/runtime/kernel/arm/fp16/convolution_1x1_fp16.h" #include "src/runtime/kernel/arm/fp16/convolution_1x1_fp16.h"
#include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h" #include "src/runtime/kernel/arm/nnacl/fp16/conv_fp16.h"
...@@ -243,6 +244,10 @@ kernel::LiteKernel *CpuConvFp16KernelCreator(const std::vector<lite::tensor::Ten ...@@ -243,6 +244,10 @@ kernel::LiteKernel *CpuConvFp16KernelCreator(const std::vector<lite::tensor::Ten
InputTransformUnitFunc input_trans_func = nullptr; InputTransformUnitFunc input_trans_func = nullptr;
OutputTransformUnitFunc output_trans_func = nullptr; OutputTransformUnitFunc output_trans_func = nullptr;
CheckIfUseWinograd(&use_winograd, &out_unit, conv_param, input_trans_func, output_trans_func); CheckIfUseWinograd(&use_winograd, &out_unit, conv_param, input_trans_func, output_trans_func);
if (use_winograd) {
kernel = new (std::nothrow)
kernel::ConvolutionWinogradFP16CPUKernel(opParameter, inputs, outputs, ctx, primitive, out_unit);
}
if (kernel_h != 1 && kernel_w != 1 && !use_winograd) { if (kernel_h != 1 && kernel_w != 1 && !use_winograd) {
kernel = new (std::nothrow) kernel::ConvolutionFP16CPUKernel(opParameter, inputs, outputs, ctx, primitive); kernel = new (std::nothrow) kernel::ConvolutionFP16CPUKernel(opParameter, inputs, outputs, ctx, primitive);
} }
......
...@@ -51,7 +51,7 @@ int ConvolutionCPUKernel::InitWeightBias() { ...@@ -51,7 +51,7 @@ int ConvolutionCPUKernel::InitWeightBias() {
// #endif // #endif
int pack_weight_size = oc_block_num * oc_block * ic4 * C4NUM * kernel_plane; int pack_weight_size = oc_block_num * oc_block * ic4 * C4NUM * kernel_plane;
// init weight // =====================init weight==========================//
auto origin_weight = reinterpret_cast<float *>(in_tensors_.at(kWeightIndex)->Data()); auto origin_weight = reinterpret_cast<float *>(in_tensors_.at(kWeightIndex)->Data());
packed_weight_ = reinterpret_cast<float *>(malloc(pack_weight_size * sizeof(float))); packed_weight_ = reinterpret_cast<float *>(malloc(pack_weight_size * sizeof(float)));
if (packed_weight_ == nullptr) { if (packed_weight_ == nullptr) {
...@@ -61,7 +61,7 @@ int ConvolutionCPUKernel::InitWeightBias() { ...@@ -61,7 +61,7 @@ int ConvolutionCPUKernel::InitWeightBias() {
memset(packed_weight_, 0, pack_weight_size * sizeof(float)); memset(packed_weight_, 0, pack_weight_size * sizeof(float));
PackWeightFp32(origin_weight, conv_param_, packed_weight_, oc_block, oc_block_num); PackWeightFp32(origin_weight, conv_param_, packed_weight_, oc_block, oc_block_num);
// init bias // =======================init bias==========================//
bias_data_ = reinterpret_cast<float *>(malloc(oc_block_num * oc_block * sizeof(float))); bias_data_ = reinterpret_cast<float *>(malloc(oc_block_num * oc_block * sizeof(float)));
if (bias_data_ == nullptr) { if (bias_data_ == nullptr) {
MS_LOG(ERROR) << "malloc bias failed."; MS_LOG(ERROR) << "malloc bias failed.";
......
...@@ -633,7 +633,9 @@ void WinogradOutputTransformFp16(const float16_t *gemm_out, float16_t *tmp_out_d ...@@ -633,7 +633,9 @@ void WinogradOutputTransformFp16(const float16_t *gemm_out, float16_t *tmp_out_d
OutputTransformUnitFp16Func output_trans_func) { OutputTransformUnitFp16Func output_trans_func) {
int output_unit = conv_param->output_unit_; int output_unit = conv_param->output_unit_;
int output_w = conv_param->output_w_; int output_w = conv_param->output_w_;
int output_unit_block = UP_DIV(output_w, output_unit); int output_h = conv_param->output_h_;
int output_w_unit_block = UP_DIV(output_w, output_unit);
int output_h_unit_block = UP_DIV(output_h, output_unit);
int output_channel = conv_param->output_channel_; int output_channel = conv_param->output_channel_;
int oc8 = UP_DIV(output_channel, C8NUM); int oc8 = UP_DIV(output_channel, C8NUM);
int input_unit = conv_param->input_unit_; int input_unit = conv_param->input_unit_;
...@@ -644,16 +646,16 @@ void WinogradOutputTransformFp16(const float16_t *gemm_out, float16_t *tmp_out_d ...@@ -644,16 +646,16 @@ void WinogradOutputTransformFp16(const float16_t *gemm_out, float16_t *tmp_out_d
int dst_x_s = out_tile_index % output_unit_num; int dst_x_s = out_tile_index % output_unit_num;
int dst_y_s = out_tile_index / output_unit_num; int dst_y_s = out_tile_index / output_unit_num;
int src_tile_offset = i * oc8 * C8NUM * input_unit * input_unit; int src_tile_offset = i * oc8 * C8NUM * input_unit * input_unit;
int dst_tile_offset = C8NUM * output_unit * (dst_x_s + dst_y_s * output_unit_block * output_unit); int dst_tile_offset = C8NUM * output_unit * (dst_x_s + dst_y_s * output_w_unit_block * output_unit);
for (int j = 0; j < oc8; j++) { for (int j = 0; j < oc8; j++) {
int src_oc8_offset = src_tile_offset + j * input_unit * input_unit * C8NUM; int src_oc8_offset = src_tile_offset + j * input_unit * input_unit * C8NUM;
int dst_oc8_offset = int dst_oc8_offset =
dst_tile_offset + j * C8NUM * output_unit_block * output_unit_block * output_unit * output_unit; dst_tile_offset + j * C8NUM * output_h_unit_block * output_w_unit_block * output_unit * output_unit;
const float16_t *src_ptr = gemm_out + src_oc8_offset; const float16_t *src_ptr = gemm_out + src_oc8_offset;
const float16_t *bias_ptr = bias_data + j * C8NUM; const float16_t *bias_ptr = bias_data + j * C8NUM;
float16_t *dst_ptr = tmp_out_data + dst_oc8_offset; float16_t *dst_ptr = tmp_out_data + dst_oc8_offset;
output_trans_func(src_ptr, dst_ptr, bias_ptr, C8NUM, output_unit_block * output_unit); output_trans_func(src_ptr, dst_ptr, bias_ptr, C8NUM, output_w_unit_block * output_unit);
} }
out_tile_index++; out_tile_index++;
} }
......
...@@ -1066,7 +1066,7 @@ void OutputTransform4x3UnitFp16(const float16_t *src_data, float16_t *dst_data, ...@@ -1066,7 +1066,7 @@ void OutputTransform4x3UnitFp16(const float16_t *src_data, float16_t *dst_data,
const float16_t t10 = 0.5f * (src_data_10 - src_data_20); const float16_t t10 = 0.5f * (src_data_10 - src_data_20);
const float16_t t11 = 0.5f * (src_data_11 - src_data_21); const float16_t t11 = 0.5f * (src_data_11 - src_data_21);
const float16_t t12 = 0.5f * (src_data_12 - src_data_22); const float16_t t12 = 0.5f * (src_data_12 - src_data_22);
const const float16_t t13 = 0.5f * (src_data_13 - src_data_23); const float16_t t13 = 0.5f * (src_data_13 - src_data_23);
const float16_t t20 = 0.25f * (src_data_10 + src_data_20) + src_data_30; const float16_t t20 = 0.25f * (src_data_10 + src_data_20) + src_data_30;
const float16_t t21 = 0.25f * (src_data_11 + src_data_21) + src_data_31; const float16_t t21 = 0.25f * (src_data_11 + src_data_21) + src_data_31;
...@@ -2232,7 +2232,7 @@ void OutputTransform8x4UnitFp16(const float16_t *src_data, float16_t *dst_data, ...@@ -2232,7 +2232,7 @@ void OutputTransform8x4UnitFp16(const float16_t *src_data, float16_t *dst_data,
const float16_t t24 = 0.25f * d35 + d45 + 2.25f * d55; const float16_t t24 = 0.25f * d35 + d45 + 2.25f * d55;
const float16_t t25 = 0.25f * d36 + d46 + 2.25f * d56; const float16_t t25 = 0.25f * d36 + d46 + 2.25f * d56;
const float16_t t26 = 0.25f * d37 + d47 + 2.25f * d57; const float16_t t26 = 0.25f * d37 + d47 + 2.25f * d57;
const const float16_t t27 = 0.25f * d38 + d48 + 2.25f * d58; const float16_t t27 = 0.25f * d38 + d48 + 2.25f * d58;
const float16_t t30 = 0.125f * d01 + d11 + 3.375f * d21 + src_data_70; const float16_t t30 = 0.125f * d01 + d11 + 3.375f * d21 + src_data_70;
const float16_t t31 = 0.125f * d02 + d12 + 3.375f * d22 + src_data_71; const float16_t t31 = 0.125f * d02 + d12 + 3.375f * d22 + src_data_71;
...@@ -3392,7 +3392,7 @@ void OutputTransform8x6UnitFp16(const float16_t *src_data, float16_t *dst_data, ...@@ -3392,7 +3392,7 @@ void OutputTransform8x6UnitFp16(const float16_t *src_data, float16_t *dst_data,
const float16_t t52 = 0.03125f * d03 + d13 + 7.59375f * d23 + src_data_72; const float16_t t52 = 0.03125f * d03 + d13 + 7.59375f * d23 + src_data_72;
const float16_t t53 = 0.03125f * d04 + d14 + 7.59375f * d24 + src_data_73; const float16_t t53 = 0.03125f * d04 + d14 + 7.59375f * d24 + src_data_73;
const float16_t t54 = 0.03125f * d05 + d15 + 7.59375f * d25 + src_data_74; const float16_t t54 = 0.03125f * d05 + d15 + 7.59375f * d25 + src_data_74;
const const float16_t t55 = 0.03125f * d06 + d16 + 7.59375f * d26 + src_data_75; const float16_t t55 = 0.03125f * d06 + d16 + 7.59375f * d26 + src_data_75;
const float16_t t56 = 0.03125f * d07 + d17 + 7.59375f * d27 + src_data_76; const float16_t t56 = 0.03125f * d07 + d17 + 7.59375f * d27 + src_data_76;
const float16_t t57 = 0.03125f * d08 + d18 + 7.59375f * d28 + src_data_77; const float16_t t57 = 0.03125f * d08 + d18 + 7.59375f * d28 + src_data_77;
......
...@@ -325,7 +325,6 @@ void ConvInt8Opt(int8_t *input_data, int8_t *packed_input, int8_t *packed_weight ...@@ -325,7 +325,6 @@ void ConvInt8Opt(int8_t *input_data, int8_t *packed_input, int8_t *packed_weight
for (int thread_id = task_id; thread_id < output_tile_count; thread_id += thread_count) { for (int thread_id = task_id; thread_id < output_tile_count; thread_id += thread_count) {
int start_index = thread_id * tile_n; int start_index = thread_id * tile_n;
int real_cal_num = (output_count - start_index) < tile_n ? (output_count - start_index) : tile_n; int real_cal_num = (output_count - start_index) < tile_n ? (output_count - start_index) : tile_n;
// todo
int32_t *tmp_input_sum = input_sum + task_id * tile_n; int32_t *tmp_input_sum = input_sum + task_id * tile_n;
int8_t *gemm_input = packed_input + thread_id * unit_size * tile_n + gemm_in_batch_offset; int8_t *gemm_input = packed_input + thread_id * unit_size * tile_n + gemm_in_batch_offset;
// clear tmp buffer before compute // clear tmp buffer before compute
......
...@@ -295,12 +295,12 @@ void Im2ColPackUnitInt8(const int8_t *input_data, int8_t *packed_input, int real ...@@ -295,12 +295,12 @@ void Im2ColPackUnitInt8(const int8_t *input_data, int8_t *packed_input, int real
} // kernel_w loop } // kernel_w loop
} // kernel_h loop } // kernel_h loop
if (!(conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC)) { if (!(conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC)) {
return; continue;
} else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) && } else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) &&
(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) { (conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) {
int cal_num_offset = i * conv_param->output_channel_; int cal_num_offset = i * conv_param->output_channel_;
for (int l = 0; l < conv_param->output_channel_; ++l) { for (int l = 0; l < conv_param->output_channel_; ++l) {
input_sum[cal_num_offset + l] = input_accumulator * filter_arg[i].zp_; input_sum[cal_num_offset + l] = input_accumulator * filter_arg[l].zp_;
} }
} else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) && } else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) &&
!(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) { !(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) {
...@@ -367,12 +367,12 @@ void Im2ColPackUnitInt8Opt(const int8_t *input_data, int8_t *packed_input, int r ...@@ -367,12 +367,12 @@ void Im2ColPackUnitInt8Opt(const int8_t *input_data, int8_t *packed_input, int r
} }
} }
if (!(conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC)) { if (!(conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC)) {
return; continue;
} else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) && } else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) &&
(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) { (conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) {
int cal_num_offset = i * conv_param->output_channel_; int cal_num_offset = i * conv_param->output_channel_;
for (int l = 0; l < conv_param->output_channel_; ++l) { for (int l = 0; l < conv_param->output_channel_; ++l) {
input_sum[cal_num_offset + l] = input_accumulator * filter_arg[i].zp_; input_sum[cal_num_offset + l] = input_accumulator * filter_arg[l].zp_;
} }
} else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) && } else if ((conv_param->conv_quant_arg_.asymmetric_ & FILTER_ASYMMETRIC) &&
!(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) { !(conv_param->conv_quant_arg_.per_channel_ & FILTER_PER_CHANNEL)) {
...@@ -870,8 +870,8 @@ void PackNHWCToNCHWFp32(const void *src, void *dst, int batches, int plane, int ...@@ -870,8 +870,8 @@ void PackNHWCToNCHWFp32(const void *src, void *dst, int batches, int plane, int
int c8 = channel / C8NUM * C8NUM; int c8 = channel / C8NUM * C8NUM;
int batch = plane * channel; int batch = plane * channel;
for (int n = 0; n < batches; n++) { for (int n = 0; n < batches; n++) {
const float *src_batch = (const float*) src + n * batch; const float *src_batch = (const float *)src + n * batch;
float *dst_batch = (float*) dst + n * batch; float *dst_batch = (float *)dst + n * batch;
int hw = 0; int hw = 0;
for (; hw < hw8; hw += C8NUM) { for (; hw < hw8; hw += C8NUM) {
int c = 0; int c = 0;
...@@ -947,7 +947,8 @@ void PackNHWCToNCHWFp32(const void *src, void *dst, int batches, int plane, int ...@@ -947,7 +947,8 @@ void PackNHWCToNCHWFp32(const void *src, void *dst, int batches, int plane, int
"st1 {v30.4s, v31.4s}, [x11], %[dstStride]\n" "st1 {v30.4s, v31.4s}, [x11], %[dstStride]\n"
: :
: [ dst_ptr ] "r"(dst_ptr), [ src_ptr ] "r"(src_ptr), [ srcStride ] "r"(srcStride), [ dstStride ] "r"(dstStride) :
[ dst_ptr ] "r"(dst_ptr), [ src_ptr ] "r"(src_ptr), [ srcStride ] "r"(srcStride), [ dstStride ] "r"(dstStride)
: "x10", "x11", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", : "x10", "x11", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14",
"v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29",
"v30", "v31"); "v30", "v31");
......
...@@ -81,7 +81,9 @@ void WinogradOutputTransform(const float *gemm_out, float *tmp_out_data, const f ...@@ -81,7 +81,9 @@ void WinogradOutputTransform(const float *gemm_out, float *tmp_out_data, const f
OutputTransformUnitFunc output_trans_func) { OutputTransformUnitFunc output_trans_func) {
int output_unit = conv_param->output_unit_; int output_unit = conv_param->output_unit_;
int output_w = conv_param->output_w_; int output_w = conv_param->output_w_;
int output_unit_block = UP_DIV(output_w, output_unit); int output_h = conv_param->output_h_;
int output_w_unit_block = UP_DIV(output_w, output_unit);
int output_h_unit_block = UP_DIV(output_h, output_unit);
int output_channel = conv_param->output_channel_; int output_channel = conv_param->output_channel_;
int oc4 = UP_DIV(output_channel, C4NUM); int oc4 = UP_DIV(output_channel, C4NUM);
int input_unit = conv_param->input_unit_; int input_unit = conv_param->input_unit_;
...@@ -92,16 +94,16 @@ void WinogradOutputTransform(const float *gemm_out, float *tmp_out_data, const f ...@@ -92,16 +94,16 @@ void WinogradOutputTransform(const float *gemm_out, float *tmp_out_data, const f
int dst_x_s = out_tile_index % output_unit_num; int dst_x_s = out_tile_index % output_unit_num;
int dst_y_s = out_tile_index / output_unit_num; int dst_y_s = out_tile_index / output_unit_num;
int src_tile_offset = i * oc4 * C4NUM * input_unit * input_unit; int src_tile_offset = i * oc4 * C4NUM * input_unit * input_unit;
int dst_tile_offset = C4NUM * output_unit * (dst_x_s + dst_y_s * output_unit_block * output_unit); int dst_tile_offset = C4NUM * output_unit * (dst_x_s + dst_y_s * output_w_unit_block * output_unit);
for (int j = 0; j < oc4; j++) { for (int j = 0; j < oc4; j++) {
int src_oc4_offset = src_tile_offset + j * input_unit * input_unit * C4NUM; int src_oc4_offset = src_tile_offset + j * input_unit * input_unit * C4NUM;
int dst_oc4_offset = int dst_oc4_offset =
dst_tile_offset + j * C4NUM * output_unit_block * output_unit_block * output_unit * output_unit; dst_tile_offset + j * C4NUM * output_h_unit_block * output_w_unit_block * output_unit * output_unit;
const float *src_ptr = gemm_out + src_oc4_offset; const float *src_ptr = gemm_out + src_oc4_offset;
const float *bias_ptr = bias_data + j * C4NUM; const float *bias_ptr = bias_data + j * C4NUM;
float *dst_ptr = tmp_out_data + dst_oc4_offset; float *dst_ptr = tmp_out_data + dst_oc4_offset;
output_trans_func(src_ptr, dst_ptr, bias_ptr, C4NUM, output_unit_block * output_unit); output_trans_func(src_ptr, dst_ptr, bias_ptr, C4NUM, output_w_unit_block * output_unit);
} }
out_tile_index++; out_tile_index++;
} }
......
...@@ -1049,9 +1049,9 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step, ...@@ -1049,9 +1049,9 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step,
0.53333333333f * (src_data_54 + src_data_64); 0.53333333333f * (src_data_54 + src_data_64);
const float t35 = -0.3f * (src_data_15 + src_data_25) + 1.33333333333333f * (src_data_35 + src_data_45) - const float t35 = -0.3f * (src_data_15 + src_data_25) + 1.33333333333333f * (src_data_35 + src_data_45) -
0.53333333333f * (src_data_55 + src_data_65); 0.53333333333f * (src_data_55 + src_data_65);
const const float t36 = -0.3f * (src_data_16 + src_data_26) + 1.33333333333333f * (src_data_36 + src_data_46) - const float t36 = -0.3f * (src_data_16 + src_data_26) + 1.33333333333333f * (src_data_36 + src_data_46) -
0.53333333333f * (src_data_56 + src_data_66); 0.53333333333f * (src_data_56 + src_data_66);
const const float t37 = -0.3f * (src_data_17 + src_data_27) + 1.33333333333333f * (src_data_37 + src_data_47) - const float t37 = -0.3f * (src_data_17 + src_data_27) + 1.33333333333333f * (src_data_37 + src_data_47) -
0.53333333333f * (src_data_57 + src_data_67); 0.53333333333f * (src_data_57 + src_data_67);
const float t40 = 0.3f * (src_data_10 - src_data_20) + 1.33333333333333f * (src_data_40 - src_data_30) + const float t40 = 0.3f * (src_data_10 - src_data_20) + 1.33333333333333f * (src_data_40 - src_data_30) +
...@@ -1114,8 +1114,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step, ...@@ -1114,8 +1114,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step,
const float t76 = -0.5625f * src_data_16 + 3.0625f * src_data_36 - 3.5f * src_data_56 + src_data_76; const float t76 = -0.5625f * src_data_16 + 3.0625f * src_data_36 - 3.5f * src_data_56 + src_data_76;
const float t77 = -0.5625f * src_data_17 + 3.0625f * src_data_37 - 3.5f * src_data_57 + src_data_77; const float t77 = -0.5625f * src_data_17 + 3.0625f * src_data_37 - 3.5f * src_data_57 + src_data_77;
const float m00 = t00 - 5.444444444444444445125f * t02 + 6.222222222222222222223f * t04 - const float m00 =
1.77777777777777778f * t06; t00 - 5.444444444444444445125f * t02 + 6.222222222222222222223f * t04 - 1.77777777777777778f * t06;
const float m01 = 1.5f * t01 + 3.0f * t02 - 2.1666666666666667f * t03 - 4.333333333333333333f * t04 + const float m01 = 1.5f * t01 + 3.0f * t02 - 2.1666666666666667f * t03 - 4.333333333333333333f * t04 +
0.66666666666666667f * t05 + 1.333333333333333f * t06; 0.66666666666666667f * t05 + 1.333333333333333f * t06;
const float m02 = -1.5f * t01 + 3.0f * t02 + 2.1666666666666667f * t03 - 4.333333333333333333f * t04 - const float m02 = -1.5f * t01 + 3.0f * t02 + 2.1666666666666667f * t03 - 4.333333333333333333f * t04 -
...@@ -1141,8 +1141,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step, ...@@ -1141,8 +1141,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step,
0.1333333f * t15 + 0.0888888f * t16; 0.1333333f * t15 + 0.0888888f * t16;
const float m17 = -0.5625f * t11 + 3.0625f * t13 - 3.5f * t15 + t17; const float m17 = -0.5625f * t11 + 3.0625f * t13 - 3.5f * t15 + t17;
const float m20 = t20 - 5.444444444444444445125f * t22 + 6.222222222222222222223f * t24 - const float m20 =
1.77777777777777778f * t26; t20 - 5.444444444444444445125f * t22 + 6.222222222222222222223f * t24 - 1.77777777777777778f * t26;
const float m21 = 1.5f * t21 + 3.0f * t22 - 2.1666666666666667f * t23 - 4.333333333333333333f * t24 + const float m21 = 1.5f * t21 + 3.0f * t22 - 2.1666666666666667f * t23 - 4.333333333333333333f * t24 +
0.66666666666666667f * t25 + 1.333333333333333f * t26; 0.66666666666666667f * t25 + 1.333333333333333f * t26;
const float m22 = -1.5f * t21 + 3.0f * t22 + 2.1666666666666667f * t23 - 4.333333333333333333f * t24 - const float m22 = -1.5f * t21 + 3.0f * t22 + 2.1666666666666667f * t23 - 4.333333333333333333f * t24 -
...@@ -1168,8 +1168,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step, ...@@ -1168,8 +1168,8 @@ void InputTransform8x8Unit(const float *src_data, float *dst_data, int src_step,
0.1333333f * t35 + 0.0888888f * t36; 0.1333333f * t35 + 0.0888888f * t36;
const float m37 = -0.5625f * t31 + 3.0625f * t33 - 3.5f * t35 + t37; const float m37 = -0.5625f * t31 + 3.0625f * t33 - 3.5f * t35 + t37;
const float m40 = t40 - 5.444444444444444445125f * t42 + 6.222222222222222222223f * t44 - const float m40 =
1.77777777777777778f * t46; t40 - 5.444444444444444445125f * t42 + 6.222222222222222222223f * t44 - 1.77777777777777778f * t46;
const float m41 = 1.5f * t41 + 3.0f * t42 - 2.1666666666666667f * t43 - 4.333333333333333333f * t44 + const float m41 = 1.5f * t41 + 3.0f * t42 - 2.1666666666666667f * t43 - 4.333333333333333333f * t44 +
0.66666666666666667f * t45 + 1.333333333333333f * t46; 0.66666666666666667f * t45 + 1.333333333333333f * t46;
const float m42 = -1.5f * t41 + 3.0f * t42 + 2.1666666666666667f * t43 - 4.333333333333333333f * t44 - const float m42 = -1.5f * t41 + 3.0f * t42 + 2.1666666666666667f * t43 - 4.333333333333333333f * t44 -
...@@ -1460,7 +1460,7 @@ void OutputTransform4x3Unit(const float *src_data, float *dst_data, const float ...@@ -1460,7 +1460,7 @@ void OutputTransform4x3Unit(const float *src_data, float *dst_data, const float
const float t10 = 0.5f * (src_data_10 - src_data_20); const float t10 = 0.5f * (src_data_10 - src_data_20);
const float t11 = 0.5f * (src_data_11 - src_data_21); const float t11 = 0.5f * (src_data_11 - src_data_21);
const float t12 = 0.5f * (src_data_12 - src_data_22); const float t12 = 0.5f * (src_data_12 - src_data_22);
const const float t13 = 0.5f * (src_data_13 - src_data_23); const float t13 = 0.5f * (src_data_13 - src_data_23);
const float t20 = 0.25f * (src_data_10 + src_data_20) + src_data_30; const float t20 = 0.25f * (src_data_10 + src_data_20) + src_data_30;
const float t21 = 0.25f * (src_data_11 + src_data_21) + src_data_31; const float t21 = 0.25f * (src_data_11 + src_data_21) + src_data_31;
...@@ -2626,7 +2626,7 @@ void OutputTransform8x4Unit(const float *src_data, float *dst_data, const float ...@@ -2626,7 +2626,7 @@ void OutputTransform8x4Unit(const float *src_data, float *dst_data, const float
const float t24 = 0.25f * d35 + d45 + 2.25f * d55; const float t24 = 0.25f * d35 + d45 + 2.25f * d55;
const float t25 = 0.25f * d36 + d46 + 2.25f * d56; const float t25 = 0.25f * d36 + d46 + 2.25f * d56;
const float t26 = 0.25f * d37 + d47 + 2.25f * d57; const float t26 = 0.25f * d37 + d47 + 2.25f * d57;
const const float t27 = 0.25f * d38 + d48 + 2.25f * d58; const float t27 = 0.25f * d38 + d48 + 2.25f * d58;
const float t30 = 0.125f * d01 + d11 + 3.375f * d21 + src_data_70; const float t30 = 0.125f * d01 + d11 + 3.375f * d21 + src_data_70;
const float t31 = 0.125f * d02 + d12 + 3.375f * d22 + src_data_71; const float t31 = 0.125f * d02 + d12 + 3.375f * d22 + src_data_71;
...@@ -3786,7 +3786,7 @@ void OutputTransform8x6Unit(const float *src_data, float *dst_data, const float ...@@ -3786,7 +3786,7 @@ void OutputTransform8x6Unit(const float *src_data, float *dst_data, const float
const float t52 = 0.03125f * d03 + d13 + 7.59375f * d23 + src_data_72; const float t52 = 0.03125f * d03 + d13 + 7.59375f * d23 + src_data_72;
const float t53 = 0.03125f * d04 + d14 + 7.59375f * d24 + src_data_73; const float t53 = 0.03125f * d04 + d14 + 7.59375f * d24 + src_data_73;
const float t54 = 0.03125f * d05 + d15 + 7.59375f * d25 + src_data_74; const float t54 = 0.03125f * d05 + d15 + 7.59375f * d25 + src_data_74;
const const float t55 = 0.03125f * d06 + d16 + 7.59375f * d26 + src_data_75; const float t55 = 0.03125f * d06 + d16 + 7.59375f * d26 + src_data_75;
const float t56 = 0.03125f * d07 + d17 + 7.59375f * d27 + src_data_76; const float t56 = 0.03125f * d07 + d17 + 7.59375f * d27 + src_data_76;
const float t57 = 0.03125f * d08 + d18 + 7.59375f * d28 + src_data_77; const float t57 = 0.03125f * d08 + d18 + 7.59375f * d28 + src_data_77;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册