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_RECONSTRUCTION_H_ 18 #define LIBGAV1_SRC_RECONSTRUCTION_H_ 19 20 #include <cstdint> 21 22 #include "src/dsp/constants.h" 23 #include "src/dsp/dsp.h" 24 #include "src/utils/array_2d.h" 25 #include "src/utils/constants.h" 26 #include "src/utils/types.h" 27 28 namespace libgav1 { 29 30 // Steps 2 and 3 of section 7.12.3 (contains the implementation of section 31 // 7.13.3). 32 // Apply the inverse transforms and add the residual to the frame for the 33 // transform block size |tx_size| starting at position |start_x| and |start_y|. 34 template <typename Residual, typename Pixel> 35 void Reconstruct(const dsp::Dsp& dsp, TransformType tx_type, 36 TransformSize tx_size, bool lossless, Residual* buffer, 37 int start_x, int start_y, Array2DView<Pixel>* frame, 38 int non_zero_coeff_count); 39 40 extern template void Reconstruct(const dsp::Dsp& dsp, TransformType tx_type, 41 TransformSize tx_size, bool lossless, 42 int16_t* buffer, int start_x, int start_y, 43 Array2DView<uint8_t>* frame, 44 int non_zero_coeff_count); 45 #if LIBGAV1_MAX_BITDEPTH >= 10 46 extern template void Reconstruct(const dsp::Dsp& dsp, TransformType tx_type, 47 TransformSize tx_size, bool lossless, 48 int32_t* buffer, int start_x, int start_y, 49 Array2DView<uint16_t>* frame, 50 int non_zero_coeff_count); 51 #endif 52 53 } // namespace libgav1 54 #endif // LIBGAV1_SRC_RECONSTRUCTION_H_ 55