+ window_xmin = FFMIN(avctx->width, FFMAX(0, s->xmin + col));
+ window_xmax = FFMIN(avctx->width, FFMAX(0, s->xmin + col + td->xsize));
+ window_ymin = FFMIN(avctx->height, FFMAX(0, line ));
+ window_ymax = FFMIN(avctx->height, FFMAX(0, line + td->ysize));
+ xsize = window_xmax - window_xmin;
+ ysize = window_ymax - window_ymin;
+
+ /* tile or scanline not visible skip decoding */
+ if (xsize <= 0 || ysize <= 0)
+ return 0;
+
+ /* is the first tile or is a scanline */
+ if(col == 0) {
+ window_xmin = 0;
+ /* pixels to add at the left of the display window */
+ window_xoffset = FFMAX(0, s->xmin);
+ /* bytes to add at the left of the display window */
+ bxmin = window_xoffset * step;
+ }
+
+ /* is the last tile or is a scanline */
+ if(col + td->xsize == s->xdelta) {
+ window_xmax = avctx->width;
+ /* bytes to add at the right of the display window */
+ axmax = FFMAX(0, (avctx->width - (s->xmax + 1))) * step;
+ }
+