From 5b7026676952fffe82ece362f21d190f8aac66a0 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 11 Jul 2020 11:43:39 -0700 Subject: *: no more enc_data->[xy]_offset With no rrect alignment adjustment happening, there's no need for this fuckery anymore. The theora encoding offsets will always be left at 0, the frame_{width, height} will clip to rrect.{width,height}, and the yuv buffer dimensions are the only thing 16x16 aligned. --- recordmydesktop/src/rmd_rescue.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'recordmydesktop/src/rmd_rescue.c') diff --git a/recordmydesktop/src/rmd_rescue.c b/recordmydesktop/src/rmd_rescue.c index bceb257..84bcf4b 100644 --- a/recordmydesktop/src/rmd_rescue.c +++ b/recordmydesktop/src/rmd_rescue.c @@ -41,7 +41,6 @@ int rmdRescue(const char *path) { - int offset_x, offset_y; unsigned short width, height; ProgData pdata; EncData enc_data; @@ -74,23 +73,17 @@ int rmdRescue(const char *path) { width = ((pdata.brwin.rrect.width + 15) >> 4) << 4; height = ((pdata.brwin.rrect.height + 15) >> 4) << 4; - offset_x = ((width - pdata.brwin.rrect.width) / 2) & ~1; - offset_y = ((height - pdata.brwin.rrect.height) / 2) & ~1; - enc_data.yuv.y = (unsigned char *)malloc(height * width); - enc_data.yuv.u = (unsigned char *)malloc(height * width / 4); - enc_data.yuv.v = (unsigned char *)malloc(height * width / 4); + enc_data.yuv.y = malloc(height * width); + enc_data.yuv.u = malloc(height * width / 4); + enc_data.yuv.v = malloc(height * width / 4); enc_data.yuv.y_width = width; enc_data.yuv.y_height = height; enc_data.yuv.y_stride = width; - enc_data.x_offset=offset_x; - enc_data.y_offset=offset_y; enc_data.yuv.uv_width = width / 2; enc_data.yuv.uv_height = height / 2; enc_data.yuv.uv_stride = width / 2; - enc_data.x_offset = offset_x; - enc_data.y_offset = offset_y; for (int i = 0; i < (enc_data.yuv.y_width * enc_data.yuv.y_height); i++) enc_data.yuv.y[i] = 0; -- cgit v1.2.1