139 float c_re,
float c_im,
140 float mag_totall,
float mag_totalr,
141 float fl_phase,
float fr_phase,
142 float bl_phase,
float br_phase,
143 float sl_phase,
float sr_phase,
148 float c_re,
float c_im,
149 float lfe_re,
float lfe_im,
150 float mag_totall,
float mag_totalr,
151 float fl_phase,
float fr_phase,
152 float bl_phase,
float br_phase,
153 float sl_phase,
float sr_phase,
207 for (ch = 0; ch < inlink->
channels; ch++) {
270 for (ch = 0; ch < outlink->
channels; ch++) {
319 float reference,
r,
a;
324 reference = angle *
M_PI / 180.f;
328 if (
fabsf(a) <= M_PI_4)
346 float *lfe_mag,
float *mag_total,
int lfe_mode)
348 if (output_lfe && n < highcut) {
349 *lfe_mag = n < lowcut ? 1.f : .5f*(1.f+
cosf(
M_PI*(lowcut-n)/(lowcut-highcut)));
350 *lfe_mag *= *mag_total;
352 *mag_total -= *lfe_mag;
373 dst[2 * n ] = mag *
cosf(c_phase);
374 dst[2 * n + 1] = mag *
sinf(c_phase);
386 float l_mag, r_mag, *dstl, *dstr;
392 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
394 dstl[2 * n ] = l_mag *
cosf(l_phase);
395 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
397 dstr[2 * n ] = r_mag *
cosf(r_phase);
398 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
410 float lfe_mag, l_mag, r_mag, *dstl, *dstr, *dstlfe;
419 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
421 dstl[2 * n ] = l_mag *
cosf(l_phase);
422 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
424 dstr[2 * n ] = r_mag *
cosf(r_phase);
425 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
427 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
428 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
440 float l_mag, r_mag, c_mag, *dstc, *dstl, *dstr;
448 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
450 dstl[2 * n ] = l_mag *
cosf(l_phase);
451 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
453 dstr[2 * n ] = r_mag *
cosf(r_phase);
454 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
456 dstc[2 * n ] = c_mag *
cosf(c_phase);
457 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
469 float lfe_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstlfe;
479 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
480 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
482 dstl[2 * n ] = l_mag *
cosf(l_phase);
483 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
485 dstr[2 * n ] = r_mag *
cosf(r_phase);
486 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
488 dstc[2 * n ] = c_mag *
cosf(c_phase);
489 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
491 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
492 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
505 float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe;
515 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
517 dstl[2 * n ] = l_mag *
cosf(l_phase);
518 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
520 dstr[2 * n ] = r_mag *
cosf(r_phase);
521 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
523 dstc[2 * n ] = c_mag *
cosf(c_phase);
524 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
526 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
527 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
539 float b_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstb;
548 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
549 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
551 dstl[2 * n ] = l_mag *
cosf(l_phase);
552 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
554 dstr[2 * n ] = r_mag *
cosf(r_phase);
555 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
557 dstc[2 * n ] = c_mag *
cosf(c_phase);
558 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
560 dstb[2 * n ] = b_mag *
cosf(c_phase);
561 dstb[2 * n + 1] = b_mag *
sinf(c_phase);
573 float lfe_mag, b_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstb, *dstlfe;
583 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
584 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
588 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
589 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
591 dstl[2 * n ] = l_mag *
cosf(l_phase);
592 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
594 dstr[2 * n ] = r_mag *
cosf(r_phase);
595 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
597 dstc[2 * n ] = c_mag *
cosf(c_phase);
598 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
600 dstb[2 * n ] = b_mag *
cosf(c_phase);
601 dstb[2 * n + 1] = b_mag *
sinf(c_phase);
613 float l_mag, r_mag, ls_mag, rs_mag, c_mag, *dstc, *dstl, *dstr, *dstls, *dstrs;
623 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
624 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
625 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
627 dstl[2 * n ] = l_mag *
cosf(l_phase);
628 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
630 dstr[2 * n ] = r_mag *
cosf(r_phase);
631 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
633 dstc[2 * n ] = c_mag *
cosf(c_phase);
634 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
636 dstls[2 * n ] = ls_mag *
cosf(l_phase);
637 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
639 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
640 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
652 float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlfe;
664 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
665 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
666 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
667 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
669 dstl[2 * n ] = l_mag *
cosf(l_phase);
670 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
672 dstr[2 * n ] = r_mag *
cosf(r_phase);
673 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
675 dstc[2 * n ] = c_mag *
cosf(c_phase);
676 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
678 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
679 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
681 dstls[2 * n ] = ls_mag *
cosf(l_phase);
682 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
684 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
685 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
697 float l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs;
708 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
709 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
710 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
711 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
713 dstl[2 * n ] = l_mag *
cosf(l_phase);
714 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
716 dstr[2 * n ] = r_mag *
cosf(r_phase);
717 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
719 dstc[2 * n ] = c_mag *
cosf(c_phase);
720 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
722 dstls[2 * n ] = ls_mag *
cosf(l_phase);
723 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
725 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
726 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
728 dstb[2 * n ] = b_mag *
cosf(c_phase);
729 dstb[2 * n + 1] = b_mag *
sinf(c_phase);
741 float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs, *dstlfe;
755 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
756 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
757 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
758 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
760 dstl[2 * n ] = l_mag *
cosf(l_phase);
761 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
763 dstr[2 * n ] = r_mag *
cosf(r_phase);
764 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
766 dstc[2 * n ] = c_mag *
cosf(c_phase);
767 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
769 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
770 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
772 dstls[2 * n ] = ls_mag *
cosf(l_phase);
773 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
775 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
776 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
778 dstb[2 * n ] = b_mag *
cosf(c_phase);
779 dstb[2 * n + 1] = b_mag *
sinf(c_phase);
792 float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe;
793 float ls_mag, rs_mag, *dstls, *dstrs;
805 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
806 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
807 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
809 dstl[2 * n ] = l_mag *
cosf(l_phase);
810 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
812 dstr[2 * n ] = r_mag *
cosf(r_phase);
813 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
815 dstc[2 * n ] = c_mag *
cosf(c_phase);
816 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
818 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
819 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
821 dstls[2 * n ] = ls_mag *
cosf(l_phase);
822 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
824 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
825 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
839 float c_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe;
840 float ls_mag, rs_mag, *dstls, *dstrs;
850 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
851 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
852 ls_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
853 rs_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
855 dstl[2 * n ] = l_mag *
cosf(l_phase);
856 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
858 dstr[2 * n ] = r_mag *
cosf(r_phase);
859 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
861 dstc[2 * n ] = c_mag *
cosf(c_phase);
862 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
864 dstlfe[2 * n ] = lfe_re;
865 dstlfe[2 * n + 1] = lfe_im;
867 dstls[2 * n ] = ls_mag *
cosf(l_phase);
868 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
870 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
871 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
882 float l_mag, r_mag, ls_mag, rs_mag, c_mag, lb_mag, rb_mag;
883 float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb;
896 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
897 lb_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
898 rb_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
902 dstl[2 * n ] = l_mag *
cosf(l_phase);
903 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
905 dstr[2 * n ] = r_mag *
cosf(r_phase);
906 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
908 dstc[2 * n ] = c_mag *
cosf(c_phase);
909 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
911 dstlb[2 * n ] = lb_mag *
cosf(l_phase);
912 dstlb[2 * n + 1] = lb_mag *
sinf(l_phase);
914 dstrb[2 * n ] = rb_mag *
cosf(r_phase);
915 dstrb[2 * n + 1] = rb_mag *
sinf(r_phase);
917 dstls[2 * n ] = ls_mag *
cosf(l_phase);
918 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
920 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
921 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
932 float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, lb_mag, rb_mag;
933 float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb, *dstlfe;
948 l_mag =
powf(.5f * ( x + 1.f), s->
fl_x) *
powf((y + 1.f) * .5f, s->
fl_y) * mag_total;
949 r_mag =
powf(.5f * (-x + 1.f), s->
fr_x) *
powf((y + 1.f) * .5f, s->
fr_y) * mag_total;
950 lb_mag =
powf(.5f * ( x + 1.f), s->
bl_x) *
powf(1.f - ((y + 1.f) * .5f), s->
bl_y) * mag_total;
951 rb_mag =
powf(.5f * (-x + 1.f), s->
br_x) *
powf(1.f - ((y + 1.f) * .5f), s->
br_y) * mag_total;
955 dstl[2 * n ] = l_mag *
cosf(l_phase);
956 dstl[2 * n + 1] = l_mag *
sinf(l_phase);
958 dstr[2 * n ] = r_mag *
cosf(r_phase);
959 dstr[2 * n + 1] = r_mag *
sinf(r_phase);
961 dstc[2 * n ] = c_mag *
cosf(c_phase);
962 dstc[2 * n + 1] = c_mag *
sinf(c_phase);
964 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
965 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
967 dstlb[2 * n ] = lb_mag *
cosf(l_phase);
968 dstlb[2 * n + 1] = lb_mag *
sinf(l_phase);
970 dstrb[2 * n ] = rb_mag *
cosf(r_phase);
971 dstrb[2 * n + 1] = rb_mag *
sinf(r_phase);
973 dstls[2 * n ] = ls_mag *
cosf(l_phase);
974 dstls[2 * n + 1] = ls_mag *
sinf(l_phase);
976 dstrs[2 * n ] = rs_mag *
cosf(r_phase);
977 dstrs[2 * n + 1] = rs_mag *
sinf(r_phase);
981 float c_re,
float c_im,
982 float mag_totall,
float mag_totalr,
983 float fl_phase,
float fr_phase,
984 float bl_phase,
float br_phase,
985 float sl_phase,
float sr_phase,
990 float fl_mag, fr_mag, ls_mag, rs_mag, lb_mag, rb_mag;
991 float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb, *dstlfe;
992 float lfe_mag, c_phase, mag_total = (mag_totall + mag_totalr) * 0.5;
1004 c_phase =
atan2f(c_im, c_re);
1009 fr_mag =
powf(.5f * (xr + 1.f), s->
fr_x) *
powf((yr + 1.f) * .5f, s->
fr_y) * mag_totalr;
1010 lb_mag =
powf(.5f * (-xl + 1.f), s->
bl_x) *
powf((yl + 1.f) * .5f, s->
bl_y) * mag_totall;
1011 rb_mag =
powf(.5f * (-xr + 1.f), s->
br_x) *
powf((yr + 1.f) * .5f, s->
br_y) * mag_totalr;
1015 dstl[2 * n ] = fl_mag *
cosf(fl_phase);
1016 dstl[2 * n + 1] = fl_mag *
sinf(fl_phase);
1018 dstr[2 * n ] = fr_mag *
cosf(fr_phase);
1019 dstr[2 * n + 1] = fr_mag *
sinf(fr_phase);
1021 dstc[2 * n ] = c_re;
1022 dstc[2 * n + 1] = c_im;
1024 dstlfe[2 * n ] = lfe_mag *
cosf(c_phase);
1025 dstlfe[2 * n + 1] = lfe_mag *
sinf(c_phase);
1027 dstlb[2 * n ] = lb_mag *
cosf(bl_phase);
1028 dstlb[2 * n + 1] = lb_mag *
sinf(bl_phase);
1030 dstrb[2 * n ] = rb_mag *
cosf(br_phase);
1031 dstrb[2 * n + 1] = rb_mag *
sinf(br_phase);
1033 dstls[2 * n ] = ls_mag *
cosf(sl_phase);
1034 dstls[2 * n + 1] = ls_mag *
sinf(sl_phase);
1036 dstrs[2 * n ] = rs_mag *
cosf(sr_phase);
1037 dstrs[2 * n + 1] = rs_mag *
sinf(sr_phase);
1041 float c_re,
float c_im,
1042 float lfe_re,
float lfe_im,
1043 float mag_totall,
float mag_totalr,
1044 float fl_phase,
float fr_phase,
1045 float bl_phase,
float br_phase,
1046 float sl_phase,
float sr_phase,
1051 float fl_mag, fr_mag, ls_mag, rs_mag, lb_mag, rb_mag;
1052 float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb, *dstlfe;
1065 fr_mag =
powf(.5f * (xr + 1.f), s->
fr_x) *
powf((yr + 1.f) * .5f, s->
fr_y) * mag_totalr;
1066 lb_mag =
powf(.5f * (-xl + 1.f), s->
bl_x) *
powf((yl + 1.f) * .5f, s->
bl_y) * mag_totall;
1067 rb_mag =
powf(.5f * (-xr + 1.f), s->
br_x) *
powf((yr + 1.f) * .5f, s->
br_y) * mag_totalr;
1071 dstl[2 * n ] = fl_mag *
cosf(fl_phase);
1072 dstl[2 * n + 1] = fl_mag *
sinf(fl_phase);
1074 dstr[2 * n ] = fr_mag *
cosf(fr_phase);
1075 dstr[2 * n + 1] = fr_mag *
sinf(fr_phase);
1077 dstc[2 * n ] = c_re;
1078 dstc[2 * n + 1] = c_im;
1080 dstlfe[2 * n ] = lfe_re;
1081 dstlfe[2 * n + 1] = lfe_im;
1083 dstlb[2 * n ] = lb_mag *
cosf(bl_phase);
1084 dstlb[2 * n + 1] = lb_mag *
sinf(bl_phase);
1086 dstrb[2 * n ] = rb_mag *
cosf(br_phase);
1087 dstrb[2 * n + 1] = rb_mag *
sinf(br_phase);
1089 dstls[2 * n ] = ls_mag *
cosf(sl_phase);
1090 dstls[2 * n + 1] = ls_mag *
sinf(sl_phase);
1092 dstrs[2 * n ] = rs_mag *
cosf(sr_phase);
1093 dstrs[2 * n + 1] = rs_mag *
sinf(sr_phase);
1105 for (n = 0; n < s->
buf_size; n++) {
1106 float l_re = srcl[2 * n], r_re = srcr[2 * n];
1107 float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1];
1108 float c_phase =
atan2f(l_im + r_im, l_re + r_re);
1109 float l_mag = hypotf(l_re, l_im);
1110 float r_mag = hypotf(r_re, r_im);
1111 float l_phase =
atan2f(l_im, l_re);
1112 float r_phase =
atan2f(r_im, r_re);
1113 float phase_dif =
fabsf(l_phase - r_phase);
1114 float mag_sum = l_mag + r_mag;
1115 float mag_dif = mag_sum < 0.000001 ?
FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
1116 float mag_total = hypotf(l_mag, r_mag);
1119 if (phase_dif >
M_PI)
1120 phase_dif = 2 *
M_PI - phase_dif;
1125 s->
upmix_stereo(ctx, l_phase, r_phase, c_phase, mag_total, x, y, n);
1132 float *srcl, *srcr, *srcc;
1140 float l_re = srcl[2 * n], r_re = srcr[2 * n];
1141 float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1];
1142 float c_re = srcc[2 * n], c_im = srcc[2 * n + 1];
1143 float c_mag = hypotf(c_re, c_im);
1144 float c_phase =
atan2f(c_im, c_re);
1145 float l_mag = hypotf(l_re, l_im);
1146 float r_mag = hypotf(r_re, r_im);
1147 float l_phase =
atan2f(l_im, l_re);
1148 float r_phase =
atan2f(r_im, r_re);
1149 float phase_dif =
fabsf(l_phase - r_phase);
1150 float mag_sum = l_mag + r_mag;
1151 float mag_dif = mag_sum < 0.000001 ?
FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
1152 float mag_total = hypotf(l_mag, r_mag);
1155 if (phase_dif >
M_PI)
1156 phase_dif = 2 *
M_PI - phase_dif;
1161 s->
upmix_3_0(ctx, l_phase, r_phase, c_phase, c_mag, mag_total, x, y, n);
1168 float *srcl, *srcr, *srclfe;
1176 float l_re = srcl[2 * n], r_re = srcr[2 * n];
1177 float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1];
1178 float lfe_re = srclfe[2 * n], lfe_im = srclfe[2 * n + 1];
1179 float c_phase =
atan2f(l_im + r_im, l_re + r_re);
1180 float l_mag = hypotf(l_re, l_im);
1181 float r_mag = hypotf(r_re, r_im);
1182 float l_phase =
atan2f(l_im, l_re);
1183 float r_phase =
atan2f(r_im, r_re);
1184 float phase_dif =
fabsf(l_phase - r_phase);
1185 float mag_sum = l_mag + r_mag;
1186 float mag_dif = mag_sum < 0.000001 ?
FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
1187 float mag_total = hypotf(l_mag, r_mag);
1190 if (phase_dif >
M_PI)
1191 phase_dif = 2 *
M_PI - phase_dif;
1196 s->
upmix_2_1(ctx, l_phase, r_phase, c_phase, mag_total, lfe_re, lfe_im, x, y, n);
1203 float *srcl, *srcr, *srcc, *srcsl, *srcsr;
1213 float fl_re = srcl[2 * n], fr_re = srcr[2 * n];
1214 float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1];
1215 float c_re = srcc[2 * n], c_im = srcc[2 * n + 1];
1216 float sl_re = srcsl[2 * n], sl_im = srcsl[2 * n + 1];
1217 float sr_re = srcsr[2 * n], sr_im = srcsr[2 * n + 1];
1218 float fl_mag = hypotf(fl_re, fl_im);
1219 float fr_mag = hypotf(fr_re, fr_im);
1220 float fl_phase =
atan2f(fl_im, fl_re);
1221 float fr_phase =
atan2f(fr_im, fr_re);
1222 float sl_mag = hypotf(sl_re, sl_im);
1223 float sr_mag = hypotf(sr_re, sr_im);
1224 float sl_phase =
atan2f(sl_im, sl_re);
1225 float sr_phase =
atan2f(sr_im, sr_re);
1226 float phase_difl =
fabsf(fl_phase - sl_phase);
1227 float phase_difr =
fabsf(fr_phase - sr_phase);
1228 float magl_sum = fl_mag + sl_mag;
1229 float magr_sum = fr_mag + sr_mag;
1230 float mag_difl = magl_sum < 0.000001 ?
FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum;
1231 float mag_difr = magr_sum < 0.000001 ?
FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum;
1232 float mag_totall = hypotf(fl_mag, sl_mag);
1233 float mag_totalr = hypotf(fr_mag, sr_mag);
1234 float bl_phase =
atan2f(fl_im + sl_im, fl_re + sl_re);
1235 float br_phase =
atan2f(fr_im + sr_im, fr_re + sr_re);
1239 if (phase_difl >
M_PI)
1240 phase_difl = 2 *
M_PI - phase_difl;
1242 if (phase_difr >
M_PI)
1243 phase_difr = 2 *
M_PI - phase_difr;
1249 mag_totall, mag_totalr,
1260 float *srcl, *srcr, *srcc, *srclfe, *srcsl, *srcsr;
1270 for (n = 0; n < s->
buf_size; n++) {
1271 float fl_re = srcl[2 * n], fr_re = srcr[2 * n];
1272 float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1];
1273 float c_re = srcc[2 * n], c_im = srcc[2 * n + 1];
1274 float lfe_re = srclfe[2 * n], lfe_im = srclfe[2 * n + 1];
1275 float sl_re = srcsl[2 * n], sl_im = srcsl[2 * n + 1];
1276 float sr_re = srcsr[2 * n], sr_im = srcsr[2 * n + 1];
1277 float fl_mag = hypotf(fl_re, fl_im);
1278 float fr_mag = hypotf(fr_re, fr_im);
1279 float fl_phase =
atan2f(fl_im, fl_re);
1280 float fr_phase =
atan2f(fr_im, fr_re);
1281 float sl_mag = hypotf(sl_re, sl_im);
1282 float sr_mag = hypotf(sr_re, sr_im);
1283 float sl_phase =
atan2f(sl_im, sl_re);
1284 float sr_phase =
atan2f(sr_im, sr_re);
1285 float phase_difl =
fabsf(fl_phase - sl_phase);
1286 float phase_difr =
fabsf(fr_phase - sr_phase);
1287 float magl_sum = fl_mag + sl_mag;
1288 float magr_sum = fr_mag + sr_mag;
1289 float mag_difl = magl_sum < 0.000001 ?
FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum;
1290 float mag_difr = magr_sum < 0.000001 ?
FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum;
1291 float mag_totall = hypotf(fl_mag, sl_mag);
1292 float mag_totalr = hypotf(fr_mag, sr_mag);
1293 float bl_phase =
atan2f(fl_im + sl_im, fl_re + sl_re);
1294 float br_phase =
atan2f(fr_im + sr_im, fr_re + sr_re);
1298 if (phase_difl >
M_PI)
1299 phase_difl = 2 *
M_PI - phase_difl;
1301 if (phase_difr >
M_PI)
1302 phase_difr = 2 *
M_PI - phase_difr;
1307 s->
upmix_5_1(ctx, c_re, c_im, lfe_re, lfe_im,
1308 mag_totall, mag_totalr,
1319 float *srcl, *srcr, *srcc, *srclfe, *srcbl, *srcbr;
1329 for (n = 0; n < s->
buf_size; n++) {
1330 float fl_re = srcl[2 * n], fr_re = srcr[2 * n];
1331 float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1];
1332 float c_re = srcc[2 * n], c_im = srcc[2 * n + 1];
1333 float lfe_re = srclfe[2 * n], lfe_im = srclfe[2 * n + 1];
1334 float bl_re = srcbl[2 * n], bl_im = srcbl[2 * n + 1];
1335 float br_re = srcbr[2 * n], br_im = srcbr[2 * n + 1];
1336 float fl_mag = hypotf(fl_re, fl_im);
1337 float fr_mag = hypotf(fr_re, fr_im);
1338 float fl_phase =
atan2f(fl_im, fl_re);
1339 float fr_phase =
atan2f(fr_im, fr_re);
1340 float bl_mag = hypotf(bl_re, bl_im);
1341 float br_mag = hypotf(br_re, br_im);
1342 float bl_phase =
atan2f(bl_im, bl_re);
1343 float br_phase =
atan2f(br_im, br_re);
1344 float phase_difl =
fabsf(fl_phase - bl_phase);
1345 float phase_difr =
fabsf(fr_phase - br_phase);
1346 float magl_sum = fl_mag + bl_mag;
1347 float magr_sum = fr_mag + br_mag;
1348 float mag_difl = magl_sum < 0.000001 ?
FFDIFFSIGN(fl_mag, bl_mag) : (fl_mag - bl_mag) / magl_sum;
1349 float mag_difr = magr_sum < 0.000001 ?
FFDIFFSIGN(fr_mag, br_mag) : (fr_mag - br_mag) / magr_sum;
1350 float mag_totall = hypotf(fl_mag, bl_mag);
1351 float mag_totalr = hypotf(fr_mag, br_mag);
1352 float sl_phase =
atan2f(fl_im + bl_im, fl_re + bl_re);
1353 float sr_phase =
atan2f(fr_im + br_im, fr_re + br_re);
1357 if (phase_difl >
M_PI)
1358 phase_difl = 2 *
M_PI - phase_difl;
1360 if (phase_difr >
M_PI)
1361 phase_difr = 2 *
M_PI - phase_difr;
1366 s->
upmix_5_1(ctx, c_re, c_im, lfe_re, lfe_im,
1367 mag_totall, mag_totalr,
1394 av_log(ctx,
AV_LOG_ERROR,
"Low cut-off '%d' should be less than high cut-off '%d'.\n",
1523 if (s->
all_x >= 0.f)
1525 if (s->
all_y >= 0.f)
1569 for (n = 0; n < s->
buf_size; n++) {
1575 memcpy(dst, ptr, s->
hop_size *
sizeof(
float));
1690 #define OFFSET(x) offsetof(AudioSurroundContext, x) 1691 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM 1793 .priv_class = &surround_class,
static void get_lfe(int output_lfe, int n, float lowcut, float highcut, float *lfe_mag, float *mag_total, int lfe_mode)
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
#define AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_4POINT1
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
static int config_input(AVFilterLink *inlink)
static void stereo_position(float a, float p, float *x, float *y)
This structure describes decoded (raw) audio or video data.
#define AV_CH_LAYOUT_6POINT1
#define AV_CH_LAYOUT_6POINT0
static void upmix_4_0(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
#define AV_CH_LAYOUT_SURROUND
Main libavfilter public API header.
static int query_formats(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static av_cold void uninit(AVFilterContext *ctx)
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_7POINT0
static void generate_window_func(float *lut, int N, int win_func, float *overlap)
void(* upmix_5_0)(AVFilterContext *ctx, float c_re, float c_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)
AVFilterFormatsConfig outcfg
Lists of supported formats / etc.
#define AV_CH_LAYOUT_STEREO
static void upmix_6_0(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
#define AV_CH_LAYOUT_5POINT0
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
const char * name
Pad name.
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
AVFilterLink ** inputs
array of pointers to input links
static void upmix_6_1(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
static void upmix_3_1_surround(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float c_mag, float mag_total, float x, float y, int n)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void(* upmix_2_1)(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float lfe_im, float lfe_re, float x, float y, int n)
static int filter_frame(AVFilterLink *inlink)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
static void upmix_7_1_5_1(AVFilterContext *ctx, float c_re, float c_im, float lfe_re, float lfe_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_CH_LOW_FREQUENCY
static void filter_stereo(AVFilterContext *ctx)
#define AVERROR_EOF
End of file.
static __device__ float fabsf(float a)
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
static int ifft_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
A filter pad used for either input or output.
#define AV_CH_LAYOUT_5POINT1
static void upmix_7_1(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int sample_rate
samples per second
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
static void filter_5_1_back(AVFilterContext *ctx)
static const AVOption surround_options[]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static void upmix_5_1_back(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
void(* upmix_3_0)(AVFilterContext *ctx, float l_phase, float r_phase, float c_mag, float c_phase, float mag_total, float x, float y, int n)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
simple assert() macros that are a bit more flexible than ISO C assert().
static void upmix_5_1_back_2_1(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float lfe_re, float lfe_im, float x, float y, int n)
static void stereo_transform(float *x, float *y, float angle)
void av_rdft_calc(RDFTContext *s, FFTSample *data)
Context for an Audio FIFO Buffer.
#define FFDIFFSIGN(x, y)
Comparator.
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
void(* filter)(AVFilterContext *ctx)
audio channel layout utility functions
static void upmix_4_1(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
static int config_output(AVFilterLink *outlink)
#define AV_CH_LAYOUT_3POINT1
void(* upmix_stereo)(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static int fft_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
static const AVFilterPad outputs[]
static void filter_5_0_side(AVFilterContext *ctx)
char * out_channel_layout_str
void av_rdft_end(RDFTContext *s)
static void upmix_7_1_5_0_side(AVFilterContext *ctx, float c_re, float c_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)
AVFilterContext * src
source filter
RDFTContext * av_rdft_init(int nbits, enum RDFTransformType trans)
Set up a real FFT.
#define AV_CH_FRONT_CENTER
#define AV_CH_LAYOUT_5POINT1_BACK
int format
agreed upon media format
static void upmix_1_0(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
A list of supported channel layouts.
static int activate(AVFilterContext *ctx)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31))))#define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac){}void ff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map){AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;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);return NULL;}return ac;}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;}else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->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);return ac;}int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){int use_generic=1;int len=in->nb_samples;int p;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
#define AV_CH_LAYOUT_5POINT0_BACK
const char * name
Filter name.
static void filter_5_1_side(AVFilterContext *ctx)
AVFilterLink ** outputs
array of pointers to output links
enum MovChannelLayoutTag * layouts
int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel)
Get the index of a channel in channel_layout.
static void upmix_7_0(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
#define flags(name, subs,...)
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
#define AV_CH_BACK_CENTER
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
Write data to an AVAudioFifo.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples)
Drain data from an AVAudioFifo.
static void upmix_5_1_back_surround(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float c_mag, float mag_total, float x, float y, int n)
static void filter_surround(AVFilterContext *ctx)
#define AV_CH_LAYOUT_2POINT1
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
uint64_t channel_layout
channel layout of current buffer (see libavutil/channel_layout.h)
int channels
Number of channels.
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
avfilter_execute_func * execute
FF_FILTER_FORWARD_WANTED(outlink, inlink)
static void upmix_3_1(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
AVFilterContext * dst
dest filter
uint64_t in_channel_layout
char * in_channel_layout_str
int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
Peek data from an AVAudioFifo.
uint64_t out_channel_layout
#define AV_CH_FRONT_RIGHT
AVFILTER_DEFINE_CLASS(surround)
#define av_malloc_array(a, b)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
uint8_t ** extended_data
pointers to the data planes/channels.
#define AV_CH_LAYOUT_MONO
static void filter_2_1(AVFilterContext *ctx)
static const AVFilterPad inputs[]
static void upmix_5_0_back(AVFilterContext *ctx, float l_phase, float r_phase, float c_phase, float mag_total, float x, float y, int n)
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_NOPTS_VALUE
Undefined timestamp value.
void(* upmix_5_1)(AVFilterContext *ctx, float c_re, float c_im, float lfe_re, float lfe_im, float mag_totall, float mag_totalr, float fl_phase, float fr_phase, float bl_phase, float br_phase, float sl_phase, float sr_phase, float xl, float yl, float xr, float yr, int n)