asfdec: also read Metadata Library Object
[FFMpeg-mirror/mplayer-patches.git] / libavcodec / ivi_dsp.h
blobc46f8b2d8daa1e2aaf6728c4ae8f03efdc42566d
1 /*
2 * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
4 * Copyright (c) 2009-2011 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
23 /**
24 * @file
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
32 #include "avcodec.h"
33 #include "ivi_common.h"
35 /**
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
42 void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
43 const int dst_pitch);
45 /**
46 * Haar wavelet recomposition filter for Indeo 4
48 * @param[in] plane pointer to the descriptor of the plane being processed
49 * @param[out] dst pointer to the destination buffer
50 * @param[in] dst_pitch pitch of the destination buffer
52 void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
53 const int dst_pitch);
55 /**
56 * two-dimensional inverse Haar 8x8 transform for Indeo 4
58 * @param[in] in pointer to the vector of transform coefficients
59 * @param[out] out pointer to the output buffer (frame)
60 * @param[in] pitch pitch to move to the next y line
61 * @param[in] flags pointer to the array of column flags:
62 * != 0 - non_empty column, 0 - empty one
63 * (this array must be filled by caller)
65 void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
66 const uint8_t *flags);
68 /**
69 * DC-only two-dimensional inverse Haar transform for Indeo 4.
70 * Performing the inverse transform in this case is equivalent to
71 * spreading DC_coeff >> 3 over the whole block.
73 * @param[in] in pointer to the dc coefficient
74 * @param[out] out pointer to the output buffer (frame)
75 * @param[in] pitch pitch to move to the next y line
76 * @param[in] blk_size transform block size
78 void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
79 int blk_size);
81 /**
82 * two-dimensional inverse slant 8x8 transform
84 * @param[in] in pointer to the vector of transform coefficients
85 * @param[out] out pointer to the output buffer (frame)
86 * @param[in] pitch pitch to move to the next y line
87 * @param[in] flags pointer to the array of column flags:
88 * != 0 - non_empty column, 0 - empty one
89 * (this array must be filled by caller)
91 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
92 const uint8_t *flags);
94 /**
95 * two-dimensional inverse slant 4x4 transform
97 * @param[in] in pointer to the vector of transform coefficients
98 * @param[out] out pointer to the output buffer (frame)
99 * @param[in] pitch pitch to move to the next y line
100 * @param[in] flags pointer to the array of column flags:
101 * != 0 - non_empty column, 0 - empty one
102 * (this array must be filled by caller)
104 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
105 const uint8_t *flags);
108 * DC-only two-dimensional inverse slant transform.
109 * Performing the inverse slant transform in this case is equivalent to
110 * spreading (DC_coeff + 1)/2 over the whole block.
111 * It works much faster than performing the slant transform on a vector of zeroes.
113 * @param[in] in pointer to the dc coefficient
114 * @param[out] out pointer to the output buffer (frame)
115 * @param[in] pitch pitch to move to the next y line
116 * @param[in] blk_size transform block size
118 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
121 * inverse 1D row slant transform
123 * @param[in] in pointer to the vector of transform coefficients
124 * @param[out] out pointer to the output buffer (frame)
125 * @param[in] pitch pitch to move to the next y line
126 * @param[in] flags pointer to the array of column flags (unused here)
128 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
129 const uint8_t *flags);
132 * inverse 1D column slant transform
134 * @param[in] in pointer to the vector of transform coefficients
135 * @param[out] out pointer to the output buffer (frame)
136 * @param[in] pitch pitch to move to the next y line
137 * @param[in] flags pointer to the array of column flags:
138 * != 0 - non_empty column, 0 - empty one
139 * (this array must be filled by caller)
141 void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
142 const uint8_t *flags);
145 * DC-only inverse row slant transform
147 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
150 * DC-only inverse column slant transform
152 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
155 * Copy the pixels into the frame buffer.
157 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
160 * Copy the DC coefficient into the first pixel of the block and
161 * zero all others.
163 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
166 * 8x8 block motion compensation with adding delta
168 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
169 * @param[in] ref_buf pointer to the corresponding block in the reference frame
170 * @param[in] pitch pitch for moving to the next y line
171 * @param[in] mc_type interpolation type
173 void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
176 * 4x4 block motion compensation with adding delta
178 * @param[in,out] buf pointer to the block in the current frame buffer containing delta
179 * @param[in] ref_buf pointer to the corresponding block in the reference frame
180 * @param[in] pitch pitch for moving to the next y line
181 * @param[in] mc_type interpolation type
183 void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
186 * motion compensation without adding delta
188 * @param[in,out] buf pointer to the block in the current frame receiving the result
189 * @param[in] ref_buf pointer to the corresponding block in the reference frame
190 * @param[in] pitch pitch for moving to the next y line
191 * @param[in] mc_type interpolation type
193 void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
196 * 4x4 block motion compensation without adding delta
198 * @param[in,out] buf pointer to the block in the current frame receiving the result
199 * @param[in] ref_buf pointer to the corresponding block in the reference frame
200 * @param[in] pitch pitch for moving to the next y line
201 * @param[in] mc_type interpolation type
203 void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
205 #endif /* AVCODEC_IVI_DSP_H */