Skip to content

Add processing modes#1729

Merged
ddennedy merged 14 commits into
masterfrom
processing_modes
Nov 22, 2025
Merged

Add processing modes#1729
ddennedy merged 14 commits into
masterfrom
processing_modes

Conversation

@bmatherly

@bmatherly bmatherly commented Oct 12, 2025

Copy link
Copy Markdown
Member

Remove the previous GPU Effects option and replace it with multiple processing modes that enable higher bit depth and linear color processing.

Depends upon mltframework/mlt#1159

image

Update 10/25/2025
I think this is ready for testing if anyone wants to help. I believe the colors are coming through correctly now. But there are many permutations of conversions. I'm going to keep working on the todo items.

TODO:

  • Add processing modes and implement linear color conversion filter
  • Convert RGB color parameters to Linear when appropriate
  • Make an RGB version of the brightness filter (it currently seems to lift green for some reason)

@bmatherly bmatherly requested a review from Copilot October 12, 2025 01:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the binary GPU Effects option with a comprehensive processing mode system that supports multiple bit depths and color processing modes. The change introduces five processing modes: Native 8-bit CPU, Linear 8-bit CPU, Native 10-bit CPU, Linear 10-bit CPU, and Native 10-bit GPU/CPU.

Key changes:

  • Introduced ProcessingMode enum and associated management functions
  • Updated video widget configuration to handle different image formats based on processing mode
  • Modified project saving/loading to store processing mode information

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/videowidget.cpp Updated consumer configuration to set image format and color transfer based on processing mode
src/shotcut_mlt_properties.h Added project processing mode property constant
src/settings.h Added ProcessingMode enum and related method declarations, removed legacy GPU setter
src/settings.cpp Implemented processing mode management with legacy GPU mode migration
src/mltcontroller.h Added processing mode support to controller
src/mltcontroller.cpp Integrated processing mode into project loading/saving and controller initialization
src/mainwindow.ui Replaced single GPU action with processing mode menu and actions
src/mainwindow.h Updated method signatures for processing mode
src/mainwindow.cpp Replaced GPU handling with comprehensive processing mode management
src/main.cpp Updated command line GPU option to use new processing mode
src/docks/encodedock.cpp Added processing mode support to encoding configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/settings.cpp Outdated
Comment thread src/mainwindow.cpp Outdated
Comment thread src/mainwindow.cpp Outdated
@bmatherly bmatherly marked this pull request as draft October 12, 2025 01:37
@bmatherly bmatherly requested a review from Copilot November 6, 2025 02:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/videowidget.cpp Outdated
Comment thread src/settings.cpp
Comment thread src/settings.cpp
@bmatherly bmatherly marked this pull request as ready for review November 6, 2025 02:55
@bmatherly

Copy link
Copy Markdown
Member Author

I think this is ready for review - in addition to the companion PR
mltframework/mlt#1159

Comment thread src/videowidget.cpp Outdated
Comment thread src/mainwindow.ui Outdated
Comment thread src/mltcontroller.cpp Outdated
Comment thread src/videowidget.cpp Outdated
Comment thread src/docks/encodedock.cpp Outdated
bmatherly and others added 7 commits November 15, 2025 20:47
Remove the previous GPU Effects option and replace it with
multiple processing modes that enable higher bit depth and
linear color processing.
Reduce property lookups

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Dan Dennedy <dan@dennedy.org>
Now in Export, when `color_trc` is arib-std-b67 (HLG) do not add
mlt_color_trc=linear.
Also, let user override `mlt_image_format` or `mlt_color_trc`.
@ddennedy ddennedy dismissed their stale review November 16, 2025 04:53

concern addressed

@ddennedy ddennedy self-requested a review November 22, 2025 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

src/mainwindow.cpp:4109

  • Inconsistent terminology: The dialog message refers to "GPU effects" but should use "GPU processing" to match the updated terminology used elsewhere in this PR (e.g., line 1688, 1733-1735).
        showFullScreen();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/docks/encodedock.cpp
Comment thread src/docks/encodedock.cpp
Comment thread src/docks/encodedock.cpp
Comment thread src/videowidget.cpp
Comment thread src/mltcontroller.cpp
s.set(kShotcutProjectAudioChannels, m_audioChannels);
s.set(kShotcutProjectFolder, m_projectFolder.isEmpty() ? 0 : 1);
s.set(kShotcutProjectProcessingMode,
Settings.processingModeStr(Settings.processingMode()).toUtf8().constData());

Copilot AI Nov 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: When saving, the code saves Settings.processingMode() (global settings) instead of m_processingMode (project-specific value loaded from the file). This means the saved processing mode may not match what was originally loaded from the project if they differ. Consider saving m_processingMode instead to preserve the project's processing mode.

Suggested change
Settings.processingModeStr(Settings.processingMode()).toUtf8().constData());
Settings.processingModeStr(m_processingMode).toUtf8().constData());

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only partially addresses a potential small bug:

  1. open Shotcut with processing mode native 8-bit
  2. open a project with processing mode linear 8- or 10-bit processing mode
  3. restart Shotcut
  4. processing mode is now what was last opened instead of native 8-bit

The above bug does not apply to GPU vs. not, however, thankfully.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What behavior would we want? I think the mode selected in the menu should always match the mode being used and the saved setting. This matches the video mode behavior. So when a project is opened, the setting must necessarily be changed. We could display a status message in the status area whenever the mode is changed. Also, upon opening Shotcut, we could flash up the video mode and processing mode in the status area.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is behaving a little different than video mode, but I think it should be the same: changing a processing mode with no project load sets a user default. Loading a project obviously should change processing mode to reflect it but not save it to settings and overwrite the user default. Video mode behaves correctly.

Comment thread src/settings.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/settings.cpp
Comment thread src/mainwindow.cpp Outdated
Comment thread src/mainwindow.cpp
Comment thread src/docks/encodedock.cpp
ddennedy and others added 3 commits November 22, 2025 13:04
@ddennedy ddennedy merged commit 11c2031 into master Nov 22, 2025
1 check passed
@ddennedy ddennedy deleted the processing_modes branch November 22, 2025 21:39
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.

3 participants