1 /* 2 * Copyright 2019 The libgav1 Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef LIBGAV1_SRC_WARP_PREDICTION_H_ 18 #define LIBGAV1_SRC_WARP_PREDICTION_H_ 19 20 #include "src/obu_parser.h" 21 #include "src/utils/constants.h" 22 #include "src/utils/types.h" 23 24 namespace libgav1 { 25 26 // Sets the alpha, beta, gamma, delta fields in warp_params using the 27 // warp_params->params array as input (only array entries at indexes 2, 3, 4, 28 // 5 are used). Returns whether alpha, beta, gamma, delta are valid. 29 bool SetupShear(GlobalMotion* warp_params); // 7.11.3.6. 30 31 // Computes local warp parameters by performing a least square fit. 32 // Returns whether the computed parameters are valid. 33 bool WarpEstimation(int num_samples, int block_width4x4, int block_height4x4, 34 int row4x4, int column4x4, const MotionVector& mv, 35 const int candidates[kMaxLeastSquaresSamples][4], 36 GlobalMotion* warp_params); // 7.11.3.8. 37 38 } // namespace libgav1 39 40 #endif // LIBGAV1_SRC_WARP_PREDICTION_H_ 41