Skip to content

Refactor frame processing & add frame maxing - #495

Open
JesseFarebro wants to merge 256 commits into
Farama-Foundation:mainfrom
JesseFarebro:master
Open

Refactor frame processing & add frame maxing#495
JesseFarebro wants to merge 256 commits into
Farama-Foundation:mainfrom
JesseFarebro:master

Conversation

@JesseFarebro

@JesseFarebro JesseFarebro commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

Overview

  • Created a frame processor interface where we now have implemented:
    • Frame averaging (phosphor blend)
    • Frame maxing
    • Identity (no processing)
  • This PR also removes unneeded copying of the frame buffer & RAM buffer on each emulation step. This results in a slight performance improvement.

Frame Maxing details

As for frame maxing, we perform frame maxing per channel if getScreenRGB is called. This is standard and what DeepMind's preprocessing does. If getScreenGrayscale is called then we just take the max over luminosity.

Fixes #467.

Alejandro Dubrovsky and others added 30 commits December 24, 2017 01:48
Removed extra curly brace from example agent
…to-sdl-header-not-found-problem

workaround for SDL header not found problem
Fix switch fall-through in Gravitor.cpp
eliminating variables which are constant.
Benchmarking shows avg. ~30% speedup on multiple Atari games.
[Paddles.hxx] Add missing includion of Event.hxx
Also check in a .gitattributes file to set "text=auto".

This affects only a few odd files that had CRLF endings; most files
already have LF endings.
This simplifies the toolchain selection.
Previously, the values were hardcoded macros. Those are retained as
the default value, but the effective values may now be set
programmatically.

This changes the serialization format (the paddle values now appear as
the last two values).
Travis only provides two cores, so it is not useful to run make with
more than two jobs.
This change only modifies whitespace (and adds one or two #ifdef
comments). The reformatting is based on clang-format, with manual
review and tweaking.

The goal to harmonize the source code formatting, which is currently
using a variety of local styles. The chosen format is a "compact"
one (as per clang-format default): 2-space indent, Egyptian braces.
Nonetheless, vertical whitespace has been adjusted generously, so as
to have line comments preceded by a blank line for easy visual
segmentation.

Created with:

    clang-format               \
        --sort-includes=false  \
        --style='{ReflowComments: false,
                  PointerAlignment: Left,
                  KeepEmptyLinesAtTheStartOfBlocks: false,
                  IndentCaseLabels: true,
                  AccessModifierOffset: -1}'

    sed -e 's%#endif //%#endif  //%g'
This change only modifies whitespace (and adds one or two #ifdef
comments). The reformatting is based on clang-format, with manual
review and tweaking.

The goal to harmonize the source code formatting, which is currently
using a variety of local styles. The chosen format is a "compact"
one (as per clang-format default): 2-space indent, Egyptian braces.
Nonetheless, vertical whitespace has been adjusted generously, so as
to have line comments preceded by a blank line for easy visual
segmentation.

Created with:

    clang-format               \
        --sort-includes=false  \
        --style='{ReflowComments: false,
                  PointerAlignment: Left,
                  KeepEmptyLinesAtTheStartOfBlocks: false,
                  IndentCaseLabels: true,
                  AccessModifierOffset: -1}'

    sed -e 's%#endif //%#endif  //%g'
@jjshoots jjshoots mentioned this pull request Feb 6, 2024
10 tasks
@pseudo-rnd-thoughts

Copy link
Copy Markdown
Member

Will this require environment version update?

@jkterry1

jkterry1 commented Jul 9, 2026

Copy link
Copy Markdown
Member

@JesseFarebro would you be willing to fix merge conflicts on this?

@jkterry1

Copy link
Copy Markdown
Member

@Sebastian-Griesbach

Would you be willing to create a new version of this PR with the merge conflicts fixed so it can be reviewed as well?

@Sebastian-Griesbach

Copy link
Copy Markdown

@jkterry1 I will take a look at it soon. For now I should stop procrastinating on my own work with ALE PRs...

@jkterry1

jkterry1 commented Aug 1, 2026

Copy link
Copy Markdown
Member

@Sebastian-Griesbach poke about creating a new mergable PR off this if you're willing and have a moment, I'd greatly appreciate it :)

@Sebastian-Griesbach

Copy link
Copy Markdown

@jkterry1 I'm quit busy at the moment with hopefully my next publication. I will take a look at it eventually. As I understood @pseudo-rnd-thoughts the timeline to new new release are a few Month, until then I will likely have had a crack at it.

@jkterry1

jkterry1 commented Sep 4, 2026

Copy link
Copy Markdown
Member

@teddytennant would you be so kind as to create a new PR replacing this one that's rebased off master and passes CI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do the V5 environments perform frame pooling?