summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordynaflash <[email protected]>2007-08-14 01:37:12 +0000
committerdynaflash <[email protected]>2007-08-14 01:37:12 +0000
commit43f8e6b14e1507c1bb5baebddd14f0d7c5ad5976 (patch)
treeba53639521d026bdfdb6ed867871486a3ae6a82d
parentb8dba94a337fbea63d55fe1f1f19f48aab61c718 (diff)
MacGui: Denoise filter initial implementation
- Add Denoise NSPopUp to Picture Window - Contains None, Weak, Medium, Strong. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@805 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/Controller.h5
-rw-r--r--macosx/Controller.mm52
-rw-r--r--macosx/English.lproj/MainMenu.nib/classes.nib5
-rw-r--r--macosx/English.lproj/MainMenu.nib/info.nib4
-rw-r--r--macosx/English.lproj/MainMenu.nib/keyedobjects.nibbin130562 -> 133133 bytes
-rw-r--r--macosx/PictureController.h2
-rw-r--r--macosx/PictureController.mm17
7 files changed, 72 insertions, 13 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h
index c6d4a493e..cbb0181d0 100644
--- a/macosx/Controller.h
+++ b/macosx/Controller.h
@@ -93,14 +93,17 @@
IBOutlet NSTextField * fPicSettingARkeep;
IBOutlet NSTextField * fPicSettingPAR;
IBOutlet NSTextField * fPicSettingDeinterlace;
+ IBOutlet NSTextField * fPicSettingDeinterlaceDsply;
IBOutlet NSTextField * fPicSettingARkeepDsply;
IBOutlet NSTextField * fPicSettingPARDsply;
IBOutlet NSTextField * fPicSettingAutoCropLabel;
IBOutlet NSTextField * fPicSettingAutoCrop;
IBOutlet NSTextField * fPicSettingAutoCropDsply;
- IBOutlet NSTextField * fPicSettingDeinterlaceDsply;
IBOutlet NSTextField * fPicSettingDetelecine;
IBOutlet NSTextField * fPicSettingDetelecineLabel;
+ IBOutlet NSTextField * fPicSettingDenoise;
+ IBOutlet NSTextField * fPicSettingDenoiseDsply;
+ IBOutlet NSTextField * fPicSettingDenoiseLabel;
IBOutlet NSTextField * fPicLabelAnamorphic;
IBOutlet NSTextField * fPicLabelPAROutp;
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index f59222117..acc2bf16b 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -265,6 +265,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie
/*Set detelecine to Off upon launch */
[fPicSettingDetelecine setStringValue: @"No"];
+ [fPicSettingDenoise setStringValue: @"0"];
/* Audio bitrate */
[fAudBitratePopUp removeAllItems];
@@ -1085,7 +1086,7 @@ list = hb_get_titles( fHandle );
fX264optDirectPredLabel,fX264optDirectPredPopUp,fX264optDeblockLabel,fX264optAnalyseLabel,
fX264optAnalysePopUp,fX264opt8x8dctLabel,fX264opt8x8dctSwitch,fX264optCabacLabel,fX264optCabacSwitch,
fX264optAlphaDeblockPopUp,fX264optBetaDeblockPopUp,fVidTurboPassCheck,fDstMpgLargeFileCheck,fPicSettingAutoCropLabel,
- fPicSettingAutoCropDsply,fPicSettingDetelecine,fPicSettingDetelecineLabel};
+ fPicSettingAutoCropDsply,fPicSettingDetelecine,fPicSettingDetelecineLabel,fPicSettingDenoiseLabel};
for( unsigned i = 0;
i < sizeof( controls ) / sizeof( NSControl * ); i++ )
@@ -1412,7 +1413,7 @@ list = hb_get_titles( fHandle );
}
job->filters = hb_list_init();
- /* Detelecine */
+ /* Detelecine */
if ([[fPicSettingDetelecine stringValue] isEqualToString: @"Yes"])
{
hb_list_add( job->filters, &hb_filter_detelecine );
@@ -1441,11 +1442,29 @@ list = hb_get_titles( fHandle );
}
if ([fPicSettingDeinterlace intValue] == 4)
{
- /* Yadif (2-pass w/ spatial deinterlacing) and Mcdeint Slow Mode*/
- hb_filter_deinterlace.settings = "1:-1:2";
+ /* Yadif (2-pass w/ spatial deinterlacing) and Mcdeint*/
+ hb_filter_deinterlace.settings = "1:-1:1";
hb_list_add( job->filters, &hb_filter_deinterlace );
}
}
+
+ /* Denoise */
+
+ if ([fPicSettingDenoise intValue] == 1) // Weak in popup
+ {
+ hb_filter_denoise.settings = "2:1:2:3";
+ hb_list_add( job->filters, &hb_filter_denoise );
+ }
+ else if ([fPicSettingDenoise intValue] == 2) // Medium in popup
+ {
+ hb_filter_denoise.settings = "3:2:2:3";
+ hb_list_add( job->filters, &hb_filter_denoise );
+ }
+ else if ([fPicSettingDenoise intValue] == 3) // Strong in popup
+ {
+ hb_filter_denoise.settings = "7:7:5:5";
+ hb_list_add( job->filters, &hb_filter_denoise );
+ }
}
@@ -2448,7 +2467,7 @@ list = hb_get_titles( fHandle );
{
[fPicSettingARkeepDsply setStringValue: @"Off"];
}
-
+ /* Deinterlace */
if ([fPicSettingDeinterlace intValue] == 0)
{
[fPicSettingDeinterlaceDsply setStringValue: @"Off"];
@@ -2469,6 +2488,23 @@ list = hb_get_titles( fHandle );
{
[fPicSettingDeinterlaceDsply setStringValue: @"Slowest"];
}
+ /* Denoise */
+ if ([fPicSettingDenoise intValue] == 0)
+ {
+ [fPicSettingDenoiseDsply setStringValue: @"Off"];
+ }
+ else if ([fPicSettingDenoise intValue] == 1)
+ {
+ [fPicSettingDenoiseDsply setStringValue: @"Weak"];
+ }
+ else if ([fPicSettingDenoise intValue] == 2)
+ {
+ [fPicSettingDenoiseDsply setStringValue: @"Medium"];
+ }
+ else if ([fPicSettingDenoise intValue] == 3)
+ {
+ [fPicSettingDenoiseDsply setStringValue: @"Strong"];
+ }
if (fTitle->job->pixel_ratio > 0)
{
@@ -3678,6 +3714,7 @@ the user is using "Custom" settings by determining the sender*/
[preset setObject:[NSNumber numberWithInt:[fPicSettingDeinterlace intValue]] forKey:@"PictureDeinterlace"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
[preset setObject:[fPicSettingDetelecine stringValue] forKey:@"PictureDetelecine"];
+ [preset setObject:[NSNumber numberWithInt:[fPicSettingDenoise intValue]] forKey:@"PictureDenoise"];
/* Set crop settings here */
/* The Auto Crop Matrix in the Picture Window autodetects differences in crop settings */
[preset setObject:[NSNumber numberWithInt:[fPicSettingAutoCrop intValue]] forKey:@"PictureAutoCrop"];
@@ -5080,7 +5117,10 @@ the user is using "Custom" settings by determining the sender*/
{
[fPicSettingDetelecine setStringValue: [NSString stringWithFormat: @"%@",[chosenPreset valueForKey:@"PictureDetelecine"]]];
}
-
+ if ([chosenPreset objectForKey:@"PictureDenoise"])
+ {
+ [fPicSettingDenoise setStringValue: [NSString stringWithFormat: @"%d",[[chosenPreset objectForKey:@"PictureDenoise"] intValue]]];
+ }
/* If Cropping is set to custom, then recall all four crop values from
when the preset was created and apply them */
if ([[chosenPreset objectForKey:@"PictureAutoCrop"] intValue] == 0)
diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib
index 0fb334d92..103826ac3 100644
--- a/macosx/English.lproj/MainMenu.nib/classes.nib
+++ b/macosx/English.lproj/MainMenu.nib/classes.nib
@@ -95,6 +95,9 @@
fPicSettingAutoCropLabel = NSTextField;
fPicSettingDeinterlace = NSTextField;
fPicSettingDeinterlaceDsply = NSTextField;
+ fPicSettingDenoise = NSTextField;
+ fPicSettingDenoiseDsply = NSTextField;
+ fPicSettingDenoiseLabel = NSTextField;
fPicSettingDetelecine = NSTextField;
fPicSettingDetelecineLabel = NSTextField;
fPicSettingHeight = NSTextField;
@@ -232,6 +235,8 @@
fCropTopStepper = NSStepper;
fDeinterlaceLevelMainWindow = NSTextField;
fDeinterlacePopUp = NSPopUpButton;
+ fDenoiseMainWindow = NSTextField;
+ fDenoisePopUp = NSPopUpButton;
fDetelecineCheck = NSButton;
fDetelecineMainWindow = NSTextField;
fEffectsCheck = NSButton;
diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib
index 9d18815dc..8180bc55f 100644
--- a/macosx/English.lproj/MainMenu.nib/info.nib
+++ b/macosx/English.lproj/MainMenu.nib/info.nib
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>-2 463 763 415 0 0 1440 878 </string>
+ <string>82 73 451 803 0 0 1440 878 </string>
<key>IBEditorPositions</key>
<dict>
<key>1843</key>
@@ -27,9 +27,9 @@
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
+ <integer>21</integer>
<integer>2436</integer>
<integer>365</integer>
- <integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8R2218</string>
diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
index a4fcb87b5..d76746aeb 100644
--- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
+++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/macosx/PictureController.h b/macosx/PictureController.h
index 5e876b555..bfc67bb86 100644
--- a/macosx/PictureController.h
+++ b/macosx/PictureController.h
@@ -38,6 +38,7 @@
IBOutlet NSStepper * fCropRightStepper;
IBOutlet NSPopUpButton * fDeinterlacePopUp;
IBOutlet NSButton * fDetelecineCheck;
+ IBOutlet NSPopUpButton * fDenoisePopUp;
IBOutlet NSButton * fPARCheck;
IBOutlet NSButton * fEffectsCheck;
IBOutlet NSButton * fPrevButton;
@@ -54,6 +55,7 @@
IBOutlet NSTextField * fDeinterlaceLevelMainWindow;
IBOutlet NSTextField * fDetelecineMainWindow;
IBOutlet NSPopUpButton * fVidFrameRatePopUpMainWindow;
+ IBOutlet NSTextField * fDenoiseMainWindow;
}
diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm
index 0cf80da05..aa3bcadff 100644
--- a/macosx/PictureController.mm
+++ b/macosx/PictureController.mm
@@ -94,8 +94,8 @@ static int GetAlignedSize( int size )
[fDeinterlacePopUp addItemWithTitle: @"Slow"];
[fDeinterlacePopUp addItemWithTitle: @"Slower"];
[fDeinterlacePopUp addItemWithTitle: @"Slowest"];
- /* we need a conditional to figure out how to set deinterlace */
-
+
+ /* Set deinterlaces level according to the integer in the main window */
[fDeinterlacePopUp selectItemAtIndex: [fDeinterlaceLevelMainWindow intValue]];
@@ -141,6 +141,14 @@ static int GetAlignedSize( int size )
}
+ /* we use a popup to show the denoise settings */
+ [fDenoisePopUp removeAllItems];
+ [fDenoisePopUp addItemWithTitle: @"None"];
+ [fDenoisePopUp addItemWithTitle: @"Weak"];
+ [fDenoisePopUp addItemWithTitle: @"Medium"];
+ [fDenoisePopUp addItemWithTitle: @"Strong"];
+ /* Set deinterlaces level according to the integer in the main window */
+ [fDenoisePopUp selectItemAtIndex: [fDenoiseMainWindow intValue]];
MaxOutputWidth = job->width;
MaxOutputHeight = job->height;
@@ -259,7 +267,7 @@ static int GetAlignedSize( int size )
job->height = [fHeightStepper intValue];
job->keep_ratio = ( [fRatioCheck state] == NSOnState );
- /* new multilevel deinterlacing popup */
+ /* multilevel deinterlacing popup */
[fDeinterlaceLevelMainWindow setStringValue: [NSString stringWithFormat: @"%d",[fDeinterlacePopUp indexOfSelectedItem]]];
if ([fDeinterlacePopUp indexOfSelectedItem] == 0)
{
@@ -280,7 +288,8 @@ static int GetAlignedSize( int size )
[fDetelecineMainWindow setStringValue: @"No"];
}
-
+ /* new multilevel deinterlacing popup */
+ [fDenoiseMainWindow setStringValue: [NSString stringWithFormat: @"%d",[fDenoisePopUp indexOfSelectedItem]]];
job->pixel_ratio = ( [fPARCheck state] == NSOnState );