I'm working with this paper: Textural Features Corresponding to Visual Perception, by Tamura, Mori, and Yamawaki. There's a part where you have to calculate neighborhoods of one image (matrix of, for example $256 \times 256$) and those neighborhoods have to be $2^k$ size square.
Step 1: Take averages at every point over neighborhoods whose sizes are powers of two, e.g., $1\times1$, $2\times2$, $\cdots$, $32\times32$. The average over the neighborhood of size $2^k\times2^k$ at the point $(x,y)$ is $$A_k(x,y)=\sum_{i=x-2^{k-1}}^{x+2^{k-1}-1}\sum_{j=y-2^{k-1}}^{y+2^{k-1}-1}f(i,j)\big/2^{2k}$$ where $f(i,j)$ is the gray-level at $(x,y)$.
Ok that's great.
Then I have to calculate a difference:
Step 2: For each point, at each point, take differences between pairs of averages corresponding to pairs of non-overlapping neighborhoods just on opposite sides of the point in both horizontal and vertical orientations. For examples, the difference in the horizontal case is $$E_{k,h}(x,y)=\left|A_k\left(x+2^{k-1},y\right)-A_k\left(x-2^{k-1},y\right)\right|.$$
Let $A(0,0)$ be the point where I want to calculate the difference.
If I use $A(0,0)$, I will go out of bounds on the second member.
Do you think it's an error? There's nothing about the '$h$' parameter anywhere as well.
$k$ could be $0, 1, 2 \dots$

As Michael suggested, $h$ is for horizontal. You'll also have vertical difference $$ E_{k,v}(x,y) = |A_k(x+2^{k-1},y) - A_k(x-2^{k-1},y)| $$ I think that they take $E_k = \max(E_{k,h},E_{k,v})$ and then maximize over $k$.
Yes you will, if $(x,y)$ are close to the boundary. The authors admit as much:
They offer no remedy to the boundary effects. One possible solution is to extend the image to a larger square by setting the color of every exterior pixel equal to the color of the image pixel nearest to it.