All pastes #500339 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-21 15:32 UTC
rendered paste body
Index: macosx/Controller.mm
===================================================================
--- macosx/Controller.mm	(revision 591)
+++ macosx/Controller.mm	(working copy)
@@ -652,7 +652,8 @@
 		fX264optMotionEstLabel,fX264optMotionEstPopUp,fX264optMERangeLabel,fX264optMERangePopUp,
 		fX264optWeightBLabel,fX264optWeightBPopUp,fX264optBRDOLabel,fX264optBRDOPopUp,
 		fX264optBPyramidLabel,fX264optBPyramidPopUp,fX264optBiMELabel,fX264optBiMEPopUp,
-		fX264optDirectPredLabel,fX264optDirectPredPopUp};
+		fX264optDirectPredLabel,fX264optDirectPredPopUp,fX264optDeblockLabel,fX264optAlphaDeblockPopUp,
+		fX264optBetaDeblockPopUp};
 
     for( unsigned i = 0;
          i < sizeof( controls ) / sizeof( NSControl * ); i++ )
@@ -2052,6 +2053,22 @@
     [fX264optDirectPredPopUp addItemWithTitle:@"Temporal"];
     [fX264optDirectPredPopUp addItemWithTitle:@"Automatic"];
     
+    /*Alpha Deblock*/
+    [fX264optAlphaDeblockPopUp removeAllItems];
+    [fX264optAlphaDeblockPopUp addItemWithTitle:@"Default (0)"];
+    for (i=-6; i<7;i++)
+    {
+        [fX264optAlphaDeblockPopUp addItemWithTitle:[NSString stringWithFormat:@"%d",i]];
+    }
+    
+    /*Beta Deblock*/
+    [fX264optBetaDeblockPopUp removeAllItems];
+    [fX264optBetaDeblockPopUp addItemWithTitle:@"Default (0)"];
+    for (i=-6; i<7;i++)
+    {
+        [fX264optBetaDeblockPopUp addItemWithTitle:[NSString stringWithFormat:@"%d",i]];
+    }
+        
     /* Standardize the option string */
     [self X264AdvancedOptionsStandardizeOptString: NULL];
     /* Set Current GUI Settings based on newly standardized string */
@@ -2305,7 +2322,34 @@
                     else if ([optValue isEqualToString:@"auto"])
                         [fX264optDirectPredPopUp selectItemAtIndex:4];                        
                 }
-                                                
+                /*Deblocking NSPopUpButtons*/
+                if ([optName isEqualToString:@"deblock"])
+                {
+                    NSString * alphaDeblock = @"";
+                    NSString * betaDeblock = @"";
+
+                    NSRange splitDeblock = [optValue rangeOfString:@","];
+                    alphaDeblock = [optValue substringToIndex:splitDeblock.location];
+                    betaDeblock = [optValue substringFromIndex:splitDeblock.location + 1];
+
+                    if (![alphaDeblock isEqualToString:@"0"])
+                    {
+                        [fX264optAlphaDeblockPopUp selectItemAtIndex:[alphaDeblock intValue]+7];
+                    }
+                    else
+                    {
+                        [fX264optAlphaDeblockPopUp selectItemAtIndex:7];                        
+                    }
+                    if (![betaDeblock isEqualToString:@"0"])
+                    {
+                        [fX264optBetaDeblockPopUp selectItemAtIndex:[betaDeblock intValue]+7];
+                    }
+                    else
+                    {
+                        [fX264optBetaDeblockPopUp selectItemAtIndex:7];                        
+                    }
+                }                                
+                
             }
         }
     }
@@ -2372,7 +2416,14 @@
     {
         optNameToChange = @"direct";
     }
-    
+    if (sender == fX264optAlphaDeblockPopUp)
+    {
+        optNameToChange = @"deblock";
+    }
+    if (sender == fX264optBetaDeblockPopUp)
+    {
+        optNameToChange = @"deblock";
+    }        
     /* Set widgets depending on the opt string in field */
     NSString * thisOpt; // The separated option such as "bframes=3"
     NSString * optName = @""; // The option name such as "bframes"
