summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-09 20:37:48 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-11 13:36:41 -0700
commitdd9cc6cf87738dca3cde920ff15eb8ad30feb89a (patch)
tree41f07f333b327a1690510f78bbc9725347dc668f /recordmydesktop
parent1d0b9787dbba7ee68ac99e87a68c9fe4e63a820b (diff)
yuv_utils: fixup dirty blocknum() parameters
This needs to maintain dirty blocks in the yuv frame coordinates, not in the captured image's cooridinates. The existing code assumes those are the same in double-buffer mode where the dirty block tracking is applied. But I'm working towards allowing the captured image dimensions to be free from the 16x16 alignment constraints the yuv buffers must conform to for theora. To handle that future, the block coordinates should at least use the (yuv)->y_width, not width_tm. I also added shifting the x,y but in double-buffer mode that shouldn't actually be needed since it'd always be full-shots unless I'm mistaken.
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/rmd_yuv_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/recordmydesktop/src/rmd_yuv_utils.c b/recordmydesktop/src/rmd_yuv_utils.c
index 6d05c43..33cf2f6 100644
--- a/recordmydesktop/src/rmd_yuv_utils.c
+++ b/recordmydesktop/src/rmd_yuv_utils.c
@@ -258,7 +258,7 @@ static inline int blocknum(int xv, int yv, int widthv, int blocksize)
*yuv_Y = _yr[__RVALUE_##__depth__(t_val)] + \
_yg[__GVALUE_##__depth__(t_val)] + \
_yb[__BVALUE_##__depth__(t_val)]; \
- yblocks[blocknum(i, k, width_tm, Y_UNIT_WIDTH)] = 1; \
+ yblocks[blocknum(x_tm + i, y_tm + k, (yuv)->y_width, Y_UNIT_WIDTH)] = 1;\
} \
datapi++; \
datapi_back++; \
@@ -311,8 +311,8 @@ static inline int blocknum(int xv, int yv, int widthv, int blocksize)
sampling, \
__depth__); \
\
- ublocks[blocknum(i, k, width_tm, Y_UNIT_WIDTH)] = 1; \
- vblocks[blocknum(i, k, width_tm, Y_UNIT_WIDTH)] = 1; \
+ ublocks[blocknum(x_tm + i, y_tm + k, (yuv)->y_width, Y_UNIT_WIDTH)] = 1; \
+ vblocks[blocknum(x_tm + i, y_tm + k, (yuv)->y_width, Y_UNIT_WIDTH)] = 1; \
} \
\
datapi += 2; \
@@ -345,8 +345,8 @@ static inline int blocknum(int xv, int yv, int widthv, int blocksize)
sampling, \
__depth__); \
\
- ublocks[blocknum(i, k, width_tm, Y_UNIT_WIDTH)] = 1; \
- vblocks[blocknum(i, k, width_tm, Y_UNIT_WIDTH)] = 1; \
+ ublocks[blocknum(x_tm + i, y_tm + k, (yuv)->y_width, Y_UNIT_WIDTH)] = 1; \
+ vblocks[blocknum(x_tm + i, y_tm + k, (yuv)->y_width, Y_UNIT_WIDTH)] = 1; \
} \
\
datapi += 2; \
© All Rights Reserved