2 * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
4 * Copyright (c) 2009 Maxim Poliakovski
6 * This file is part of Libav.
8 * Libav 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 * Libav 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 Libav; 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 * two-dimensional inverse slant 8x8 transform
49 * @param[in] in pointer to the vector of transform coefficients
50 * @param[out] out pointer to the output buffer (frame)
51 * @param[in] pitch pitch to move to the next y line
52 * @param[in] flags pointer to the array of column flags:
53 * != 0 - non_empty column, 0 - empty one
54 * (this array must be filled by caller)
56 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
57 const uint8_t *flags);
60 * two-dimensional inverse slant 4x4 transform
62 * @param[in] in pointer to the vector of transform coefficients
63 * @param[out] out pointer to the output buffer (frame)
64 * @param[in] pitch pitch to move to the next y line
65 * @param[in] flags pointer to the array of column flags:
66 * != 0 - non_empty column, 0 - empty one
67 * (this array must be filled by caller)
69 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
70 const uint8_t *flags);
73 * DC-only two-dimensional inverse slant transform.
74 * Performing the inverse slant transform in this case is equivalent to
75 * spreading (DC_coeff + 1)/2 over the whole block.
76 * It works much faster than performing the slant transform on a vector of zeroes.
78 * @param[in] in pointer to the dc coefficient
79 * @param[out] out pointer to the output buffer (frame)
80 * @param[in] pitch pitch to move to the next y line
81 * @param[in] blk_size transform block size
83 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
86 * inverse 1D row slant transform
88 * @param[in] in pointer to the vector of transform coefficients
89 * @param[out] out pointer to the output buffer (frame)
90 * @param[in] pitch pitch to move to the next y line
91 * @param[in] flags pointer to the array of column flags (unused here)
93 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
94 const uint8_t *flags);
97 * inverse 1D column slant 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_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
107 const uint8_t *flags);
110 * DC-only inverse row slant transform
112 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
115 * DC-only inverse column slant transform
117 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
120 * Copy the pixels into the frame buffer.
122 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
125 * Copy the DC coefficient into the first pixel of the block and
128 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
131 * 8x8 block motion compensation with adding delta
133 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
134 * @param[in] ref_buf pointer to the corresponding block in the reference frame
135 * @param[in] pitch pitch for moving to the next y line
136 * @param[in] mc_type interpolation type
138 void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
141 * 4x4 block motion compensation with adding delta
143 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
144 * @param[in] ref_buf pointer to the corresponding block in the reference frame
145 * @param[in] pitch pitch for moving to the next y line
146 * @param[in] mc_type interpolation type
148 void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
151 * motion compensation without adding delta
153 * @param[in,out] buf pointer to the block in the current frame receiving the result
154 * @param[in] ref_buf pointer to the corresponding block in the reference frame
155 * @param[in] pitch pitch for moving to the next y line
156 * @param[in] mc_type interpolation type
158 void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
161 * 4x4 block motion compensation without adding delta
163 * @param[in,out] buf pointer to the block in the current frame receiving the result
164 * @param[in] ref_buf pointer to the corresponding block in the reference frame
165 * @param[in] pitch pitch for moving to the next y line
166 * @param[in] mc_type interpolation type
168 void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
170 #endif /* AVCODEC_IVI_DSP_H */