471{
472 int i, k = 0;
473#if MP3D_HAVE_INT_SIMD
474 if (MP3D_SIMD_AVAILABLE())
475 {
476 for (; k + 4 <= n; k += 4)
477 {
478 mp3d_dct2_bands4(grbuf, k);
479 }
480 }
481#endif
482 for (; k < n; k++)
483 {
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500#define MP3D_DCT_PASS1(I) \
501 do { \
502 const int32_t x0 = y[(I)*18]; \
503 const int32_t x1 = y[(15 - (I))*18]; \
504 const int32_t x2 = y[(16 + (I))*18]; \
505 const int32_t x3 = y[(31 - (I))*18]; \
506 const int32_t t0 = mp3d_add_sat(x0, x3); \
507 const int32_t t1 = mp3d_add_sat(x1, x2); \
508 const int32_t t2 = mp3d_mulshift_k<27, g_sec_q27[3*(I) + 0]>( \
509 mp3d_sub_sat(x1, x2)); \
510 const int32_t t3 = mp3d_mulshift_k<27, g_sec_q27[3*(I) + 1]>( \
511 mp3d_sub_sat(x0, x3)); \
512 t[0][I] = mp3d_add_sat(t0, t1); \
513 t[1][I] = mp3d_mulshift_k<27, g_sec_q27[3*(I) + 2]>( \
514 mp3d_sub_sat(t0, t1)); \
515 t[2][I] = mp3d_add_sat(t3, t2); \
516 t[3][I] = mp3d_mulshift_k<27, g_sec_q27[3*(I) + 2]>( \
517 mp3d_sub_sat(t3, t2)); \
518 } while (0)
527#undef MP3D_DCT_PASS1
528 for (
x =
t[0], i = 0; i < 4; i++,
x += 8)
529 {
530 int32_t x0 =
x[0], x1 =
x[1], x2 =
x[2], x3 =
x[3];
531 int32_t x4 =
x[4], x5 =
x[5], x6 =
x[6], x7 =
x[7], xt;
532 xt = mp3d_sub_sat(x0, x7); x0 = mp3d_add_sat(x0, x7);
533 x7 = mp3d_sub_sat(x1, x6); x1 = mp3d_add_sat(x1, x6);
534 x6 = mp3d_sub_sat(x2, x5); x2 = mp3d_add_sat(x2, x5);
535 x5 = mp3d_sub_sat(x3, x4); x3 = mp3d_add_sat(x3, x4);
536 x4 = mp3d_sub_sat(x0, x3); x0 = mp3d_add_sat(x0, x3);
537 x3 = mp3d_sub_sat(x1, x2); x1 = mp3d_add_sat(x1, x2);
538 x[0] = mp3d_add_sat(x0, x1);
539 x[4] = mp3d_mulshift_k<31, MP3D_Q31_COS_PI_4>(mp3d_sub_sat(x0, x1));
540 x5 = mp3d_add_sat(x5, x6);
541 x6 = mp3d_mulshift_k<31, MP3D_Q31_COS_PI_4>(mp3d_add_sat(x6, x7));
542 x7 = mp3d_add_sat(x7, xt);
543 x3 = mp3d_mulshift_k<31, MP3D_Q31_COS_PI_4>(mp3d_add_sat(x3, x4));
544
545 x5 = mp3d_sub_sat(x5, mp3d_mulshift_k<31, MP3D_Q31_TAN_PI_16>(x7));
546 x7 = mp3d_add_sat(x7, mp3d_mulshift_k<31, MP3D_Q31_SIN_PI_8>(x5));
547 x5 = mp3d_sub_sat(x5, mp3d_mulshift_k<31, MP3D_Q31_TAN_PI_16>(x7));
548 x0 = mp3d_sub_sat(xt, x6); xt = mp3d_add_sat(xt, x6);
549 x[1] = mp3d_mulshift_k<29, MP3D_Q29_SEC_PI_16>(mp3d_add_sat(xt, x7));
550 x[2] = mp3d_mulshift_k<29, MP3D_Q29_SEC_PI_8>(mp3d_add_sat(x4, x3));
551 x[3] = mp3d_mulshift_k<29, MP3D_Q29_SEC_3PI_16>(mp3d_sub_sat(x0, x5));
552 x[5] = mp3d_mulshift_k<29, MP3D_Q29_SEC_5PI_16>(mp3d_add_sat(x0, x5));
553 x[6] = mp3d_mulshift_k<29, MP3D_Q29_SEC_3PI_8>(mp3d_sub_sat(x4, x3));
554 x[7] = mp3d_mulshift_k<29, MP3D_Q29_SEC_7PI_16>(mp3d_sub_sat(xt, x7));
555 }
556 for (i = 0; i < 7; i++,
y += 4*18)
557 {
559 y[1*18] = mp3d_add_sat(mp3d_add_sat(
t[2][i],
t[3][i]),
t[3][i + 1]);
560 y[2*18] = mp3d_add_sat(
t[1][i],
t[1][i + 1]);
561 y[3*18] = mp3d_add_sat(mp3d_add_sat(
t[2][i + 1],
t[3][i]),
t[3][i + 1]);
562 }
564 y[1*18] = mp3d_add_sat(
t[2][7],
t[3][7]);
567 }
568}
#define MP3D_DCT_PASS1(I)