From e8d277081293b6fb2a5d469616baaa7a06f52496 Mon Sep 17 00:00:00 2001 From: qinxialei Date: Thu, 29 Oct 2020 11:26:59 +0800 Subject: Import Upstream version 0.16.0 --- src/motion_vector.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/motion_vector.h (limited to 'src/motion_vector.h') diff --git a/src/motion_vector.h b/src/motion_vector.h new file mode 100644 index 0000000..d739e80 --- /dev/null +++ b/src/motion_vector.h @@ -0,0 +1,59 @@ +/* + * Copyright 2019 The libgav1 Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBGAV1_SRC_MOTION_VECTOR_H_ +#define LIBGAV1_SRC_MOTION_VECTOR_H_ + +#include +#include +#include + +#include "src/buffer_pool.h" +#include "src/obu_parser.h" +#include "src/tile.h" +#include "src/utils/array_2d.h" +#include "src/utils/constants.h" +#include "src/utils/types.h" + +namespace libgav1 { + +constexpr bool IsGlobalMvBlock(bool is_global_mv_block, + GlobalMotionTransformationType type) { + return is_global_mv_block && + type > kGlobalMotionTransformationTypeTranslation; +} + +// The |contexts| output parameter may be null. If the caller does not need +// the |contexts| output, pass nullptr as the argument. +void FindMvStack(const Tile::Block& block, bool is_compound, + MvContexts* contexts); // 7.10.2 + +void FindWarpSamples(const Tile::Block& block, int* num_warp_samples, + int* num_samples_scanned, + int candidates[kMaxLeastSquaresSamples][4]); // 7.10.4. + +// Section 7.9.1 in the spec. But this is done per tile instead of for the whole +// frame. +void SetupMotionField( + const ObuFrameHeader& frame_header, const RefCountedBuffer& current_frame, + const std::array& + reference_frames, + int row4x4_start, int row4x4_end, int column4x4_start, int column4x4_end, + TemporalMotionField* motion_field); + +} // namespace libgav1 + +#endif // LIBGAV1_SRC_MOTION_VECTOR_H_ -- cgit v1.2.3