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;
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) {
64 b1_1 = b1_ptr[back_pitch];
66 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch];
77 b3_2 = b3_ptr[back_pitch];
81 b3_8 = b3_2 - b3_5*6 + b3_ptr[pitch];
85 for (x = 0, indx = 0; x < plane->
width; x+=2, indx++) {
99 p0 = p1 = p2 = p3 = 0;
105 b0_1 = b0_ptr[indx+1];
106 b0_2 = b0_ptr[pitch+indx+1];
111 p2 = (tmp0 + tmp2) << 3;
112 p3 = (tmp1 + tmp2 + b0_2) << 2;
119 b1_2 = b1_ptr[indx+1];
120 b1_1 = b1_ptr[back_pitch+indx+1];
122 tmp2 = tmp1 - tmp0*6 + b1_3;
123 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch+indx+1];
125 p0 += (tmp0 + tmp1) << 3;
126 p1 += (tmp0 + tmp1 + b1_1 + b1_2) << 2;
128 p3 += (tmp2 + b1_3) << 1;
133 b2_3 = b2_ptr[indx+1];
134 b2_6 = b2_ptr[pitch+indx+1];
137 tmp1 = b2_1 - b2_2*6 + b2_3;
141 p2 += (tmp0 + b2_4 + b2_5) << 2;
142 p3 += (tmp1 + b2_4 - b2_5*6 + b2_6) << 1;
147 b3_6 = b3_ptr[indx+1];
148 b3_3 = b3_ptr[back_pitch+indx+1];
154 b3_9 = b3_3 - b3_6*6 + b3_ptr[pitch+indx+1];
156 p0 += (tmp0 + tmp1) << 2;
157 p1 += (tmp0 - tmp1*6 + tmp2) << 1;
158 p2 += (b3_7 + b3_8) << 1;
159 p3 += b3_7 - b3_8*6 + b3_9;
163 dst[x] = av_clip_uint8((p0 >> 6) + 128);
164 dst[x+1] = av_clip_uint8((p1 >> 6) + 128);
165 dst[dst_pitch+x] = av_clip_uint8((p2 >> 6) + 128);
166 dst[dst_pitch+x+1] = av_clip_uint8((p3 >> 6) + 128);
169 dst += dst_pitch << 1;
183 int x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3;
184 const short *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
196 for (y = 0; y < plane->
height; y += 2) {
197 for (x = 0, indx = 0; x < plane->
width; x += 2, indx++) {
205 p0 = (b0 + b1 + b2 + b3 + 2) >> 2;
206 p1 = (b0 + b1 - b2 - b3 + 2) >> 2;
207 p2 = (b0 - b1 + b2 - b3 + 2) >> 2;
208 p3 = (b0 - b1 - b2 + b3 + 2) >> 2;
211 dst[x] = av_clip_uint8(p0 + 128);
212 dst[x + 1] = av_clip_uint8(p1 + 128);
213 dst[dst_pitch + x] = av_clip_uint8(p2 + 128);
214 dst[dst_pitch + x + 1] = av_clip_uint8(p3 + 128);
217 dst += dst_pitch << 1;
227 #define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
229 o1 = (s1 + s2) >> 1;\
233 #define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
234 d1, d2, d3, d4, d5, d6, d7, d8,\
235 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
236 t1 = s1 << 1; t5 = s5 << 1;\
237 IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
238 IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
239 IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
240 IVI_HAAR_BFLY(t7, s8, t7, t8, t0);\
241 d1 = COMPENSATE(t1);\
242 d2 = COMPENSATE(t2);\
243 d3 = COMPENSATE(t3);\
244 d4 = COMPENSATE(t4);\
245 d5 = COMPENSATE(t5);\
246 d6 = COMPENSATE(t6);\
247 d7 = COMPENSATE(t7);\
248 d8 = COMPENSATE(t8); }
251 #define INV_HAAR4(s1, s3, s5, s7, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
252 IVI_HAAR_BFLY(s1, s3, t0, t1, t4);\
253 IVI_HAAR_BFLY(t0, s5, t2, t3, t4);\
254 d1 = COMPENSATE(t2);\
255 d2 = COMPENSATE(t3);\
256 IVI_HAAR_BFLY(t1, s7, t2, t3, t4);\
257 d3 = COMPENSATE(t2);\
258 d4 = COMPENSATE(t3); }
263 int i, shift, sp1, sp2, sp3, sp4;
267 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
270 #define COMPENSATE(x) (x)
273 for (i = 0; i < 8; i++) {
277 sp1 = src[ 0] << shift;
278 sp2 = src[ 8] << shift;
279 sp3 = src[16] << shift;
280 sp4 = src[24] << shift;
282 src[32], src[40], src[48], src[56],
283 dst[ 0], dst[ 8], dst[16], dst[24],
284 dst[32], dst[40], dst[48], dst[56],
285 t0, t1, t2, t3, t4, t5, t6, t7, t8);
287 dst[ 0] = dst[ 8] = dst[16] = dst[24] =
288 dst[32] = dst[40] = dst[48] = dst[56] = 0;
296 #define COMPENSATE(x) (x)
298 for (i = 0; i < 8; i++) {
299 if ( !src[0] && !src[1] && !src[2] && !src[3]
300 && !src[4] && !src[5] && !src[6] && !src[7]) {
301 memset(out, 0, 8 *
sizeof(out[0]));
303 INV_HAAR8(src[0], src[1], src[2], src[3],
304 src[4], src[5], src[6], src[7],
305 out[0], out[1], out[2], out[3],
306 out[4], out[5], out[6], out[7],
307 t0, t1, t2, t3, t4, t5, t6, t7, t8);
319 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
322 #define COMPENSATE(x) (x)
323 for (i = 0; i < 8; i++) {
324 if ( !in[0] && !in[1] && !in[2] && !in[3]
325 && !in[4] && !in[5] && !in[6] && !in[7]) {
326 memset(out, 0, 8 *
sizeof(out[0]));
329 in[4], in[5], in[6], in[7],
330 out[0], out[1], out[2], out[3],
331 out[4], out[5], out[6], out[7],
332 t0, t1, t2, t3, t4, t5, t6, t7, t8);
344 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
347 #define COMPENSATE(x) (x)
348 for (i = 0; i < 8; i++) {
350 INV_HAAR8(in[ 0], in[ 8], in[16], in[24],
351 in[32], in[40], in[48], in[56],
352 out[0 * pitch], out[1 * pitch],
353 out[2 * pitch], out[3 * pitch],
354 out[4 * pitch], out[5 * pitch],
355 out[6 * pitch], out[7 * pitch],
356 t0, t1, t2, t3, t4, t5, t6, t7, t8);
358 out[0 * pitch] = out[1 * pitch] =
359 out[2 * pitch] = out[3 * pitch] =
360 out[4 * pitch] = out[5 * pitch] =
361 out[6 * pitch] = out[7 * pitch] = 0;
372 int i, shift, sp1, sp2;
376 int t0, t1, t2, t3, t4;
379 #define COMPENSATE(x) (x)
382 for (i = 0; i < 4; i++) {
386 sp1 = src[0] << shift;
387 sp2 = src[4] << shift;
389 dst[0], dst[4], dst[8], dst[12],
392 dst[0] = dst[4] = dst[8] = dst[12] = 0;
400 #define COMPENSATE(x) (x)
402 for (i = 0; i < 4; i++) {
403 if (!src[0] && !src[1] && !src[2] && !src[3]) {
404 memset(out, 0, 4 *
sizeof(out[0]));
406 INV_HAAR4(src[0], src[1], src[2], src[3],
407 out[0], out[1], out[2], out[3],
420 int t0, t1, t2, t3, t4;
423 #define COMPENSATE(x) (x)
424 for (i = 0; i < 4; i++) {
425 if (!in[0] && !in[1] && !in[2] && !in[3]) {
426 memset(out, 0, 4 *
sizeof(out[0]));
429 out[0], out[1], out[2], out[3],
442 int t0, t1, t2, t3, t4;
445 #define COMPENSATE(x) (x)
446 for (i = 0; i < 4; i++) {
449 out[0 * pitch], out[1 * pitch],
450 out[2 * pitch], out[3 * pitch],
453 out[0 * pitch] = out[1 * pitch] =
454 out[2 * pitch] = out[3 * pitch] = 0;
468 dc_coeff = (*in + 0) >> 3;
470 for (y = 0; y < blk_size; out += pitch, y++) {
471 for (x = 0; x < blk_size; x++)
477 #define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
483 #define IVI_IREFLECT(s1, s2, o1, o2, t) \
484 t = ((s1 + s2*2 + 2) >> 2) + s1;\
485 o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
489 #define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
490 t = s2 + ((s1*4 - s2 + 4) >> 3);\
491 o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
495 #define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
496 d1, d2, d3, d4, d5, d6, d7, d8,\
497 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
498 IVI_SLANT_PART4(s4, s5, t4, t5, t0);\
500 IVI_SLANT_BFLY(s1, t5, t1, t5, t0); IVI_SLANT_BFLY(s2, s6, t2, t6, t0);\
501 IVI_SLANT_BFLY(s7, s3, t7, t3, t0); IVI_SLANT_BFLY(t4, s8, t4, t8, t0);\
503 IVI_SLANT_BFLY(t1, t2, t1, t2, t0); IVI_IREFLECT (t4, t3, t4, t3, t0);\
504 IVI_SLANT_BFLY(t5, t6, t5, t6, t0); IVI_IREFLECT (t8, t7, t8, t7, t0);\
505 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
506 IVI_SLANT_BFLY(t5, t8, t5, t8, t0); IVI_SLANT_BFLY(t6, t7, t6, t7, t0);\
507 d1 = COMPENSATE(t1);\
508 d2 = COMPENSATE(t2);\
509 d3 = COMPENSATE(t3);\
510 d4 = COMPENSATE(t4);\
511 d5 = COMPENSATE(t5);\
512 d6 = COMPENSATE(t6);\
513 d7 = COMPENSATE(t7);\
514 d8 = COMPENSATE(t8);}
517 #define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
518 IVI_SLANT_BFLY(s1, s2, t1, t2, t0); IVI_IREFLECT (s4, s3, t4, t3, t0);\
520 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
521 d1 = COMPENSATE(t1);\
522 d2 = COMPENSATE(t2);\
523 d3 = COMPENSATE(t3);\
524 d4 = COMPENSATE(t4);}
532 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
534 #define COMPENSATE(x) (x)
537 for (i = 0; i < 8; i++) {
539 IVI_INV_SLANT8(src[0], src[8], src[16], src[24], src[32], src[40], src[48], src[56],
540 dst[0], dst[8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56],
541 t0, t1, t2, t3, t4, t5, t6, t7, t8);
543 dst[0] = dst[8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0;
550 #define COMPENSATE(x) ((x + 1)>>1)
552 for (i = 0; i < 8; i++) {
553 if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
554 memset(out, 0, 8*
sizeof(out[0]));
556 IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7],
557 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
558 t0, t1, t2, t3, t4, t5, t6, t7, t8);
572 int t0, t1, t2, t3, t4;
574 #define COMPENSATE(x) (x)
577 for (i = 0; i < 4; i++) {
580 dst[0], dst[4], dst[8], dst[12],
583 dst[0] = dst[4] = dst[8] = dst[12] = 0;
590 #define COMPENSATE(x) ((x + 1)>>1)
592 for (i = 0; i < 4; i++) {
593 if (!src[0] && !src[1] && !src[2] && !src[3]) {
594 out[0] = out[1] = out[2] = out[3] = 0;
597 out[0], out[1], out[2], out[3],
611 dc_coeff = (*in + 1) >> 1;
613 for (y = 0; y < blk_size; out += pitch, y++) {
614 for (x = 0; x < blk_size; x++)
622 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
624 #define COMPENSATE(x) ((x + 1)>>1)
625 for (i = 0; i < 8; i++) {
626 if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
627 memset(out, 0, 8*
sizeof(out[0]));
629 IVI_INV_SLANT8( in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
630 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
631 t0, t1, t2, t3, t4, t5, t6, t7, t8);
644 dc_coeff = (*in + 1) >> 1;
646 for (x = 0; x < blk_size; x++)
651 for (y = 1; y < blk_size; out += pitch, y++) {
652 for (x = 0; x < blk_size; x++)
659 int i, row2, row4, row8;
660 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
666 #define COMPENSATE(x) ((x + 1)>>1)
667 for (i = 0; i < 8; i++) {
669 IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
670 out[0], out[pitch], out[row2], out[row2 + pitch], out[row4],
671 out[row4 + pitch], out[row4 + row2], out[row8 - pitch],
672 t0, t1, t2, t3, t4, t5, t6, t7, t8);
674 out[0] = out[pitch] = out[row2] = out[row2 + pitch] = out[row4] =
675 out[row4 + pitch] = out[row4 + row2] = out[row8 - pitch] = 0;
689 dc_coeff = (*in + 1) >> 1;
691 for (y = 0; y < blk_size; out += pitch, y++) {
693 for (x = 1; x < blk_size; x++)
701 int t0, t1, t2, t3, t4;
703 #define COMPENSATE(x) ((x + 1)>>1)
704 for (i = 0; i < 4; i++) {
705 if (!in[0] && !in[1] && !in[2] && !in[3]) {
706 memset(out, 0, 4*
sizeof(out[0]));
709 out[0], out[1], out[2], out[3],
721 int t0, t1, t2, t3, t4;
725 #define COMPENSATE(x) ((x + 1)>>1)
726 for (i = 0; i < 4; i++) {
729 out[0], out[pitch], out[row2], out[row2 + pitch],
732 out[0] = out[pitch] = out[row2] = out[row2 + pitch] = 0;
746 for (y = 0; y < 8; out += pitch, in += 8, y++)
747 for (x = 0; x < 8; x++)
757 memset(out + 1, 0, 7*
sizeof(out[0]));
760 for (y = 1; y < 8; out += pitch, y++)
761 memset(out, 0, 8*
sizeof(out[0]));
764 #define IVI_MC_TEMPLATE(size, suffix, OP) \
765 void ff_ivi_mc_ ## size ##x## size ## suffix (int16_t *buf, const int16_t *ref_buf, \
766 uint32_t pitch, int mc_type) \
769 const int16_t *wptr; \
773 for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) { \
774 for (j = 0; j < size; j++) {\
775 OP(buf[j], ref_buf[j]); \
780 for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) \
781 for (j = 0; j < size; j++) \
782 OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \
785 wptr = ref_buf + pitch; \
786 for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
787 for (j = 0; j < size; j++) \
788 OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \
791 wptr = ref_buf + pitch; \
792 for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
793 for (j = 0; j < size; j++) \
794 OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
799 #define OP_PUT(a, b) (a) = (b)
800 #define OP_ADD(a, b) (a) += (b)
804 IVI_MC_TEMPLATE(4, _no_delta,
OP_PUT)
805 IVI_MC_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
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D row slant transform
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D column slant transform
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.
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.
int16_t * buf
pointer to the output buffer for this band
DSP functions (inverse transforms, motion compensations, wavelet recompostion) for Indeo Video Intera...
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.
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=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);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_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
#define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4)
inverse slant4 transform
int pitch
pitch associated with the buffers above
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
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D row slant transform
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.
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
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
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=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);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_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
This file contains structures and macros shared by both Indeo4 and Indeo5 decoders.
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.
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
#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_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse slant 8x8 transform
void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, const int dst_pitch)
Haar wavelet recomposition filter for Indeo 4.
Libavcodec external API header.
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
IVIBandDesc * bands
array of band descriptors
#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, uint32_t pitch, const uint8_t *flags)
two-dimensional inverse slant 4x4 transform
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.
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
color plane (luma or chroma) information
void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, const int dst_pitch)
5/3 wavelet recomposition filter for Indeo5
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
inverse 1D column slant transform