MCPcopy Create free account
hub / github.com/defold/defold / Resampler

Method Resampler

engine/dlib/src/basis/encoder/basisu_resampler.cpp:637–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635 }
636
637 Resampler::Resampler(int src_x, int src_y,
638 int dst_x, int dst_y,
639 Boundary_Op boundary_op,
640 Resample_Real sample_low, Resample_Real sample_high,
641 const char* Pfilter_name,
642 Contrib_List * Pclist_x,
643 Contrib_List * Pclist_y,
644 Resample_Real filter_x_scale,
645 Resample_Real filter_y_scale,
646 Resample_Real src_x_ofs,
647 Resample_Real src_y_ofs)
648 {
649 int i, j;
650 Resample_Real support, (*func)(Resample_Real);
651
652 assert(src_x > 0);
653 assert(src_y > 0);
654 assert(dst_x > 0);
655 assert(dst_y > 0);
656
657#if BASISU_RESAMPLER_DEBUG_OPS
658 total_ops = 0;
659#endif
660
661 m_lo = sample_low;
662 m_hi = sample_high;
663
664 m_delay_x_resample = false;
665 m_intermediate_x = 0;
666 m_Pdst_buf = NULL;
667 m_Ptmp_buf = NULL;
668 m_clist_x_forced = false;
669 m_Pclist_x = NULL;
670 m_clist_y_forced = false;
671 m_Pclist_y = NULL;
672 m_Psrc_y_count = NULL;
673 m_Psrc_y_flag = NULL;
674 m_Pscan_buf = NULL;
675 m_status = STATUS_OKAY;
676
677 m_resample_src_x = src_x;
678 m_resample_src_y = src_y;
679 m_resample_dst_x = dst_x;
680 m_resample_dst_y = dst_y;
681
682 m_boundary_op = boundary_op;
683
684 if ((m_Pdst_buf = (Sample*)malloc(m_resample_dst_x * sizeof(Sample))) == NULL)
685 {
686 m_status = STATUS_OUT_OF_MEMORY;
687 return;
688 }
689
690 // Find the specified filter.
691
692 if (Pfilter_name == NULL)
693 Pfilter_name = BASISU_RESAMPLER_DEFAULT_FILTER;
694

Callers

nothing calls this directly

Calls 4

mallocFunction · 0.85
callocFunction · 0.85
resampler_range_checkFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected