1 /*
2 * Copyright (c) 2015-2016 Kieran Kunhya <kieran@kunhya.com>
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
23
25
27 const int16_t *low, ptrdiff_t low_stride,
28 const int16_t *high, ptrdiff_t high_stride,
30 {
33
34 tmp = (11*low[0*low_stride] - 4*low[1*low_stride] + low[2*low_stride] + 4) >> 3;
35 output[(2*0+0)*out_stride] = (
tmp + high[0*high_stride]) >> 1;
38
39 tmp = ( 5*low[0*low_stride] + 4*low[1*low_stride] - low[2*low_stride] + 4) >> 3;
40 output[(2*0+1)*out_stride] = (
tmp - high[0*high_stride]) >> 1;
43
44 for (
i = 1;
i <
len - 1;
i++) {
45 tmp = (low[(
i-1)*low_stride] - low[(
i+1)*low_stride] + 4) >> 3;
46 output[(2*
i+0)*out_stride] = (
tmp + low[
i*low_stride] + high[
i*high_stride]) >> 1;
49
50 tmp = (low[(
i+1)*low_stride] - low[(
i-1)*low_stride] + 4) >> 3;
51 output[(2*
i+1)*out_stride] = (
tmp + low[
i*low_stride] - high[
i*high_stride]) >> 1;
54 }
55
56 tmp = ( 5*low[
i*low_stride] + 4*low[(
i-1)*low_stride] - low[(
i-2)*low_stride] + 4) >> 3;
57 output[(2*
i+0)*out_stride] = (
tmp + high[
i*high_stride]) >> 1;
60
61 tmp = (11*low[
i*low_stride] - 4*low[(
i-1)*low_stride] + low[(
i-2)*low_stride] + 4) >> 3;
62 output[(2*
i+1)*out_stride] = (
tmp - high[
i*high_stride]) >> 1;
65 }
66
68 const int16_t *low, ptrdiff_t low_stride,
69 const int16_t *high, ptrdiff_t high_stride,
71 {
74 low++;
75 high++;
77 }
78 }
79
81 const int16_t *low, ptrdiff_t lstride,
82 const int16_t *high, ptrdiff_t hstride,
84 {
87 low += lstride;
88 high += hstride;
90 }
91 }
92
95 {
97 }
98
101 {
103 }
104
106 {
109
110 if (bayer)
112 else
114
115 #if ARCH_X86
117 #endif
118 }