Giter Site home page Giter Site logo

Comments (11)

flat-eric147 avatar flat-eric147 commented on May 25, 2024 1

Thank you for the information and all the references. From what I could see it "felt" like BT.709, which nowadays is ok in most cases I would guess. I will try to have a closer look and try to help you out :)

from flashcap.

flat-eric147 avatar flat-eric147 commented on May 25, 2024 1

Hi, I had a closer look at the code, and it looked like the current conversion is using the standard BT.601.

I pushed a change to my forked repository adding all possible conversion standards:
be698df
Let me know if it's worth merging this modification.

from flashcap.

kekyo avatar kekyo commented on May 25, 2024 1

I will see later!

from flashcap.

kekyo avatar kekyo commented on May 25, 2024 1

@flat-eric147 Ouch! I forgot it... Sorry will be released 1.7.0 package shorty.
So, it will be merged next release. Please fork latest develop branch and apply it?

from flashcap.

flat-eric147 avatar flat-eric147 commented on May 25, 2024 1

ok, it looks good to me. Thank you so much!

from flashcap.

kekyo avatar kekyo commented on May 25, 2024

That is an excellent insight!
Indeed, when doing a YUV conversion, the color space conversion matrix is affected.

As shown on the source code, this is implemented based on the MS Article. The reason is that specific instructions were given to use realistic integer arithmetic (I wanted to avoid floating point arithmetic for speed).

Since I do not have a deep understanding of color space, I adopted my decision about the validity of these calculations in comparison to the miscellaneous other blog posts on the topic.

The actual calculations are exactly as the formulas here. That is:

R = clip(( 298 * C           + 409 * E + 128) >> 8)
G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8)
B = clip(( 298 * C + 516 * D           + 128) >> 8)

and although not clearly shown, I believe this is BT.709 based.

Returning to FlashCap, I think the idea of giving the format assumed in the YUV transcoding as an argument is a good one, so I will adopt it. However, the only known format type is BT.709, so if you know of other formats that could be added (e.g., BT.601, BT.2020, etc.), please help me out.

from flashcap.

flat-eric147 avatar flat-eric147 commented on May 25, 2024

Thank you, please consider also a small fix on that 761ce5d

from flashcap.

kekyo avatar kekyo commented on May 25, 2024

Merged, I will release next version.

from flashcap.

flat-eric147 avatar flat-eric147 commented on May 25, 2024

Thank you! The only thing I see is missing is the patch I attached manually. If you prefer I can re-fork from here and make a merge request.

from flashcap.

flat-eric147 avatar flat-eric147 commented on May 25, 2024

create pull request and while reviewing the code spotted a bug as well.

from flashcap.

kekyo avatar kekyo commented on May 25, 2024

Thanks! If no other problems are found, I will release it as 1.0.8.

from flashcap.

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.