2 * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
4 * Copyright (c) 2009-2011 Maxim Poliakovski
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * DSP functions (inverse transforms, motion compensations, wavelet recompostion)
26 * for Indeo Video Interactive codecs.
29 #ifndef AVCODEC_IVI_DSP_H
30 #define AVCODEC_IVI_DSP_H
33 #include "ivi_common.h"
36 * 5/3 wavelet recomposition filter for Indeo5
38 * @param[in] plane pointer to the descriptor of the plane being processed
39 * @param[out] dst pointer to the destination buffer
40 * @param[in] dst_pitch pitch of the destination buffer
41 * @param[in] num_bands number of wavelet bands to be processed
43 void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
44 const int dst_pitch, const int num_bands);
47 * Haar wavelet recomposition filter for Indeo 4
49 * @param[in] plane pointer to the descriptor of the plane being processed
50 * @param[out] dst pointer to the destination buffer
51 * @param[in] dst_pitch pitch of the destination buffer
52 * @param[in] num_bands number of wavelet bands to be processed
54 void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
55 const int dst_pitch, const int num_bands);
58 * two-dimensional inverse Haar 8x8 transform for Indeo 4
60 * @param[in] in pointer to the vector of transform coefficients
61 * @param[out] out pointer to the output buffer (frame)
62 * @param[in] pitch pitch to move to the next y line
63 * @param[in] flags pointer to the array of column flags:
64 * != 0 - non_empty column, 0 - empty one
65 * (this array must be filled by caller)
67 void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
68 const uint8_t *flags);
71 * DC-only two-dimensional inverse Haar transform for Indeo 4.
72 * Performing the inverse transform in this case is equivalent to
73 * spreading DC_coeff >> 3 over the whole block.
75 * @param[in] in pointer to the dc coefficient
76 * @param[out] out pointer to the output buffer (frame)
77 * @param[in] pitch pitch to move to the next y line
78 * @param[in] blk_size transform block size
80 void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
84 * two-dimensional inverse slant 8x8 transform
86 * @param[in] in pointer to the vector of transform coefficients
87 * @param[out] out pointer to the output buffer (frame)
88 * @param[in] pitch pitch to move to the next y line
89 * @param[in] flags pointer to the array of column flags:
90 * != 0 - non_empty column, 0 - empty one
91 * (this array must be filled by caller)
93 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
94 const uint8_t *flags);
97 * two-dimensional inverse slant 4x4 transform
99 * @param[in] in pointer to the vector of transform coefficients
100 * @param[out] out pointer to the output buffer (frame)
101 * @param[in] pitch pitch to move to the next y line
102 * @param[in] flags pointer to the array of column flags:
103 * != 0 - non_empty column, 0 - empty one
104 * (this array must be filled by caller)
106 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
107 const uint8_t *flags);
110 * DC-only two-dimensional inverse slant transform.
111 * Performing the inverse slant transform in this case is equivalent to
112 * spreading (DC_coeff + 1)/2 over the whole block.
113 * It works much faster than performing the slant transform on a vector of zeroes.
115 * @param[in] in pointer to the dc coefficient
116 * @param[out] out pointer to the output buffer (frame)
117 * @param[in] pitch pitch to move to the next y line
118 * @param[in] blk_size transform block size
120 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
123 * inverse 1D row slant transform
125 * @param[in] in pointer to the vector of transform coefficients
126 * @param[out] out pointer to the output buffer (frame)
127 * @param[in] pitch pitch to move to the next y line
128 * @param[in] flags pointer to the array of column flags (unused here)
130 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
131 const uint8_t *flags);
134 * inverse 1D column slant transform
136 * @param[in] in pointer to the vector of transform coefficients
137 * @param[out] out pointer to the output buffer (frame)
138 * @param[in] pitch pitch to move to the next y line
139 * @param[in] flags pointer to the array of column flags:
140 * != 0 - non_empty column, 0 - empty one
141 * (this array must be filled by caller)
143 void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
144 const uint8_t *flags);
147 * DC-only inverse row slant transform
149 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
152 * DC-only inverse column slant transform
154 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
157 * Copy the pixels into the frame buffer.
159 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
162 * Copy the DC coefficient into the first pixel of the block and
165 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
168 * 8x8 block motion compensation with adding delta
170 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
171 * @param[in] ref_buf pointer to the corresponding block in the reference frame
172 * @param[in] pitch pitch for moving to the next y line
173 * @param[in] mc_type interpolation type
175 void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
178 * 4x4 block motion compensation with adding delta
180 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
181 * @param[in] ref_buf pointer to the corresponding block in the reference frame
182 * @param[in] pitch pitch for moving to the next y line
183 * @param[in] mc_type interpolation type
185 void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
188 * motion compensation without adding delta
190 * @param[in,out] buf pointer to the block in the current frame receiving the result
191 * @param[in] ref_buf pointer to the corresponding block in the reference frame
192 * @param[in] pitch pitch for moving to the next y line
193 * @param[in] mc_type interpolation type
195 void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
198 * 4x4 block motion compensation without adding delta
200 * @param[in,out] buf pointer to the block in the current frame receiving the result
201 * @param[in] ref_buf pointer to the corresponding block in the reference frame
202 * @param[in] pitch pitch for moving to the next y line
203 * @param[in] mc_type interpolation type
205 void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
207 #endif /* AVCODEC_IVI_DSP_H */