LCOV - code coverage report
Current view: top level - libavfilter/x86 - vf_removegrain_init.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 5 30 16.7 %
Date: 2017-10-24 00:14:43 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2015 James Darnley
       3             :  *
       4             :  * This file is part of FFmpeg.
       5             :  *
       6             :  * FFmpeg is free software; you can redistribute it and/or
       7             :  * modify it under the terms of the GNU Lesser General Public
       8             :  * License as published by the Free Software Foundation; either
       9             :  * version 2.1 of the License, or (at your option) any later version.
      10             :  *
      11             :  * FFmpeg is distributed in the hope that it will be useful,
      12             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      14             :  * Lesser General Public License for more details.
      15             :  *
      16             :  * You should have received a copy of the GNU Lesser General Public
      17             :  * License along with FFmpeg; if not, write to the Free Software
      18             :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
      19             :  */
      20             : 
      21             : #include "libavutil/attributes.h"
      22             : #include "libavutil/cpu.h"
      23             : #include "libavutil/x86/cpu.h"
      24             : #include "libavfilter/removegrain.h"
      25             : 
      26             : void ff_rg_fl_mode_1_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      27             : void ff_rg_fl_mode_10_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      28             : void ff_rg_fl_mode_11_12_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      29             : void ff_rg_fl_mode_13_14_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      30             : void ff_rg_fl_mode_19_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      31             : void ff_rg_fl_mode_20_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      32             : void ff_rg_fl_mode_21_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      33             : void ff_rg_fl_mode_22_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      34             : #if ARCH_X86_64
      35             : void ff_rg_fl_mode_2_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      36             : void ff_rg_fl_mode_3_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      37             : void ff_rg_fl_mode_4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      38             : void ff_rg_fl_mode_5_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      39             : void ff_rg_fl_mode_6_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      40             : void ff_rg_fl_mode_7_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      41             : void ff_rg_fl_mode_8_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      42             : void ff_rg_fl_mode_9_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      43             : void ff_rg_fl_mode_15_16_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      44             : void ff_rg_fl_mode_17_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      45             : void ff_rg_fl_mode_18_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      46             : void ff_rg_fl_mode_23_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      47             : void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
      48             : #endif
      49             : 
      50          25 : av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
      51             : {
      52             : #if CONFIG_GPL
      53          25 :     int cpu_flags = av_get_cpu_flags();
      54             :     int i;
      55             : 
      56         100 :     for (i = 0; i < rg->nb_planes; i++) {
      57          75 :         if (EXTERNAL_SSE2(cpu_flags))
      58           0 :             switch (rg->mode[i]) {
      59           0 :                 case 1: rg->fl[i] = ff_rg_fl_mode_1_sse2; break;
      60           0 :                 case 10: rg->fl[i] = ff_rg_fl_mode_10_sse2; break;
      61           0 :                 case 11: /* fall through */
      62           0 :                 case 12: rg->fl[i] = ff_rg_fl_mode_11_12_sse2; break;
      63           0 :                 case 13: /* fall through */
      64           0 :                 case 14: rg->fl[i] = ff_rg_fl_mode_13_14_sse2; break;
      65           0 :                 case 19: rg->fl[i] = ff_rg_fl_mode_19_sse2; break;
      66           0 :                 case 20: rg->fl[i] = ff_rg_fl_mode_20_sse2; break;
      67           0 :                 case 21: rg->fl[i] = ff_rg_fl_mode_21_sse2; break;
      68           0 :                 case 22: rg->fl[i] = ff_rg_fl_mode_22_sse2; break;
      69             : #if ARCH_X86_64
      70           0 :                 case 2: rg->fl[i] = ff_rg_fl_mode_2_sse2; break;
      71           0 :                 case 3: rg->fl[i] = ff_rg_fl_mode_3_sse2; break;
      72           0 :                 case 4: rg->fl[i] = ff_rg_fl_mode_4_sse2; break;
      73           0 :                 case 5: rg->fl[i] = ff_rg_fl_mode_5_sse2; break;
      74           0 :                 case 6: rg->fl[i] = ff_rg_fl_mode_6_sse2; break;
      75           0 :                 case 7: rg->fl[i] = ff_rg_fl_mode_7_sse2; break;
      76           0 :                 case 8: rg->fl[i] = ff_rg_fl_mode_8_sse2; break;
      77           0 :                 case 9: rg->fl[i] = ff_rg_fl_mode_9_sse2; break;
      78           0 :                 case 15: /* fall through */
      79           0 :                 case 16: rg->fl[i] = ff_rg_fl_mode_15_16_sse2; break;
      80           0 :                 case 17: rg->fl[i] = ff_rg_fl_mode_17_sse2; break;
      81           0 :                 case 18: rg->fl[i] = ff_rg_fl_mode_18_sse2; break;
      82           0 :                 case 23: rg->fl[i] = ff_rg_fl_mode_23_sse2; break;
      83           0 :                 case 24: rg->fl[i] = ff_rg_fl_mode_24_sse2; break;
      84             : #endif /* ARCH_x86_64 */
      85             :             }
      86             :     }
      87             : #endif /* CONFIG_GPL */
      88          25 : }

Generated by: LCOV version 1.13