Skip to content

Y/C and mono decoding for ld-analyse + QOL improvements.#922

Merged
happycube merged 14 commits intohappycube:mainfrom
vrunk11:ld_analyse_chroma
Apr 27, 2025
Merged

Y/C and mono decoding for ld-analyse + QOL improvements.#922
happycube merged 14 commits intohappycube:mainfrom
vrunk11:ld_analyse_chroma

Conversation

@vrunk11
Copy link
Copy Markdown
Contributor

@vrunk11 vrunk11 commented Apr 24, 2025

This update reworks diferent par off ld-analyse :

  • the sizing of element of the main windows adapt dynamically.
  • the window resize to fit perfectly then content.
  • default parameter when loading a source adapt setting for optimal use depending on Y/C vs CVBS.
  • luma nr set to 0 by default with checkbox for disabling and comparing quickly the NR
  • ld-analyse now have the mono decoder.
  • the mono decoder now support luma NR in ld-analyse and in the chroma-decoder
  • Support for native Y/C preview and a checkbox for allowing combining or not Y/C to CVBS.

vrunk11 added 10 commits April 18, 2025 11:23
Add the mono decoder to ld-analyse and add an yNR usable with the mono decoder (ld-analyse only)
add the luma nr for the mono decoder in the ld-chroma-decoder
Reworks of the sizing off the window and automatic resize based on format and aspect ratio

made 4:3 default
small fix on config loading for the mono decoder
add an "enable luma nr" checkbox
on loading off a source adjust decoder depending if its CVBS or Y/C
set enableYNR to true by default
add a working Y/C preview
add a combine checkbox for combining
Fix for UI and Y/C related code
fix resizing happening while in fullscreen mode
set the ntsc phase compensation to always be false at the begining.
fix issue with the checkbox state
@vrunk11
Copy link
Copy Markdown
Contributor Author

vrunk11 commented Apr 24, 2025

image
image

@eshaz
Copy link
Copy Markdown
Contributor

eshaz commented Apr 24, 2025

Y/C mode works really well.

A few things that I noticed that need to be fixed.

  • The window size changes each time ld-analyse is opened, and shrinks below the 200% zoom that I use. This should be fixed so that the window only resizes down the fit the visible video. Or maybe the window should just remain at the size the user last used like it does in the current build.
  • "Phase compensating decoder" should default to checked, looks like this broke somewhere since it's no longer defaulted. This is needed for VHS and tape chroma decoding.
  • Looks like the pixel ratio mode has changed from SAR 1:1 to DAR 4:3. It might be a little easier to see the video and make adjustments with square pixels, so maybe that should remain defaulted to 1:1.

@eshaz
Copy link
Copy Markdown
Contributor

eshaz commented Apr 24, 2025

Maybe an alternative to changing the global defaults would be to write a feature that allows users to save defaults for the ui layout to their machine.

@harrypm
Copy link
Copy Markdown
Collaborator

harrypm commented Apr 25, 2025

Practically everyone changes the 1:1 to 4:3 so it makes sense to keep it as 4:3 default because that's what the majority of users and even myself use.

It definitely would be nice to have a config file system for preferences.

I think one major thing since the ability to change the active area preview window, is having multiple colour options for the blanking, as we currently don't have any sort of full-frame readout, If we did it would be easy to make a framing border around the active area with a contrasting colour such as yellow or red.

@oyvindln
Copy link
Copy Markdown
Contributor

Practically everyone changes the 1:1 to 4:3 so it makes sense to keep it as 4:3 default because that's what the majority of users and even myself use.

Well I don't, but agree it should ideally save preferences so everyone can keep their prefereces

@vrunk11
Copy link
Copy Markdown
Contributor Author

vrunk11 commented Apr 25, 2025

Y/C mode works really well.

A few things that I noticed that need to be fixed.

* The window size changes each time ld-analyse is opened, and shrinks below the 200% zoom that I use. This should be fixed so that the window only resizes down the fit the visible video. Or maybe the window should just remain at the size the user last used like it does in the current build.

* "Phase compensating decoder" should default to checked, looks like this broke somewhere since it's no longer defaulted. This is needed for VHS and tape chroma decoding.

* Looks like the pixel ratio mode has changed from SAR 1:1 to DAR 4:3. It might be a little easier to see the video and make adjustments with square pixels, so maybe that should remain defaulted to 1:1.

