37 int32_t p0, p1, p2, p3, tmp0, tmp1, tmp2;
38 int32_t b0_1, b0_2, b1_1, b1_2, b1_3, b2_1, b2_2, b2_3, b2_4, b2_5, b2_6;
39 int32_t b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9;
40 ptrdiff_t pitch, back_pitch;
41 const short *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
42 const int num_bands = 4;
56 for (y = 0; y < plane->
height; y += 2) {
67 b1_1 = b1_ptr[back_pitch];
69 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch];
80 b3_2 = b3_ptr[back_pitch];
84 b3_8 = b3_2 - b3_5*6 + b3_ptr[pitch];
88 for (x = 0, indx = 0; x < plane->
width; x+=2, indx++) {
89 if (x+2 >= plane->
width) {
109 p0 = p1 = p2 = p3 = 0;
115 b0_1 = b0_ptr[indx+1];
116 b0_2 = b0_ptr[pitch+indx+1];
121 p2 = (tmp0 + tmp2) * 8;
122 p3 = (tmp1 + tmp2 + b0_2) * 4;
129 b1_2 = b1_ptr[indx+1];
130 b1_1 = b1_ptr[back_pitch+indx+1];
132 tmp2 = tmp1 - tmp0*6 + b1_3;
133 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch+indx+1];
135 p0 += (tmp0 + tmp1) * 8;
136 p1 += (tmp0 + tmp1 + b1_1 + b1_2) * 4;
138 p3 += (tmp2 + b1_3) * 2;
143 b2_3 = b2_ptr[indx+1];
144 b2_6 = b2_ptr[pitch+indx+1];
147 tmp1 = b2_1 - b2_2*6 + b2_3;
151 p2 += (tmp0 + b2_4 + b2_5) * 4;
152 p3 += (tmp1 + b2_4 - b2_5*6 + b2_6) * 2;
157 b3_6 = b3_ptr[indx+1];
158 b3_3 = b3_ptr[back_pitch+indx+1];
164 b3_9 = b3_3 - b3_6*6 + b3_ptr[pitch+indx+1];
166 p0 += (tmp0 + tmp1) * 4;
167 p1 += (tmp0 - tmp1*6 + tmp2) * 2;
168 p2 += (b3_7 + b3_8) * 2;
169 p3 += b3_7 - b3_8*6 + b3_9;
173 dst[x] = av_clip_uint8((p0 >> 6) + 128);
174 dst[x+1] = av_clip_uint8((p1 >> 6) + 128);
175 dst[dst_pitch+x] = av_clip_uint8((p2 >> 6) + 128);
176 dst[dst_pitch+x+1] = av_clip_uint8((p3 >> 6) + 128);
179 dst += dst_pitch << 1;
193 int x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3;
194 const short *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
206 for (y = 0; y < plane->
height; y += 2) {
207 for (x = 0, indx = 0; x < plane->
width; x += 2, indx++) {
215 p0 = (b0 + b1 + b2 + b3 + 2) >> 2;
216 p1 = (b0 + b1 - b2 - b3 + 2) >> 2;
217 p2 = (b0 - b1 + b2 - b3 + 2) >> 2;
218 p3 = (b0 - b1 - b2 + b3 + 2) >> 2;
221 dst[x] = av_clip_uint8(p0 + 128);
222 dst[x + 1] = av_clip_uint8(p1 + 128);
223 dst[dst_pitch + x] = av_clip_uint8(p2 + 128);
224 dst[dst_pitch + x + 1] = av_clip_uint8(p3 + 128);
227 dst += dst_pitch << 1;
237 #define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
238 t = ((s1) - (s2)) >> 1;\
239 o1 = ((s1) + (s2)) >> 1;\
243 #define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
244 d1, d2, d3, d4, d5, d6, d7, d8,\
245 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
246 t1 = (s1) * 2; t5 = (s5) * 2;\
247 IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
248 IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
249 IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
250 IVI_HAAR_BFLY(t7, s8, t7, t8, t0);\
251 d1 = COMPENSATE(t1);\
252 d2 = COMPENSATE(t2);\
253 d3 = COMPENSATE(t3);\
254 d4 = COMPENSATE(t4);\
255 d5 = COMPENSATE(t5);\
256 d6 = COMPENSATE(t6);\
257 d7 = COMPENSATE(t7);\
258 d8 = COMPENSATE(t8); }
261 #define INV_HAAR4(s1, s3, s5, s7, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
262 IVI_HAAR_BFLY(s1, s3, t0, t1, t4);\
263 IVI_HAAR_BFLY(t0, s5, t2, t3, t4);\
264 d1 = COMPENSATE(t2);\
265 d2 = COMPENSATE(t3);\
266 IVI_HAAR_BFLY(t1, s7, t2, t3, t4);\
267 d3 = COMPENSATE(t2);\
268 d4 = COMPENSATE(t3); }
273 int i,
shift, sp1, sp2, sp3, sp4;
280 #define COMPENSATE(x) (x)
283 for (i = 0; i < 8; i++) {
287 sp1 = src[ 0] * (1 <<
shift);
288 sp2 = src[ 8] * (1 <<
shift);
289 sp3 = src[16] * (1 <<
shift);
290 sp4 = src[24] * (1 <<
shift);
292 src[32], src[40], src[48], src[56],
293 dst[ 0], dst[ 8], dst[16], dst[24],
294 dst[32], dst[40], dst[48], dst[56],
295 t0, t1, t2, t3, t4, t5, t6, t7, t8);
297 dst[ 0] = dst[ 8] = dst[16] = dst[24] =
298 dst[32] = dst[40] = dst[48] = dst[56] = 0;
306 #define COMPENSATE(x) (x)
308 for (i = 0; i < 8; i++) {
309 if ( !src[0] && !src[1] && !src[2] && !src[3]
310 && !src[4] && !src[5] && !src[6] && !src[7]) {
311 memset(out, 0, 8 *
sizeof(out[0]));
313 INV_HAAR8(src[0], src[1], src[2], src[3],
314 src[4], src[5], src[6], src[7],
315 out[0], out[1], out[2], out[3],
316 out[4], out[5], out[6], out[7],
317 t0, t1, t2, t3, t4, t5, t6, t7, t8);
332 #define COMPENSATE(x) (x)
333 for (i = 0; i < 8; i++) {
334 if ( !in[0] && !in[1] && !in[2] && !in[3]
335 && !in[4] && !in[5] && !in[6] && !in[7]) {
336 memset(out, 0, 8 *
sizeof(out[0]));
339 in[4], in[5], in[6], in[7],
340 out[0], out[1], out[2], out[3],
341 out[4], out[5], out[6], out[7],
342 t0, t1, t2, t3, t4, t5, t6, t7, t8);
357 #define COMPENSATE(x) (x)
358 for (i = 0; i < 8; i++) {
360 INV_HAAR8(in[ 0], in[ 8], in[16], in[24],
361 in[32], in[40], in[48], in[56],
362 out[0 * pitch], out[1 * pitch],
363 out[2 * pitch], out[3 * pitch],
364 out[4 * pitch], out[5 * pitch],
365 out[6 * pitch], out[7 * pitch],
366 t0, t1, t2, t3, t4, t5, t6, t7, t8);
368 out[0 * pitch] = out[1 * pitch] =
369 out[2 * pitch] = out[3 * pitch] =
370 out[4 * pitch] = out[5 * pitch] =
371 out[6 * pitch] = out[7 * pitch] = 0;
382 int i,
shift, sp1, sp2;
389 #define COMPENSATE(x) (x)
392 for (i = 0; i < 4; i++) {
396 sp1 = src[0] * (1 <<
shift);
397 sp2 = src[4] * (1 <<
shift);
399 dst[0], dst[4], dst[8], dst[12],
402 dst[0] = dst[4] = dst[8] = dst[12] = 0;
410 #define COMPENSATE(x) (x)
412 for (i = 0; i < 4; i++) {
413 if (!src[0] && !src[1] && !src[2] && !src[3]) {
414 memset(out, 0, 4 *
sizeof(out[0]));
416 INV_HAAR4(src[0], src[1], src[2], src[3],
417 out[0], out[1], out[2], out[3],
433 #define COMPENSATE(x) (x)
434 for (i = 0; i < 4; i++) {
435 if (!in[0] && !in[1] && !in[2] && !in[3]) {
436 memset(out, 0, 4 *
sizeof(out[0]));
439 out[0], out[1], out[2], out[3],
455 #define COMPENSATE(x) (x)
456 for (i = 0; i < 4; i++) {
459 out[0 * pitch], out[1 * pitch],
460 out[2 * pitch], out[3 * pitch],
463 out[0 * pitch] = out[1 * pitch] =
464 out[2 * pitch] = out[3 * pitch] = 0;
478 dc_coeff = (*in + 0) >> 3;
480 for (y = 0; y < blk_size; out += pitch, y++) {
481 for (x = 0; x < blk_size; x++)
487 #define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
493 #define IVI_IREFLECT(s1, s2, o1, o2, t) \
494 t = (((s1) + (s2)*2 + 2) >> 2) + (s1);\
495 o2 = (((s1)*2 - (s2) + 2) >> 2) - (s2);\
499 #define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
500 t = (s2) + (((s1)*4 - (s2) + 4) >> 3);\
501 o2 = (s1) + ((-(s1) - (s2)*4 + 4) >> 3);\
505 #define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
506 d1, d2, d3, d4, d5, d6, d7, d8,\
507 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
508 IVI_SLANT_PART4(s4, s5, t4, t5, t0);\
510 IVI_SLANT_BFLY(s1, t5, t1, t5, t0); IVI_SLANT_BFLY(s2, s6, t2, t6, t0);\
511 IVI_SLANT_BFLY(s7, s3, t7, t3, t0); IVI_SLANT_BFLY(t4, s8, t4, t8, t0);\
513 IVI_SLANT_BFLY(t1, t2, t1, t2, t0); IVI_IREFLECT (t4, t3, t4, t3, t0);\
514 IVI_SLANT_BFLY(t5, t6, t5, t6, t0); IVI_IREFLECT (t8, t7, t8, t7, t0);\
515 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
516 IVI_SLANT_BFLY(t5, t8, t5, t8, t0); IVI_SLANT_BFLY(t6, t7, t6, t7, t0);\
517 d1 = COMPENSATE(t1);\
518 d2 = COMPENSATE(t2);\
519 d3 = COMPENSATE(t3);\
520 d4 = COMPENSATE(t4);\
521 d5 = COMPENSATE(t5);\
522 d6 = COMPENSATE(t6);\
523 d7 = COMPENSATE(t7);\
524 d8 = COMPENSATE(t8);}
527 #define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
528 IVI_SLANT_BFLY(s1, s2, t1, t2, t0); IVI_IREFLECT (s4, s3, t4, t3, t0);\
530 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
531 d1 = COMPENSATE(t1);\
532 d2 = COMPENSATE(t2);\
533 d3 = COMPENSATE(t3);\
534 d4 = COMPENSATE(t4);}
544 #define COMPENSATE(x) (x)
547 for (i = 0; i < 8; i++) {
549 IVI_INV_SLANT8(src[0], src[8], src[16], src[24], src[32], src[40], src[48], src[56],
550 dst[0], dst[8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56],
551 t0, t1, t2, t3, t4, t5, t6, t7, t8);
553 dst[0] = dst[8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0;
560 #define COMPENSATE(x) (((x) + 1)>>1)
562 for (i = 0; i < 8; i++) {
563 if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
564 memset(out, 0, 8*
sizeof(out[0]));
566 IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7],
567 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
568 t0, t1, t2, t3, t4, t5, t6, t7, t8);
584 #define COMPENSATE(x) (x)
587 for (i = 0; i < 4; i++) {
590 dst[0], dst[4], dst[8], dst[12],
593 dst[0] = dst[4] = dst[8] = dst[12] = 0;
600 #define COMPENSATE(x) (((x) + 1)>>1)
602 for (i = 0; i < 4; i++) {
603 if (!src[0] && !src[1] && !src[2] && !src[3]) {
604 out[0] = out[1] = out[2] = out[3] = 0;
607 out[0], out[1], out[2], out[3],
621 dc_coeff = (*in + 1) >> 1;
623 for (y = 0; y < blk_size; out += pitch, y++) {
624 for (x = 0; x < blk_size; x++)
634 #define COMPENSATE(x) (((x) + 1)>>1)
635 for (i = 0; i < 8; i++) {
636 if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
637 memset(out, 0, 8*
sizeof(out[0]));
639 IVI_INV_SLANT8( in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
640 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
641 t0, t1, t2, t3, t4, t5, t6, t7, t8);
654 dc_coeff = (*in + 1) >> 1;
656 for (x = 0; x < blk_size; x++)
661 for (y = 1; y < blk_size; out += pitch, y++) {
662 for (x = 0; x < blk_size; x++)
669 int i, row2, row4, row8;
676 #define COMPENSATE(x) (((x) + 1)>>1)
677 for (i = 0; i < 8; i++) {
679 IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
680 out[0], out[pitch], out[row2], out[row2 + pitch], out[row4],
681 out[row4 + pitch], out[row4 + row2], out[row8 - pitch],
682 t0, t1, t2, t3, t4, t5, t6, t7, t8);
684 out[0] = out[pitch] = out[row2] = out[row2 + pitch] = out[row4] =
685 out[row4 + pitch] = out[row4 + row2] = out[row8 - pitch] = 0;
699 dc_coeff = (*in + 1) >> 1;
701 for (y = 0; y < blk_size; out += pitch, y++) {
703 for (x = 1; x < blk_size; x++)
713 #define COMPENSATE(x) (((x) + 1)>>1)
714 for (i = 0; i < 4; i++) {
715 if (!in[0] && !in[1] && !in[2] && !in[3]) {
716 memset(out, 0, 4*
sizeof(out[0]));
719 out[0], out[1], out[2], out[3],
735 #define COMPENSATE(x) (((x) + 1)>>1)
736 for (i = 0; i < 4; i++) {
739 out[0], out[pitch], out[row2], out[row2 + pitch],
742 out[0] = out[pitch] = out[row2] = out[row2 + pitch] = 0;
756 for (y = 0; y < 8; out += pitch, in += 8, y++)
757 for (x = 0; x < 8; x++)
767 memset(out + 1, 0, 7*
sizeof(out[0]));
770 for (y = 1; y < 8; out += pitch, y++)
771 memset(out, 0, 8*
sizeof(out[0]));
774 #define IVI_MC_TEMPLATE(size, suffix, OP) \
775 static void ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, \
777 const int16_t *ref_buf, \
778 ptrdiff_t pitch, int mc_type) \
781 const int16_t *wptr; \
785 for (i = 0; i < size; i++, buf += dpitch, ref_buf += pitch) { \
786 for (j = 0; j < size; j++) {\
787 OP(buf[j], ref_buf[j]); \
792 for (i = 0; i < size; i++, buf += dpitch, ref_buf += pitch) \
793 for (j = 0; j < size; j++) \
794 OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \
797 wptr = ref_buf + pitch; \
798 for (i = 0; i < size; i++, buf += dpitch, wptr += pitch, ref_buf += pitch) \
799 for (j = 0; j < size; j++) \
800 OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \
803 wptr = ref_buf + pitch; \
804 for (i = 0; i < size; i++, buf += dpitch, wptr += pitch, ref_buf += pitch) \
805 for (j = 0; j < size; j++) \
806 OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
811 void ff_ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, const int16_t *ref_buf, \
812 ptrdiff_t pitch, int mc_type) \
814 ivi_mc_ ## size ##x## size ## suffix(buf, pitch, ref_buf, pitch, mc_type); \
817 #define IVI_MC_AVG_TEMPLATE(size, suffix, OP) \
818 void ff_ivi_mc_avg_ ## size ##x## size ## suffix(int16_t *buf, \
819 const int16_t *ref_buf, \
820 const int16_t *ref_buf2, \
822 int mc_type, int mc_type2) \
824 int16_t tmp[size * size]; \
827 ivi_mc_ ## size ##x## size ## _no_delta(tmp, size, ref_buf, pitch, mc_type); \
828 ivi_mc_ ## size ##x## size ## _delta(tmp, size, ref_buf2, pitch, mc_type2); \
829 for (i = 0; i < size; i++, buf += pitch) { \
830 for (j = 0; j < size; j++) {\
831 OP(buf[j], tmp[i * size + j] >> 1); \
836 #define OP_PUT(a, b) (a) = (b)
837 #define OP_ADD(a, b) (a) += (b)
841 IVI_MC_TEMPLATE(4, _no_delta,
OP_PUT)
842 IVI_MC_TEMPLATE(4, _delta,
OP_ADD)
844 IVI_MC_AVG_TEMPLATE(8, _delta,
OP_ADD)
845 IVI_MC_AVG_TEMPLATE(4, _no_delta,
OP_PUT)
846 IVI_MC_AVG_TEMPLATE(4, _delta,
OP_ADD)
#define INV_HAAR4(s1, s3, s5, s7, d1, d2, d3, d4, t0, t1, t2, t3, t4)
inverse 4-point Haar transform
static int shift(int a, int b)
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on rows for Indeo 4
void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only inverse column slant transform.
int16_t * buf
pointer to the output buffer for this band
DSP functions (inverse transforms, motion compensations, wavelet recomposition) for Indeo Video Inter...
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on columns for Indeo 4
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D row slant transform
void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only two-dimensional inverse slant transform.
void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, const ptrdiff_t dst_pitch)
5/3 wavelet recomposition filter for Indeo5
ptrdiff_t pitch
pitch associated with the buffers above
void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
Copy the pixels into the frame buffer.
void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 4x4 transform for Indeo 4
#define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4)
inverse slant4 transform
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D column slant transform
void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
Copy the DC coefficient into the first pixel of the block and zero all others.
void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 8x8 transform for Indeo 4
void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only inverse row slant transform.
#define IVI_MC_AVG_TEMPLATE(size, suffix, OP)
This file contains structures and macros shared by both Indeo4 and Indeo5 decoders.
#define IVI_MC_TEMPLATE(size, suffix, OP)
#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7, d1, d2, d3, d4, d5, d6, d7, d8, t0, t1, t2, t3, t4, t5, t6, t7, t8)
inverse slant8 transform
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D column slant transform
void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only two-dimensional inverse Haar transform for Indeo 4.
Libavcodec external API header.
void ff_ivi_row_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on rows for Indeo 4
void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, const ptrdiff_t dst_pitch)
Haar wavelet recomposition filter for Indeo 4.
void ff_ivi_col_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on columns for Indeo 4
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
IVIBandDesc * bands
array of band descriptors
#define flags(name, subs,...)
#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8, d1, d2, d3, d4, d5, d6, d7, d8, t0, t1, t2, t3, t4, t5, t6, t7, t8)
inverse 8-point Haar transform
void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse slant 4x4 transform
void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse slant 8x8 transform
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D row slant transform
color plane (luma or chroma) information