1 /* 2 * Copyright 2020 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_DSP_X86_CONVOLVE_AVX2_H_ 18 #define LIBGAV1_SRC_DSP_X86_CONVOLVE_AVX2_H_ 19 20 #include "src/dsp/dsp.h" 21 #include "src/utils/cpu.h" 22 23 namespace libgav1 { 24 namespace dsp { 25 26 // Initializes Dsp::convolve, see the defines below for specifics. This 27 // function is not thread-safe. 28 void ConvolveInit_AVX2(); 29 30 } // namespace dsp 31 } // namespace libgav1 32 33 // If avx2 is enabled and the baseline isn't set due to a higher level of 34 // optimization being enabled, signal the avx2 implementation should be used. 35 #if LIBGAV1_TARGETING_AVX2 36 37 #ifndef LIBGAV1_Dsp8bpp_ConvolveHorizontal 38 #define LIBGAV1_Dsp8bpp_ConvolveHorizontal LIBGAV1_CPU_AVX2 39 #endif 40 41 #ifndef LIBGAV1_Dsp8bpp_ConvolveCompoundHorizontal 42 #define LIBGAV1_Dsp8bpp_ConvolveCompoundHorizontal LIBGAV1_CPU_AVX2 43 #endif 44 45 #ifndef LIBGAV1_Dsp8bpp_ConvolveVertical 46 #define LIBGAV1_Dsp8bpp_ConvolveVertical LIBGAV1_CPU_AVX2 47 #endif 48 49 #ifndef LIBGAV1_Dsp8bpp_Convolve2D 50 #define LIBGAV1_Dsp8bpp_Convolve2D LIBGAV1_CPU_AVX2 51 #endif 52 53 #ifndef LIBGAV1_Dsp8bpp_ConvolveCompoundVertical 54 #define LIBGAV1_Dsp8bpp_ConvolveCompoundVertical LIBGAV1_CPU_AVX2 55 #endif 56 57 #endif // LIBGAV1_TARGETING_AVX2 58 59 #endif // LIBGAV1_SRC_DSP_X86_CONVOLVE_AVX2_H_ 60