Coder Social home page Coder Social logo

Comments (18)

joedrago avatar joedrago commented on June 21, 2024 1

Nevermind, I repro'd with the archlinux Docker image. I'll fix it.

from libavif.

joedrago avatar joedrago commented on June 21, 2024 1

I think this will fix it, give it a shot.

79e4c6c

from libavif.

utack avatar utack commented on June 21, 2024 1

It did indeed fix it!
Looking forward to trying png input

from libavif.

joedrago avatar joedrago commented on June 21, 2024 1

When converting RGB->YUV->RGB (even 444), you can have a drift of up to one codepoint in a channel. If I run

avifenc -c aom --min 0 --max 0 -s 0 blue.png blue.avif

I see a max drift of 1, which is expected.

image

from libavif.

utack avatar utack commented on June 21, 2024 1

Understood, thanks for the clarification

from libavif.

joedrago avatar joedrago commented on June 21, 2024

This is finally in, and will be in the next release.

(feel free to play with it in the master branch)

c647acc

from libavif.

utack avatar utack commented on June 21, 2024

The arch aur package fails to build
/aur-avif-git/src/libavif/apps/shared/avifpng.c:17:17: error: variable ‘rowPointers’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
17 | png_bytep * rowPointers = NULL;

Who is to fix this, should the maintainer change the building process or can libavif even solve this?

from libavif.

joedrago avatar joedrago commented on June 21, 2024

That's a weird one. I'm not a fan of libpng's choice to use setjmp(), but flow-wise, I think rowPointers is safe here. It is initialized to NULL before any longjmp is possible, and any call to longjmp eventually ends up at the cleanup label, which handles either state of rowPointers correctly.

Can you give me your compiler version? I'd like to repro the error here and see if I can come up with a proper solution in libavif.

from libavif.

joedrago avatar joedrago commented on June 21, 2024

The Internet (tm) suggests I can flag anything that might get jumped over as volatile as a hint to the optimizer to not do odd things with it. That might be enough. I want to see it fix the warning myself though.

from libavif.

utack avatar utack commented on June 21, 2024

Sorry you were too fast for me to respond on this one
Thank you for looking into it

from libavif.

utack avatar utack commented on June 21, 2024

Sorry to add something else to this

(gdb) backtrace
#0 0x00007ffff7530210 in ?? ()
#1 0x00007ffff7f14461 in ?? () from /usr/lib/libpng16.so.16
#2 0x00007ffff7f1fc48 in ?? () from /usr/lib/libpng16.so.16
#3 0x00007ffff7f293bf in ?? () from /usr/lib/libpng16.so.16
#4 0x00007ffff7f1cd79 in png_read_image () from /usr/lib/libpng16.so.16
#5 0x000055555555758c in ?? ()
#6 0x0000555555556488 in ?? ()
#7 0x00007ffff7d49023 in __libc_start_main () from /usr/lib/libc.so.6
#8 0x0000555555556e5e in ?? ()

I might look into this myself when I have time, but seems like something in libpng is not quite sorted correctly

from libavif.

joedrago avatar joedrago commented on June 21, 2024

Yuck, it is my fault. avif->height isn't set yet. Fixing.

from libavif.

joedrago avatar joedrago commented on June 21, 2024

Okay, I reverted that change and put a new one in.

ade6fe6

from libavif.

utack avatar utack commented on June 21, 2024

Yes, now it works, thank you!

from libavif.

joedrago avatar joedrago commented on June 21, 2024

As a note, I just fixed 16bpc PNG writing, my call to png_set_swap() was being ignored. I'm going to push a new version/tag in a few minutes.

from libavif.

utack avatar utack commented on June 21, 2024

Something still seems odd about reading/writing png

Take this file for example
in

avifenc --max 0 in.png out.avif
avifdec out.avif reconstructed.png

identify -verbose says amongst other differences

Blue:
  min: 37  (0.145098)
  max: 120 (0.470588)
  mean: 80.5176 (0.315755)

Blue:
  min: 36  (0.141176)
  max: 121 (0.47451)
  mean: 80.6096 (0.316116)

from libavif.

joedrago avatar joedrago commented on June 21, 2024

@utack I believe I may have done you a bit of a disservice by not being clearer in my response. I've recently had a discussion here which started from my quote above:

https://old.reddit.com/r/AV1/comments/g632tn/is_avif_from_the_program_xnview_really_lossless/forfmsj/?context=8

That reply should not only give you much more context about what I meant here, but also some hints as to avoid this issue in the future (with a more recent libavif / avifenc). Cheers!

from libavif.

utack avatar utack commented on June 21, 2024

Thank you @joedrago I have followed it!
I am not working with avif in a professional capacity so I was satisfied with your previous response, but understanding more of the technical details has certainly taught me more.

from libavif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.