FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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 <stdint.h>
33 
34 #include "ivi.h"
35 
36 /**
37  * 5/3 wavelet recomposition filter for Indeo5
38  *
39  * @param[in] plane pointer to the descriptor of the plane being processed
40  * @param[out] dst pointer to the destination buffer
41  * @param[in] dst_pitch pitch of the destination buffer
42  */
44  const int dst_pitch);
45 
46 /**
47  * Haar wavelet recomposition filter for Indeo 4
48  *
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  */
54  const int dst_pitch);
55 
56 /**
57  * two-dimensional inverse Haar 8x8 transform for Indeo 4
58  *
59  * @param[in] in pointer to the vector of transform coefficients
60  * @param[out] out pointer to the output buffer (frame)
61  * @param[in] pitch pitch to move to the next y line
62  * @param[in] flags pointer to the array of column flags:
63  * != 0 - non_empty column, 0 - empty one
64  * (this array must be filled by caller)
65  */
66 void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
67  const uint8_t *flags);
68 void ff_ivi_inverse_haar_8x1(const int32_t *in, int16_t *out, uint32_t pitch,
69  const uint8_t *flags);
70 void ff_ivi_inverse_haar_1x8(const int32_t *in, int16_t *out, uint32_t pitch,
71  const uint8_t *flags);
72 
73 /**
74  * one-dimensional inverse 8-point Haar transform on rows for Indeo 4
75  *
76  * @param[in] in pointer to the vector of transform coefficients
77  * @param[out] out pointer to the output buffer (frame)
78  * @param[in] pitch pitch to move to the next y line
79  * @param[in] flags pointer to the array of column flags:
80  * != 0 - non_empty column, 0 - empty one
81  * (this array must be filled by caller)
82  */
83 void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
84  const uint8_t *flags);
85 
86 /**
87  * one-dimensional inverse 8-point Haar transform on columns for Indeo 4
88  *
89  * @param[in] in pointer to the vector of transform coefficients
90  * @param[out] out pointer to the output buffer (frame)
91  * @param[in] pitch pitch to move to the next y line
92  * @param[in] flags pointer to the array of column flags:
93  * != 0 - non_empty column, 0 - empty one
94  * (this array must be filled by caller)
95  */
96 void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
97  const uint8_t *flags);
98 
99 /**
100  * two-dimensional inverse Haar 4x4 transform for Indeo 4
101  *
102  * @param[in] in pointer to the vector of transform coefficients
103  * @param[out] out pointer to the output buffer (frame)
104  * @param[in] pitch pitch to move to the next y line
105  * @param[in] flags pointer to the array of column flags:
106  * != 0 - non_empty column, 0 - empty one
107  * (this array must be filled by caller)
108  */
109 void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
110  const uint8_t *flags);
111 
112 /**
113  * one-dimensional inverse 4-point Haar transform on rows for Indeo 4
114  *
115  * @param[in] in pointer to the vector of transform coefficients
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] flags pointer to the array of column flags:
119  * != 0 - non_empty column, 0 - empty one
120  * (this array must be filled by caller)
121  */
122 void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
123  const uint8_t *flags);
124 
125 /**
126  * one-dimensional inverse 4-point Haar transform on columns for Indeo 4
127  *
128  * @param[in] in pointer to the vector of transform coefficients
129  * @param[out] out pointer to the output buffer (frame)
130  * @param[in] pitch pitch to move to the next y line
131  * @param[in] flags pointer to the array of column flags:
132  * != 0 - non_empty column, 0 - empty one
133  * (this array must be filled by caller)
134  */
135 void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
136  const uint8_t *flags);
137 
138 /**
139  * DC-only two-dimensional inverse Haar transform for Indeo 4.
140  * Performing the inverse transform in this case is equivalent to
141  * spreading DC_coeff >> 3 over the whole block.
142  *
143  * @param[in] in pointer to the dc coefficient
144  * @param[out] out pointer to the output buffer (frame)
145  * @param[in] pitch pitch to move to the next y line
146  * @param[in] blk_size transform block size
147  */
148 void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
149  int blk_size);
150 
151 /**
152  * two-dimensional inverse slant 8x8 transform
153  *
154  * @param[in] in pointer to the vector of transform coefficients
155  * @param[out] out pointer to the output buffer (frame)
156  * @param[in] pitch pitch to move to the next y line
157  * @param[in] flags pointer to the array of column flags:
158  * != 0 - non_empty column, 0 - empty one
159  * (this array must be filled by caller)
160  */
161 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
162  const uint8_t *flags);
163 
164 /**
165  * two-dimensional inverse slant 4x4 transform
166  *
167  * @param[in] in pointer to the vector of transform coefficients
168  * @param[out] out pointer to the output buffer (frame)
169  * @param[in] pitch pitch to move to the next y line
170  * @param[in] flags pointer to the array of column flags:
171  * != 0 - non_empty column, 0 - empty one
172  * (this array must be filled by caller)
173  */
174 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
175  const uint8_t *flags);
176 
177 /**
178  * DC-only two-dimensional inverse slant transform.
179  * Performing the inverse slant transform in this case is equivalent to
180  * spreading (DC_coeff + 1)/2 over the whole block.
181  * It works much faster than performing the slant transform on a vector of zeroes.
182  *
183  * @param[in] in pointer to the dc coefficient
184  * @param[out] out pointer to the output buffer (frame)
185  * @param[in] pitch pitch to move to the next y line
186  * @param[in] blk_size transform block size
187  */
188 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
189 
190 /**
191  * inverse 1D row slant transform
192  *
193  * @param[in] in pointer to the vector of transform coefficients
194  * @param[out] out pointer to the output buffer (frame)
195  * @param[in] pitch pitch to move to the next y line
196  * @param[in] flags pointer to the array of column flags (unused here)
197  */
198 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
199  const uint8_t *flags);
200 
201 /**
202  * inverse 1D column slant transform
203  *
204  * @param[in] in pointer to the vector of transform coefficients
205  * @param[out] out pointer to the output buffer (frame)
206  * @param[in] pitch pitch to move to the next y line
207  * @param[in] flags pointer to the array of column flags:
208  * != 0 - non_empty column, 0 - empty one
209  * (this array must be filled by caller)
210  */
211 void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
212  const uint8_t *flags);
213 
214 /**
215  * inverse 1D row slant transform
216  *
217  * @param[in] in pointer to the vector of transform coefficients
218  * @param[out] out pointer to the output buffer (frame)
219  * @param[in] pitch pitch to move to the next y line
220  * @param[in] flags pointer to the array of column flags (unused here)
221  */
222 void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
223  const uint8_t *flags);
224 
225 /**
226  * inverse 1D column slant transform
227  *
228  * @param[in] in pointer to the vector of transform coefficients
229  * @param[out] out pointer to the output buffer (frame)
230  * @param[in] pitch pitch to move to the next y line
231  * @param[in] flags pointer to the array of column flags:
232  * != 0 - non_empty column, 0 - empty one
233  * (this array must be filled by caller)
234  */
235 void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
236  const uint8_t *flags);
237 
238 /**
239  * DC-only inverse row slant transform
240  */
241 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
242 
243 /**
244  * DC-only inverse column slant transform
245  */
246 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
247 
248 /**
249  * Copy the pixels into the frame buffer.
250  */
251 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
252 
253 /**
254  * Copy the DC coefficient into the first pixel of the block and
255  * zero all others.
256  */
257 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
258 
259 /**
260  * 8x8 block motion compensation with adding delta
261  *
262  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
263  * @param[in] ref_buf pointer to the corresponding block in the reference frame
264  * @param[in] pitch pitch for moving to the next y line
265  * @param[in] mc_type interpolation type
266  */
267 void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
268 
269 /**
270  * 4x4 block motion compensation with adding delta
271  *
272  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
273  * @param[in] ref_buf pointer to the corresponding block in the reference frame
274  * @param[in] pitch pitch for moving to the next y line
275  * @param[in] mc_type interpolation type
276  */
277 void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
278 
279 /**
280  * motion compensation without adding delta
281  *
282  * @param[in,out] buf pointer to the block in the current frame receiving the result
283  * @param[in] ref_buf pointer to the corresponding block in the reference frame
284  * @param[in] pitch pitch for moving to the next y line
285  * @param[in] mc_type interpolation type
286  */
287 void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
288 
289 /**
290  * 4x4 block motion compensation without adding delta
291  *
292  * @param[in,out] buf pointer to the block in the current frame receiving the result
293  * @param[in] ref_buf pointer to the corresponding block in the reference frame
294  * @param[in] pitch pitch for moving to the next y line
295  * @param[in] mc_type interpolation type
296  */
297 void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
298 
299 /**
300  * 8x8 block motion compensation with adding delta
301  *
302  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
303  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
304  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
305  * @param[in] pitch pitch for moving to the next y line
306  * @param[in] mc_type interpolation type for backward reference
307  * @param[in] mc_type2 interpolation type for forward reference
308  */
309 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);
310 
311 /**
312  * 4x4 block motion compensation with adding delta
313  *
314  * @param[in,out] buf pointer to the block in the current frame buffer containing delta
315  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
316  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
317  * @param[in] pitch pitch for moving to the next y line
318  * @param[in] mc_type interpolation type for backward reference
319  * @param[in] mc_type2 interpolation type for forward reference
320  */
321 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);
322 
323 /**
324  * motion compensation without adding delta for B-frames
325  *
326  * @param[in,out] buf pointer to the block in the current frame receiving the result
327  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
328  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
329  * @param[in] pitch pitch for moving to the next y line
330  * @param[in] mc_type interpolation type for backward reference
331  * @param[in] mc_type2 interpolation type for forward reference
332  */
333 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);
334 
335 /**
336  * 4x4 block motion compensation without adding delta for B-frames
337  *
338  * @param[in,out] buf pointer to the block in the current frame receiving the result
339  * @param[in] ref_buf pointer to the corresponding block in the backward reference frame
340  * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame
341  * @param[in] pitch pitch for moving to the next y line
342  * @param[in] mc_type interpolation type for backward reference
343  * @param[in] mc_type2 interpolation type for forward reference
344  */
345 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);
346 
347 #endif /* AVCODEC_IVI_DSP_H */
int plane
Definition: avisynth_c.h:291
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
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
int ref_buf
inter frame reference buffer index
Definition: ivi.h:236
This file contains structures and macros shared by both Indeo4 and Indeo5 decoders.
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
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
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_log(ac->avr, AV_LOG_TRACE,"%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 * buf
Definition: avisynth_c.h:553
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
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
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_log(ac->avr, AV_LOG_TRACE,"%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_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.h:195
BYTE int dst_pitch
Definition: avisynth_c.h:676
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