FFmpeg  2.6.9
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ivi_dsp.h
Go to the documentation of this file.
1 /*
2  * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
3  *
4  * Copyright (c) 2009-2011 Maxim Poliakovski
5  *
6  * This file is part of FFmpeg.
7  *
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.
12  *
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.
17  *
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
21  */
22 
23 /**
24  * @file
25  * DSP functions (inverse transforms, motion compensations, wavelet recompostion)
26  * for Indeo Video Interactive codecs.
27  */
28 
29 #ifndef AVCODEC_IVI_DSP_H
30 #define AVCODEC_IVI_DSP_H
31 
32 #include "avcodec.h"
33 #include "ivi_common.h"
34 
35 /**
36  * 5/3 wavelet recomposition filter for Indeo5
37  *
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  */
42 void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
43  const int dst_pitch);
44 
45 /**
46  * Haar wavelet recomposition filter for Indeo 4
47  *
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
51  */
52 void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
53  const int dst_pitch);
54 
55 /**
56  * two-dimensional inverse Haar 8x8 transform for Indeo 4
57  *
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)
64  */
65 void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
66  const uint8_t *flags);
67 void ff_ivi_inverse_haar_8x1(const int32_t *in, int16_t *out, uint32_t pitch,
68  const uint8_t *flags);
69 void ff_ivi_inverse_haar_1x8(const int32_t *in, int16_t *out, uint32_t pitch,
70  const uint8_t *flags);
71 
72 /**
73  * one-dimensional inverse 8-point Haar transform on rows for Indeo 4
74  *
75  * @param[in] in pointer to the vector of transform coefficients
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] flags pointer to the array of column flags:
79  * != 0 - non_empty column, 0 - empty one
80  * (this array must be filled by caller)
81  */
82 void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
83  const uint8_t *flags);
84 
85 /**
86  * one-dimensional inverse 8-point Haar transform on columns for Indeo 4
87  *
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:
92  * != 0 - non_empty column, 0 - empty one
93  * (this array must be filled by caller)
94  */
95 void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
96  const uint8_t *flags);
97 
98 /**
99  * two-dimensional inverse Haar 4x4 transform for Indeo 4
100  *
101  * @param[in] in pointer to the vector of transform coefficients
102  * @param[out] out pointer to the output buffer (frame)
103  * @param[in] pitch pitch to move to the next y line
104  * @param[in] flags pointer to the array of column flags:
105  * != 0 - non_empty column, 0 - empty one
106  * (this array must be filled by caller)
107  */
108 void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
109  const uint8_t *flags);
110 
111 /**
112  * one-dimensional inverse 4-point Haar transform on rows for Indeo 4
113  *
114  * @param[in] in pointer to the vector of transform coefficients
115  * @param[out] out pointer to the output buffer (frame)
116  * @param[in] pitch pitch to move to the next y line
117  * @param[in] flags pointer to the array of column flags:
118  * != 0 - non_empty column, 0 - empty one
119  * (this array must be filled by caller)
120  */
121 void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
122  const uint8_t *flags);
123 
124 /**
125  * one-dimensional inverse 4-point Haar transform on columns for Indeo 4
126  *
127  * @param[in] in pointer to the vector of transform coefficients
128  * @param[out] out pointer to the output buffer (frame)
129  * @param[in] pitch pitch to move to the next y line
130  * @param[in] flags pointer to the array of column flags:
131  * != 0 - non_empty column, 0 - empty one
132  * (this array must be filled by caller)
133  */
134 void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
135  const uint8_t *flags);
136 
137 /**
138  * DC-only two-dimensional inverse Haar transform for Indeo 4.
139  * Performing the inverse transform in this case is equivalent to
140  * spreading DC_coeff >> 3 over the whole block.
141  *
142  * @param[in] in pointer to the dc coefficient
143  * @param[out] out pointer to the output buffer (frame)
144  * @param[in] pitch pitch to move to the next y line
145  * @param[in] blk_size transform block size
146  */
147 void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
148  int blk_size);
149 
150 /**
151  * two-dimensional inverse slant 8x8 transform
152  *
153  * @param[in] in pointer to the vector of transform coefficients
154  * @param[out] out pointer to the output buffer (frame)
155  * @param[in] pitch pitch to move to the next y line
156  * @param[in] flags pointer to the array of column flags:
157  * != 0 - non_empty column, 0 - empty one
158  * (this array must be filled by caller)
159  */
160 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
161  const uint8_t *flags);
162 
163 /**
164  * two-dimensional inverse slant 4x4 transform
165  *
166  * @param[in] in pointer to the vector of transform coefficients
167  * @param[out] out pointer to the output buffer (frame)
168  * @param[in] pitch pitch to move to the next y line
169  * @param[in] flags pointer to the array of column flags:
170  * != 0 - non_empty column, 0 - empty one
171  * (this array must be filled by caller)
172  */
173 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
174  const uint8_t *flags);
175 
176 /**
177  * DC-only two-dimensional inverse slant transform.
178  * Performing the inverse slant transform in this case is equivalent to
179  * spreading (DC_coeff + 1)/2 over the whole block.
180  * It works much faster than performing the slant transform on a vector of zeroes.
181  *
182  * @param[in] in pointer to the dc coefficient
183  * @param[out] out pointer to the output buffer (frame)
184  * @param[in] pitch pitch to move to the next y line
185  * @param[in] blk_size transform block size
186  */
187 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
188 
189 /**
190  * inverse 1D row slant transform
191  *
192  * @param[in] in pointer to the vector of transform coefficients
193  * @param[out] out pointer to the output buffer (frame)
194  * @param[in] pitch pitch to move to the next y line
195  * @param[in] flags pointer to the array of column flags (unused here)
196  */
197 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
198  const uint8_t *flags);
199 
200 /**
201  * inverse 1D column slant transform
202  *
203  * @param[in] in pointer to the vector of transform coefficients
204  * @param[out] out pointer to the output buffer (frame)
205  * @param[in] pitch pitch to move to the next y line
206  * @param[in] flags pointer to the array of column flags:
207  * != 0 - non_empty column, 0 - empty one
208  * (this array must be filled by caller)
209  */
210 void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
211  const uint8_t *flags);
212 
213 /**
214  * inverse 1D row slant transform
215  *
216  * @param[in] in pointer to the vector of transform coefficients
217  * @param[out] out pointer to the output buffer (frame)
218  * @param[in] pitch pitch to move to the next y line
219  * @param[in] flags pointer to the array of column flags (unused here)
220  */
221 void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
222  const uint8_t *flags);
223 
224 /**
225  * inverse 1D column slant transform
226  *
227  * @param[in] in pointer to the vector of transform coefficients
228  * @param[out] out pointer to the output buffer (frame)
229  * @param[in] pitch pitch to move to the next y line
230  * @param[in] flags pointer to the array of column flags:
231  * != 0 - non_empty column, 0 - empty one
232  * (this array must be filled by caller)
233  */
234 void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
235  const uint8_t *flags);
236 
237 /**
238  * DC-only inverse row slant transform
239  */
240 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
241 
242 /**
243  * DC-only inverse column slant transform
244  */
245 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
246 
247 /**
248  * Copy the pixels into the frame buffer.
249  */
250 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
251 
252 /**
253  * Copy the DC coefficient into the first pixel of the block and
254  * zero all others.
255  */
256 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
257 
258 /**
259  * 8x8 block motion compensation with adding delta
260  *
261  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
262  * @param[in] ref_buf pointer to the corresponding block in the reference frame
263  * @param[in] pitch pitch for moving to the next y line
264  * @param[in] mc_type interpolation type
265  */
266 void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
267 
268 /**
269  * 4x4 block motion compensation with adding delta
270  *
271  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
272  * @param[in] ref_buf pointer to the corresponding block in the reference frame
273  * @param[in] pitch pitch for moving to the next y line
274  * @param[in] mc_type interpolation type
275  */
276 void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
277 
278 /**
279  * motion compensation without adding delta
280  *
281  * @param[in,out] buf pointer to the block in the current frame receiving the result
282  * @param[in] ref_buf pointer to the corresponding block in the reference frame
283  * @param[in] pitch pitch for moving to the next y line
284  * @param[in] mc_type interpolation type
285  */
286 void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
287 
288 /**
289  * 4x4 block motion compensation without adding delta
290  *
291  * @param[in,out] buf pointer to the block in the current frame receiving the result
292  * @param[in] ref_buf pointer to the corresponding block in the reference frame
293  * @param[in] pitch pitch for moving to the next y line
294  * @param[in] mc_type interpolation type
295  */
296 void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
297 
298 /**
299  * 8x8 block motion compensation with adding delta
300  *
301  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
302  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
303  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
304  * @param[in] pitch pitch for moving to the next y line
305  * @param[in] mc_type interpolation type for backward reference
306  * @param[in] mc_type2 interpolation type for forward reference
307  */
308 void ff_ivi_mc_avg_8x8_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2);
309 
310 /**
311  * 4x4 block motion compensation with adding delta
312  *
313  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
314  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
315  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
316  * @param[in] pitch pitch for moving to the next y line
317  * @param[in] mc_type interpolation type for backward reference
318  * @param[in] mc_type2 interpolation type for forward reference
319  */
320 void ff_ivi_mc_avg_4x4_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2);
321 
322 /**
323  * motion compensation without adding delta for B-frames
324  *
325  * @param[in,out] buf pointer to the block in the current frame receiving the result
326  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
327  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
328  * @param[in] pitch pitch for moving to the next y line
329  * @param[in] mc_type interpolation type for backward reference
330  * @param[in] mc_type2 interpolation type for forward reference
331  */
332 void ff_ivi_mc_avg_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2);
333 
334 /**
335  * 4x4 block motion compensation without adding delta for B-frames
336  *
337  * @param[in,out] buf pointer to the block in the current frame receiving the result
338  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
339  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
340  * @param[in] pitch pitch for moving to the next y line
341  * @param[in] mc_type interpolation type for backward reference
342  * @param[in] mc_type2 interpolation type for forward reference
343  */
344 void ff_ivi_mc_avg_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2);
345 
346 #endif /* AVCODEC_IVI_DSP_H */
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D column slant transform
Definition: ivi_dsp.c:667
void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
Copy the pixels into the frame buffer.
Definition: ivi_dsp.c:751
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type)
4x4 block motion compensation with adding delta
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D row slant transform
Definition: ivi_dsp.c:708
void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on rows for Indeo 4
Definition: ivi_dsp.c:426
void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
Copy the DC coefficient into the first pixel of the block and zero all others.
Definition: ivi_dsp.c:761
void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, const int dst_pitch)
5/3 wavelet recomposition filter for Indeo5
Definition: ivi_dsp.c:33
void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse slant 4x4 transform
Definition: ivi_dsp.c:576
void ff_ivi_mc_avg_8x8_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2)
8x8 block motion compensation with adding delta
uint8_t
void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 4x4 transform for Indeo 4
Definition: ivi_dsp.c:379
void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 8x8 transform for Indeo 4
Definition: ivi_dsp.c:270
void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type)
motion compensation without adding delta
void ff_ivi_inverse_haar_1x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
DC-only inverse row slant transform.
Definition: ivi_dsp.c:649
This file contains structures and macros shared by both Indeo4 and Indeo5 decoders.
int ref_buf
inter frame reference buffer index
Definition: ivi_common.h:236
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on rows for Indeo 4
Definition: ivi_dsp.c:325
void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type)
8x8 block motion compensation with adding delta
Libavcodec external API header.
void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
DC-only inverse column slant transform.
Definition: ivi_dsp.c:694
void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse slant 8x8 transform
Definition: ivi_dsp.c:536
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on columns for Indeo 4
Definition: ivi_dsp.c:350
void ff_ivi_mc_avg_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2)
4x4 block motion compensation without adding delta for B-frames
void ff_ivi_mc_avg_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2)
motion compensation without adding delta for B-frames
int32_t
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D row slant transform
Definition: ivi_dsp.c:629
void * buf
Definition: avisynth_c.h:595
void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
DC-only two-dimensional inverse slant transform.
Definition: ivi_dsp.c:616
void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, const int dst_pitch)
Haar wavelet recomposition filter for Indeo 4.
Definition: ivi_dsp.c:190
static int flags
Definition: cpu.c:47
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on columns for Indeo 4
Definition: ivi_dsp.c:448
void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type)
4x4 block motion compensation without adding delta
void ff_ivi_inverse_haar_8x1(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D column slant transform
Definition: ivi_dsp.c:728
void ff_ivi_mc_avg_4x4_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, uint32_t pitch, int mc_type, int mc_type2)
4x4 block motion compensation with adding delta
color plane (luma or chroma) information
Definition: ivi_common.h:195
BYTE int dst_pitch
Definition: avisynth_c.h:714
void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
DC-only two-dimensional inverse Haar transform for Indeo 4.
Definition: ivi_dsp.c:472