@@ -2423,8 +2474,23 @@
                 "Unspecified" is set.*/
                 if ([optName isEqualToString:optNameToChange])
                 {
-                    if ([sender indexOfSelectedItem] == 0) // means that "unspecified" is chosen, lets then remove it from the string
+                    if ([optNameToChange isEqualToString:@"deblock"])
                     {
+                        if ( ([fX264optAlphaDeblockPopUp indexOfSelectedItem] == 0) || ([fX264optAlphaDeblockPopUp indexOfSelectedItem] == 7) )
+                        {
+                            if ( ([fX264optBetaDeblockPopUp indexOfSelectedItem] == 0) || ([fX264optBetaDeblockPopUp indexOfSelectedItem] == 7) )
+                            {
+                                thisOpt = @"";                                
+                            }
+                        }
+                        else
+                        {
+                            thisOpt = [NSString stringWithFormat:@"%@=%d,%d",optName, ([fX264optAlphaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optAlphaDeblockPopUp indexOfSelectedItem]-7 : 0,([fX264optBetaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optBetaDeblockPopUp indexOfSelectedItem]-7 : 0];
+                        }
+                    }                    
+                    
+                    else if ([sender indexOfSelectedItem] == 0) // means that "unspecified" is chosen, lets then remove it from the string
+                    {
                         thisOpt = @"";
                     }
                     else if ([optNameToChange isEqualToString:@"me"])
@@ -2475,7 +2541,20 @@
                                 break;
                         }
                     }
-                    
+    /*                else if ([optNameToChange isEqualToString:@"deblock"])
+                    {
+                        if ( ([fX264optAlphaDeblockPopUp indexOfSelectedItem] == 0) || ([fX264optAlphaDeblockPopUp indexOfSelectedItem] == 7) )
+                        {
+                            if ( ([fX264optBetaDeblockPopUp indexOfSelectedItem] == 0) || ([fX264optBetaDeblockPopUp indexOfSelectedItem] == 7) )
+                            {
+                                thisOpt = @"";                                
+                            }
+                        }
+                        else
+                        {
+                            thisOpt = [NSString stringWithFormat:@"%@=%d,%d",optName, ([fX264optAlphaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optAlphaDeblockPopUp indexOfSelectedItem]-7 : 0,([fX264optBetaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optBetaDeblockPopUp indexOfSelectedItem]-7 : 0];
+                        }
+                    }                    */
                     else if ([optNameToChange isEqualToString:@"merange"])
                     {
                         thisOpt = [NSString stringWithFormat:@"%@=%d",optName,[sender indexOfSelectedItem]+3];
@@ -2574,6 +2653,11 @@
                 [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@=%@", 
                     [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d",[sender indexOfSelectedItem]+3]]];
             }
+            else if ([optNameToChange isEqualToString:@"deblock"])
+            {
+                [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@=%@", 
+                    [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d,%d",([fX264optAlphaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optAlphaDeblockPopUp indexOfSelectedItem]-7 : 0,([fX264optBetaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optBetaDeblockPopUp indexOfSelectedItem]-7 : 0]]];                
+            }
             else
             {
                 [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@=%@", 
@@ -2652,6 +2736,11 @@
                 [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@:%@=%@",[NSString stringWithFormat:[fDisplayX264Options stringValue]], 
                     [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d",[sender indexOfSelectedItem]+3]]];
             }
+            else if ([optNameToChange isEqualToString:@"deblock"])
+            {
+                [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@:%@=%@",[NSString stringWithFormat:[fDisplayX264Options stringValue]], 
+                    [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d,%d",([fX264optAlphaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optAlphaDeblockPopUp indexOfSelectedItem]-7 : 0, ([fX264optBetaDeblockPopUp indexOfSelectedItem] != 0) ? [fX264optBetaDeblockPopUp indexOfSelectedItem]-7 : 0]]];                
+            }
             else
             {
                 [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@:%@=%@",[NSString stringWithFormat:[fDisplayX264Options stringValue]], 
Index: macosx/English.lproj/MainMenu.nib/keyedobjects.nib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: macosx/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- macosx/English.lproj/MainMenu.nib/classes.nib	(revision 591)
+++ macosx/English.lproj/MainMenu.nib/classes.nib	(working copy)
@@ -136,14 +136,17 @@
                 fVidTargetSizeField = NSTextField; 
                 fVidTwoPassCheck = NSButton; 
                 fWindow = NSWindow; 
+                fX264optAlphaDeblockPopUp = NSPopUpButton; 
                 fX264optBPyramidLabel = NSTextField; 
                 fX264optBPyramidPopUp = NSPopUpButton; 
                 fX264optBRDOLabel = NSTextField; 
                 fX264optBRDOPopUp = NSPopUpButton; 
+                fX264optBetaDeblockPopUp = NSPopUpButton; 
                 fX264optBframesLabel = NSTextField; 
                 fX264optBframesPopUp = NSPopUpButton; 
                 fX264optBiMELabel = NSTextField; 
                 fX264optBiMEPopUp = NSPopUpButton; 
+                fX264optDeblockLabel = NSTextField; 
                 fX264optDirectPredLabel = NSTextField; 
                 fX264optDirectPredPopUp = NSPopUpButton; 
                 fX264optMERangeLabel = NSTextField; 
Index: macosx/Controller.h
===================================================================
--- macosx/Controller.h	(revision 591)
+++ macosx/Controller.h	(working copy)
@@ -168,6 +168,9 @@
     IBOutlet NSPopUpButton       * fX264optBiMEPopUp;
     IBOutlet NSTextField         * fX264optDirectPredLabel;
     IBOutlet NSPopUpButton       * fX264optDirectPredPopUp;
+    IBOutlet NSTextField         * fX264optDeblockLabel;
+    IBOutlet NSPopUpButton       * fX264optAlphaDeblockPopUp;
+    IBOutlet NSPopUpButton       * fX264optBetaDeblockPopUp;
     
 	/* User Preset variables here fPresetNewPicSettingsApply*/