For the zoom i efectively tought it was not practical to resize to those size as it seem way to big for even an 1440p screen. but efectively i could lock resize over a ceetain size or take time to compute the good resize for the different zoom but that would be tedious.

for the phase compensation its effectively did an update cause i found it was non consistent between cvbs and y/c and the phase compensation seem to give color that was more wrong so i decided it was probably better to set it to false by default everywhere to avoid user say the color look different or wrong. but i never dealed with NTSC vhs. maybe there is something in the metadata i could use to know if its a tape and not just a high quality Y/C source ?

@vrunk11
Copy link
Copy Markdown
Contributor Author

vrunk11 commented Apr 25, 2025

the setting saving could be a good idea but would have to be on another update. and i feel the default should already fit the most typical case.

Comment on lines +1079 to +1111
void MainWindow::resize_on_aspect()
{
if(!this->isFullScreen() && !this->isMaximized())
{
if (tbcSource.getSystem() == PAL){
if (displayAspectRatio && !tbcSource.getIsWidescreen())// 4:3
{
this->resize(959, 765);
}
else if (displayAspectRatio && tbcSource.getIsWidescreen())// 16:9
{
this->resize(1258, 765);
}
else// 1:1
{
this->resize(1155, 765);
}

} else {
if (displayAspectRatio && !tbcSource.getIsWidescreen())// 4:3
{
this->resize(780, 665);
}
else if (displayAspectRatio && tbcSource.getIsWidescreen())// 16:9
{
this->resize(1052, 665);
}
else// 1:1
{
this->resize(930, 665);
}
}
}
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.

This seems to be what is running that unexpectedly resizes the window when I open ld-analyse. This is pretty jarring, and I need to resize the window back to where I had it each time. I would suggest we fix this, or remove it and add it in later when it's working. It'd be nice to see the chroma decoder changes go in, so I would think the latter option is preferred.

Also, where do these pixel values come from? However they are derived, the window size should be calculated relative to size of the video. The only constant here is the actual size of the video. The UI elements around the window can be different sizes depending on themes, OS, zoom values, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to be what is running that unexpectedly resizes the window when I open ld-analyse. This is pretty jarring, and I need to resize the window back to where I had it each time. I would suggest we fix this, or remove it and add it in later when it's working. It'd be nice to see the chroma decoder changes go in, so I would think the latter option is preferred.

Also, where do these pixel values come from? However they are derived, the window size should be calculated relative to size of the video. The only constant here is the actual size of the video. The UI elements around the window can be different sizes depending on themes, OS, zoom values, etc.

Yes i wrote that code. and you issue because i never dealed with zoom. the size should be the same on all OS as its handled by qt. the only things that might potentialy change is the design off the button but that shouldnt impact any sizing. for finding the size i just did trial and error until it fit perfectly. i could look into finding the perfect size for the x2 zoom. and for x3 maybe i would see 🤔. but for non integer size its wouldnt be possible.

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.

If there's a way to get the pixel size height and width of the inner video image, that could be used to resize the window. Basically instead of hardcoding the pixel values here, they would be derived from the size of the video image and the border between the view area and the main window.

Pseudo code would be something like this:

Get the height and width of the scaled video image
Get the height and width of the video view area
Get the height and width of the main window

// account for the size of the ui elements
Outer height and width = size of the main window - size of the view area

// calculate window size relative to video image and window ui elements
New size = video image size + outer size

Resize the window to the new size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i thinks they both scale differently but im going to do few tests and see

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i fixed it it was a lot easier than i thought the margin is always the same. now it resize perfectly for all zoom size.

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.

Confirmed, works much better now with zoom.

vrunk11 added 2 commits April 25, 2025 19:27
the window now adapt automaticaly to all size including zoom.
@harrypm harrypm changed the title Y/C and mono decoding for ld analyse + QOL imprivement Y/C and mono decoding for ld-analyse + QOL improvements. Apr 25, 2025
add tapeFormat to the metadata.
show tape format in ld-analyse
enable ntsc phase compensation for NTSC VHS
@vrunk11
Copy link
Copy Markdown
Contributor Author

vrunk11 commented Apr 25, 2025

image
this should fix the phase compensation issue mentioned before. It now enable it for NTSC tape by default.

Toggle buton for disabling auto resize
@happycube happycube merged commit 451ede3 into happycube:main Apr 27, 2025
2 checks passed
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.

5 participants