This is a static copy of a profile report

Home

imresize>contributions (165640 calls, 43.140 sec)
Generated 05-Nov-2014 07:53:46 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/imresize.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imresizefunction165640
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
845
weights = h(bsxfun(@minus, u, ...
16564012.407 s28.8%
848
weights = bsxfun(@rdivide, wei...
1656405.628 s13.0%
841
indices = bsxfun(@plus, left, ...
1656404.997 s11.6%
854
kill = find(~any(weights, 1));
1656402.513 s5.8%
855
if ~isempty(kill)
1656401.833 s4.2%
All other lines  15.762 s36.5%
Totals  43.140 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imresize>trianglesubfunction1656408.362 s19.4%
Self time (built-ins, overhead, etc.)  34.778 s80.6%
Totals  43.140 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function52
Non-code lines (comments, blank lines)33
Code lines (lines that can run)19
Code lines that did run17
Code lines that did not run2
Coverage (did run/can run)89.47 %
Function listing
   time   calls  line
807 function [weights, indices] = contributions(in_length, out_length, ...
808 scale, kernel, ...
809 kernel_width, antialiasing)
810
811
1.30 165640 812 if (scale < 1) && (antialiasing)
813 % Use a modified kernel to simultaneously interpolate and
814 % antialias.
815 h = @(x) scale * kernel(scale * x);
816 kernel_width = kernel_width / scale;
0.51 165640 817 else
818 % No antialiasing; use unmodified kernel.
0.81 165640 819 h = kernel;
0.71 165640 820 end
821
822 % Output-space coordinates.
1.77 165640 823 x = (1:out_length)';
824
825 % Input-space coordinates. Calculate the inverse mapping such that 0.5
826 % in output space maps to 0.5 in input space, and 0.5+scale in output
827 % space maps to 1.5 in input space.
1.46 165640 828 u = x/scale + 0.5 * (1 - 1/scale);
829
830 % What is the left-most pixel that can be involved in the computation?
0.81 165640 831 left = floor(u - kernel_width/2);
832
833 % What is the maximum number of pixels that can be involved in the
834 % computation? Note: it's OK to use an extra pixel here; if the
835 % corresponding weights are all zero, it will be eliminated at the end
836 % of this function.
0.93 165640 837 P = ceil(kernel_width) + 2;
838
839 % The indices of the input pixels involved in computing the k-th output
840 % pixel are in row k of the indices matrix.
5.00 165640 841 indices = bsxfun(@plus, left, 0:P-1);
842
843 % The weights used to compute the k-th output pixel are in row k of the
844 % weights matrix.
12.41 165640 845 weights = h(bsxfun(@minus, u, indices));
846
847 % Normalize the weights matrix so that each row sums to 1.
5.63 165640 848 weights = bsxfun(@rdivide, weights, sum(weights, 2));
849
850 % Clamp out-of-range indices; has the effect of replicating end-points.
1.36 165640 851 indices = min(max(1, indices), in_length);
852
853 % If a column in weights is all zero, get rid of it.
2.51 165640 854 kill = find(~any(weights, 1));
1.83 165640 855 if ~isempty(kill)
1.36 165640 856 weights(:,kill) = [];
0.95 165640 857 indices(:,kill) = [];
0.78 165640 858 end

Other subfunctions in this file are not included in this listing.