From the document to which you refer, when determining the value of the result for a given pixel p, all other pixels in the image will be weighted and summed in accordance with the similarity of their neighborhoods and the neighborhood of pixel p.
But it is computationally expensive. Thus, authors limit the number of pixels that will affect the weighted sum; it should be what you call a search box. This search box is a 21x21 area centered on pixel p. The neighborhoods to be compared are 7x7 in size (section 5).
I could make a prototype quickly with Mathematica, and I confirm that it becomes very expensive when the size of the search box increases. I expect the same behavior when you implement in C ++.
source share