/src/libde265/libde265/fallback-dct.h
Line | Count | Source |
1 | | /* |
2 | | * H.265 video codec. |
3 | | * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> |
4 | | * |
5 | | * This file is part of libde265. |
6 | | * |
7 | | * libde265 is free software: you can redistribute it and/or modify |
8 | | * it under the terms of the GNU Lesser General Public License as |
9 | | * published by the Free Software Foundation, either version 3 of |
10 | | * the License, or (at your option) any later version. |
11 | | * |
12 | | * libde265 is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | * GNU Lesser General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU Lesser General Public License |
18 | | * along with libde265. If not, see <http://www.gnu.org/licenses/>. |
19 | | */ |
20 | | |
21 | | #ifndef FALLBACK_DCT_H |
22 | | #define FALLBACK_DCT_H |
23 | | |
24 | | #include <stddef.h> |
25 | | #include <stdint.h> |
26 | | |
27 | | #include "util.h" |
28 | | |
29 | | |
30 | | // --- decoding --- |
31 | | |
32 | | void transform_skip_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
33 | | void transform_bypass_fallback(int32_t *r, const int16_t *coeffs, int nT); |
34 | | |
35 | | void transform_skip_rdpcm_v_8_fallback(uint8_t *dst, const int16_t *coeffs, int nT, ptrdiff_t stride); |
36 | | void transform_skip_rdpcm_h_8_fallback(uint8_t *dst, const int16_t *coeffs, int nT, ptrdiff_t stride); |
37 | | void transform_bypass_rdpcm_v_fallback(int32_t *r, const int16_t *coeffs,int nT); |
38 | | void transform_bypass_rdpcm_h_fallback(int32_t *r, const int16_t *coeffs,int nT); |
39 | | |
40 | | void transform_4x4_luma_add_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
41 | | void transform_4x4_add_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
42 | | void transform_8x8_add_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
43 | | void transform_16x16_add_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
44 | | void transform_32x32_add_8_fallback(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride); |
45 | | |
46 | | |
47 | | void transform_skip_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
48 | | void transform_bypass_16_fallback(uint16_t *dst, const int16_t *coeffs, int nT, ptrdiff_t stride, int bit_depth); |
49 | | |
50 | | void transform_4x4_luma_add_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
51 | | void transform_4x4_add_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
52 | | void transform_8x8_add_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
53 | | void transform_16x16_add_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
54 | | void transform_32x32_add_16_fallback(uint16_t *dst, const int16_t *coeffs, ptrdiff_t stride, int bit_depth); |
55 | | |
56 | | void rotate_coefficients_fallback(int16_t *coeff, int nT); |
57 | | |
58 | | |
59 | | void transform_idst_4x4_fallback(int32_t *dst, const int16_t *coeffs, int bdShift, int max_coeff_bits); |
60 | | void transform_idct_4x4_fallback(int32_t *dst, const int16_t *coeffs, int bdShift, int max_coeff_bits); |
61 | | void transform_idct_8x8_fallback(int32_t *dst, const int16_t *coeffs, int bdShift, int max_coeff_bits); |
62 | | void transform_idct_16x16_fallback(int32_t *dst, const int16_t *coeffs, int bdShift, int max_coeff_bits); |
63 | | void transform_idct_32x32_fallback(int32_t *dst, const int16_t *coeffs, int bdShift, int max_coeff_bits); |
64 | | |
65 | | template <class pixel_t> |
66 | | void add_residual_fallback(pixel_t *dst, ptrdiff_t stride, |
67 | | const int32_t* r, int nT, int bit_depth) |
68 | 3.38M | { |
69 | 18.1M | for (int y=0;y<nT;y++) |
70 | 91.0M | for (int x=0;x<nT;x++) { |
71 | 76.2M | dst[y*stride+x] = Clip_BitDepth(dst[y*stride+x] + r[y*nT+x], bit_depth); |
72 | 76.2M | } |
73 | 3.38M | } void add_residual_fallback<unsigned char>(unsigned char*, long, int const*, int, int) Line | Count | Source | 68 | 1.67M | { | 69 | 9.31M | for (int y=0;y<nT;y++) | 70 | 50.2M | for (int x=0;x<nT;x++) { | 71 | 42.5M | dst[y*stride+x] = Clip_BitDepth(dst[y*stride+x] + r[y*nT+x], bit_depth); | 72 | 42.5M | } | 73 | 1.67M | } |
void add_residual_fallback<unsigned short>(unsigned short*, long, int const*, int, int) Line | Count | Source | 68 | 1.70M | { | 69 | 8.87M | for (int y=0;y<nT;y++) | 70 | 40.8M | for (int x=0;x<nT;x++) { | 71 | 33.6M | dst[y*stride+x] = Clip_BitDepth(dst[y*stride+x] + r[y*nT+x], bit_depth); | 72 | 33.6M | } | 73 | 1.70M | } |
|
74 | | |
75 | | |
76 | | void rdpcm_v_fallback(int32_t* residual, const int16_t* coeffs, int nT, int tsShift,int bdShift); |
77 | | void rdpcm_h_fallback(int32_t* residual, const int16_t* coeffs, int nT, int tsShift,int bdShift); |
78 | | |
79 | | void transform_skip_residual_fallback(int32_t *residual, const int16_t *coeffs, int nT, |
80 | | int tsShift,int bdShift); |
81 | | |
82 | | |
83 | | // --- encoding --- |
84 | | |
85 | | void fdst_4x4_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
86 | | void fdct_4x4_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
87 | | void fdct_8x8_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
88 | | void fdct_16x16_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
89 | | void fdct_32x32_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
90 | | |
91 | | void hadamard_4x4_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
92 | | void hadamard_8x8_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
93 | | void hadamard_16x16_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
94 | | void hadamard_32x32_8_fallback(int16_t *coeffs, const int16_t *input, ptrdiff_t stride); |
95 | | |
96 | | #endif |