[EGIT] [legacy-imlib2] 01/02: Y4M Loader: Trivial simplification

2025-03-06 Thread Enlightenment Git

This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.


View the commit online.
commit 4927d847909f88b4595bdf73d85a52c1b1be8453
Author: Kim Woelders 
AuthorDate: Fri Mar 7 06:44:19 2025 +0100

Y4M Loader: Trivial simplification
---
 src/modules/loaders/loader_y4m.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/modules/loaders/loader_y4m.c b/src/modules/loaders/loader_y4m.c
index 85013e4..6464e56 100644
--- a/src/modules/loaders/loader_y4m.c
+++ b/src/modules/loaders/loader_y4m.c
@@ -494,9 +494,7 @@ _load(ImlibImage *im, int load_data)
 {
 pf->canvas_w = im->w;
 pf->canvas_h = im->h;
-pf->frame_delay = y4m.frametime_us / 1000;
-if (y4m.frametime_us % 1000 >= 500) /* round up */
-++pf->frame_delay;
+pf->frame_delay = (y4m.frametime_us + 500) / 1000;
 }
 
 if (!load_data)


-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.





[EGIT] [legacy-imlib2] 02/02: autofoo: Make building demo programs optional (default enabled)

2025-03-06 Thread Enlightenment Git

This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.


View the commit online.
commit 13eafa59547e0de003875dba5573752b9a9e51c7
Author: Kim Woelders 
AuthorDate: Thu Mar 6 19:21:58 2025 +0100

autofoo: Make building demo programs optional (default enabled)

When building programs, require zlib.
---
 configure.ac| 13 +
 src/Makefile.am |  5 -
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 533bd34..18adbfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,17 @@ if test "$enable_text" = "yes"; then
 fi
 AM_CONDITIONAL(ENABLE_TEXT, test "$enable_text" = "yes")
 
+AC_ARG_ENABLE([progs],
+  [AS_HELP_STRING([--enable-progs], [Build demo programs @<:@default=yes@:>@])],
+  enable_progs="$enableval",
+  enable_progs="yes"
+)
+if test "$enable_progs" = "yes"; then
+  AC_DEFINE(ENABLE_PROGS, 1, [Build demo programs])
+  PKG_CHECK_MODULES(ZLIB, zlib)
+fi
+AM_CONDITIONAL(ENABLE_PROGS, test "$enable_progs" = "yes")
+
 
 mmx=no
 amd64=no
@@ -345,5 +356,7 @@ echo "Include text functions: $enable_text"
 echo "Use visibility hiding.: $enable_visibility_hiding"
 echo "Use struct packing: $enable_packing"
 echo
+echo "Build demo programss..: $enable_progs"
+echo
 echo "Installation path.: $prefix"
 echo
diff --git a/src/Makefile.am b/src/Makefile.am
index a8ce0e4..7f71600 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1 +1,4 @@
-SUBDIRS = lib bin modules
+SUBDIRS = lib modules
+if ENABLE_PROGS
+SUBDIRS += bin
+endif


-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.





[EGIT] [legacy-imlib2] 02/02: Y4M Loader: provide the pixel aspect ratio directly

2025-03-06 Thread Enlightenment Git

This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.


View the commit online.
commit 7e17cf4f3bb012360d1e6bd7eae8e1ab05dd1237
Author: NRK 
AuthorDate: Wed Mar 5 19:52:56 2025 +

Y4M Loader: provide the pixel aspect ratio directly

instead of returning predefined enums. allows the parser to
accept a wider range of inputs without rejecting them.
---
 src/modules/loaders/loader_y4m.c | 36 +---
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/src/modules/loaders/loader_y4m.c b/src/modules/loaders/loader_y4m.c
index 8586e5d..85013e4 100644
--- a/src/modules/loaders/loader_y4m.c
+++ b/src/modules/loaders/loader_y4m.c
@@ -54,15 +54,7 @@ typedef struct {
 Y4M_PARSE_IL_BOTTOM,
 Y4M_PARSE_IL_MIXED,
 } interlacing;
-enum {
-Y4M_PARSE_ASPECT_DEFAULT,
-Y4M_PARSE_ASPECT_UNKNOWN,
-Y4M_PARSE_ASPECT_1_1,
-Y4M_PARSE_ASPECT_4_3,
-Y4M_PARSE_ASPECT_4_5,
-Y4M_PARSE_ASPECT_32_27,
-Y4M_PARSE_ASPECT_OTHER,
-} aspect;
+int pixel_aspect_w, pixel_aspect_h;
 enum {
 Y4M_PARSE_RANGE_UNSPECIFIED,
 Y4M_PARSE_RANGE_LIMITED,
@@ -121,6 +113,7 @@ static enum Y4mParseStatus
 y4m__parse_params(Y4mParse *res, const uint8_t **start, const uint8_t *end)
 {
 ptrdiff_t   number_of_frames, seconds;
+ptrdiff_t   tmp_w, tmp_h;
 const uint8_t  *p = *start;
 const uint8_t  *peek;
 
@@ -248,22 +241,13 @@ y4m__parse_params(Y4mParse *res, const uint8_t **start, const uint8_t *end)
 
 break;
 case 'A':
-if (y4m__match("0:0", 3, &p, end))
-res->aspect = Y4M_PARSE_ASPECT_UNKNOWN;
-else if (y4m__match("1:1", 3, &p, end))
-res->aspect = Y4M_PARSE_ASPECT_1_1;
-else if (y4m__match("4:3", 3, &p, end))
-res->aspect = Y4M_PARSE_ASPECT_4_3;
-else if (y4m__match("4:5", 3, &p, end))
-res->aspect = Y4M_PARSE_ASPECT_4_5;
-else if (y4m__match("32:27", 5, &p, end))
-res->aspect = Y4M_PARSE_ASPECT_32_27;
-else
+if (!y4m__int(&tmp_w, &p, end) ||
+!y4m__match(":", 1, &p, end) || !y4m__int(&tmp_h, &p, end))
 {
-res->aspect = Y4M_PARSE_ASPECT_OTHER;
-for (; p < end && *p != ' ' && *p != '\n'; ++p)
-;
+return Y4M_PARSE_CORRUPTED;
 }
+res->pixel_aspect_w = (int)tmp_w;
+res->pixel_aspect_h = (int)tmp_h;
 break;
 case 'X':
 if (y4m__match("COLORRANGE=LIMITED", 18, &p, end))
@@ -463,6 +447,12 @@ _load(ImlibImage *im, int load_data)
 if (y4m.interlacing != Y4M_PARSE_IL_PROGRESSIVE)
 return LOAD_BADIMAGE;
 
+if (y4m.pixel_aspect_w != y4m.pixel_aspect_h || y4m.pixel_aspect_w == 0)
+{
+DL("Non-square pixel aspect ratio: %d:%d\n",
+   y4m.pixel_aspect_w, y4m.pixel_aspect_h);
+}
+
 im->w = y4m.w;
 im->h = y4m.h;
 im->has_alpha = 0;


-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.