Friday, August 2, 2013

Using HDR/DRO on the Sony DSC-RX100M2

This is intended to be a quick introduction to what the HDR (High Dynamic Range) / DRO (Dynamic Range Optimization) feature does for you on the Sony DSC-RX100M2.  It is also a tip on one thing that it does "to you" instead of "for you."  Here are two shots taken of a scene that demonstrates both the benefit from in-camera dynamic range processing, and a common pitfall.

Click on the image to see full size.
Where the dynamic range settings help is to balance the overall exposure in a scene with both extremely dark areas and extremely bright areas.  The camera takes multiple exposures in quick sequence to capture details in dark areas by over-exposing a frame, capture details in bright areas by under-exposing a frame, and capture a baseline for color, white balance, etc. from a frame taken at the "proper" metered exposure.  Examine the enlarged areas in the first row beneath the two full photos to see the improvement when DRO is enabled.

One area where the high dynamic range feature can degrade a photo is in areas of the scene where the subject actually should have higher contrast.  In the second row, the shadows that add texture detail amongst the leaves of the iceplant nearly disappear into a solid green blob after the dynamic range has been "improved."

LG TV Quirks II - Anamorphic Video Flag

Before getting into the details, readers should know that this post is about the LG TV built in video player (firmware) for streaming DLNA content. Particularly, this is what I have found out so far regarding the LG TV's inability to recognize the "anamorphic" flag in video content that should result in the video player stretching the width of the pixels to fill the screen side-to-side. This really only applies to video content that carries the "anamorphic" flag so it mostly affects people who are attempting to re-code their DVD collection into video files that can be streamed from a DLNA server. I had hoped that sometime during the past year, LG would update the firmware on the TV and fix the DLNA video player, but as of firmware version 5.00.04, it is still not fixed.

Now for some details...

Background

This issue occurs when the LG TV attempts to play HD (16:9 ratio / wide-screen) content which has been recoded (not recorded... recoded) from DVD media to a mkv, m4v or mp4 video file using a tool like Handbrake. DVD content is always stored as a 720:480 picture which was originally intended for the 4:3 aspect ratio typical on tube TV sets that were most common when DVDs were introduced.
    You might be wondering why the picture size is 4:3 when the numeric ratio is 3:2. It doesn't exactly work like that because only the width (720) is a pixel-count resolution. The height or "y" dimension is a scan-line count. Those old tube TVs show scan lines taller than each of the pixel dots across the line, so they're not square... but I digress.
Over the past few years, HD, which is intended to be displayed on a wide screen at a 16:9 aspect ratio has taken over as the standard picture size. HD flat screen TV sets and projectors (e.g. "Full" HD 1080i/p at 1920:1080 or 720i/p HD at 1280:720) have become far more common. Nearly all TV series seasons/collections of recent shows are published on DVDs which are "rigged" to display the 720 pixels in each line wider (instead of narrower). Some older DVDs delivered the wide-screen picture ratio by including actual black bands above and below the viewable picture area. (Some DVDs of movies that have an original aspect ratio that is wider than 16:9 still do this.) Including the black bands in the picture in order to deliver the correct aspect ration diminishes the overall quality because it uses only part of the available height for actual picture data (the black band part) is just discarded.

To improve the picture quality, most recent DVDs, especially those with HD TV content, carry a special flag on the video stream that tells the player how to stretch the picture's width to reproduce the original picture size. This allows the picture to be stored on the DVD at the full height, without the wasted "black band" areas. The stored picture is squeezed from side to side to fit within the 4:3 picture ratio so that when the player stretches it back out to 16:9, it looks right again.

The problem with the LG TV (at least the 5500 / 5600 / 5700 models) is that the video player ignores that flag and DOES NOT STRETCH THE PICTURE AS IT SHOULD. As a result, the picture displayed on the LG TV appears squeezed from side to side.

It looks like LG TV owners are just out of luck on this issue. Samsung TVs seem to handle the anamorphic video flag in content just fine. Set top boxes like the WD TV Live also stretch the video to the proper size. It appears to be a problem that only the LG TV, maybe only the 55LW5700, but probably most of the LG TVs that are ironically marketed under the "SMART TV" logo.

Solution(s)

Since it doesn't look like LG will ever get this fixed, their TV sets just won't correctly display any video content that is originally from a DVD if the content is in HD / wide screen format. In other words, if the video content is encoded such that it depends on the video player recognizing the anamorphic video flag to properly re-size / stretch the picture, LG's built in player isn't up to the job.

Solution 1 is to just abandon the built in player and buy a set-top streaming box like a WD-TV Live. The HDMI output from a box like that will fill the screen as it should without requiring the source video file (m4v, etc.) to be recoded.

Solution 2 is to recode all the content with the anamorphic flag disabled. This requires some investigation of what the proper size ratio of the picture should be for each DVD and requires manually setting the output picture size in the recoding tool (at least in Handbrake). If you already have a large amount of recoded content that would need to be recoded, this isn't a very attractive option. Recoding video including a physical re-sizing of the picture dimensions is time consuming and requires a great deal more computer processing power than a typical straight-through, frame-by-frame picture transcode.

References:

* http://forum.videohelp.com/threads/329912-MKV-Anamorphic-Problem-Encoding-In-Handbrake
* http://en.wikipedia.org/wiki/Anamorphic_widescreen
* http://forum.serviio.org/viewtopic.php?f=12&t=2334
* https://trac.handbrake.fr/wiki/AnamorphicGuide
* http://www.lg.com/us/smart-tvs
* http://www.amazon.com/s/ref=nb_sb_noss_1?field-keywords=wd%20tv%20live
* http://en.wikipedia.org/wiki/Display_resolution
* http://forums.plexapp.com/index.php/topic/26123-supported-file-formatscodecs/

Thursday, August 1, 2013

Dell M6700 Laptop Wacky Window Focus Foreground Background Always-On-Top Issues

The Problem

Running Windows 7 64bit, the window focus on a Dell Laptop goes completely nuts.  Clicking on some windows sends them behind other windows.  Moving the mouse pointer across the title bar of background windows brings them to the front with no click.  Some windows get "stuck" on top of others.

The Tell

In the title bar of each window, just to the left of the minimize, maximize, and close buttons, a small windowpane appears when the mouse pointer is over the title bar of that window.  Also, when the window focus has gone nuts, using alt-tab to cycle through the current set of windows may reveal a transparent ghostly looking window titled: DP_MenuBar_Window

The Villain

A color management utility / driver / manager, or whatever you'd call it supplied by "PremierColor" has a flaky, buggy, shouldn't-have-been-released, was-probably-never-tested, "plugin" named "display splitter".  Dell passes this junkware along to their soon to be previous laptop customers, infuriating them and inspiring many foul things to be said about Dell.

The Hero

Someone posted the question on Dell's own forums, and there's actually an answer (which is a rare thing to find).  However, it isn't easily found because it doesn't match many of the keywords you might use to find it, like focus, hover, hovering, switching windows, title bar, stuck on top, foreground, background, Windows-7 64bit, Dell, laptop, swap, reverse, control, always-on-top, issues, problems bugs, random, front, back, top, bottom, underneath, over, control panel, personalization, "ease of access center", "make the mouse easier to use", "Activate a window by hovering over it with the mouse", and other stuff I'll add if I think of it.

The Happy Ending

You could either read the forum post link below, or you could cut to the chase and disable the buggy "display splitter" plugin, leaving the rest of the PremierColor thing functional.
  1. Find the PremierColor system tray / notification area icon.
  2. Right click it and select "Exit" from the popup menu
  3. Navigate to c:\Program Files (x86)\Common Files\Portrait Displays\Plugins
  4. Rename, move, delete, or do something to hide the "DP" directory
  5. Open the start menu and restart the PremierColor thing
  6. Verify that the "display splitter" part of it is no longer active by checking to be sure the little windowpane icon on each window's title bar is gone.
  7. Enjoy the sanity that comes from knowing your windows will no longer change focus unless you actually click on them... as it is supposed to be.

Reference:  The forum post on Dell's site

Thursday, July 18, 2013

Yet Another way to Fix PuTTY Color Defaults

A quick web search will reveal that many people who use PuTTY as an SSH client are _not_ particularly fond of the default colors.  Count me amongst those who find it nearly impossible to read dark blue text on a black background.  For years I've just used the PuTTY settings dialog window to edit the colors (or Colours as they're named in the registry settings).  As the number of saved sessions I have has grown, it has become less and less practical to go fix the colors individually, so I cooked up a different way to reset all the sessions in one action.

The Colour settings are stored for each PuTTY session in the registry keys (each named after the session) under the key

           HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

I've seen other posts that suggest fixing the default colors by running a .reg file to create a new session with the desired colors but that doesn't help if you've got dozens of sessions that have the wrong (I mean default) color settings already.

Since Putty runs on Windows, the tool that made the most sense to help fix it is an add-on, techie utility from Microsoft called PowerShell.  PowerShell makes it reasonably easy to perform useful "extra" stuff like listing and modifying specific registry keys.  Without getting into a full PowerShell tutorial, which you can find at Microsoft's Technet Site if you like, I'll just skip to the how-to instructions.  Before you do any of this, as everyone else always warns, this modifies the Windows registry, so you should make a backup, buy a spare computer, print out all your photos on archival paper, create a rescue disk, retain the services of at least two system recovery experts, etc. etc... So you've been warned, and it's 100% your responsibility if you screw something up, even if I made some mistake writing this.
  1. Download PowerShell (any version) from Microsoft's web site, and install it.
  2. Run PowerShell from a command prompt (assuming if you use PuTTY, you'd be comfortable with this).
  3. Enter the PowerShell cmdlet Set-ExecutionPolicy Unrestricted (so you can run your own unsigned scripts) See: http://technet.microsoft.com/en-us/library/ee176961.aspx
  4. Save the script code below into a file named "fix-putty-colors.ps1"  (to most people, it should be reasonably obvious what the script does).
  5. Execute the script from within PowerShell
  6. Enter the PowerShell cmdlet Set-ExecutionPolicy Restricted  (this is optional but for those who are in the paranoid-about-security camp, it makes it slightly harder for a rogue script to run accidentally after you've finished fixing the PuTTY registry settings).

Script Code (modify to set other color codes and/or add other color properties if desired):

Push-Location
Set-Location 'HKCU:\Software\SimonTatham\PuTTY\Sessions'
Get-ChildItem |
ForEach-Object {
   Push-Location
   Set-Location Registry::$_
   Set-ItemProperty -Path . -Name Colour14 -Value '150,150,187'
   Set-ItemProperty -Path . -Name Colour15 -Value '200,200,255'
   Pop-Location
}
Pop-Location

Sunday, July 7, 2013

Dell M6700 Mobile Workstation Fan Toggling On Off On Off

Once upon a time, there were advantages to buying a Dell that would outweigh the drawbacks overall, but dealing with those drawbacks is sometimes enough to drive you over the edge. This post is to share some information that might help keep someone get one step closer to solving an issue with fans toggling on and off in a Dell Precision m6700 mobile workstation.

Fan toggling on off on off on off relentlessly...

I got a Dell Precision M6700 I got at the end of last year and it has come dangerously close to becoming an expensive projectile several times.  There is something REALLY wrong with the temperature / fan control.  Tools like SpeedFan don't recognize the fans in many Dell machines like this one (probably because of the "special" Dell BIOS that isn't worth the time for the developers to support), so they're of no use to override the boneheaded Dell fan control logic.  The BIOS keeps turning the fans off, and allowing the temperature to rise a few degrees, then turning the fans on full blast until the temperature drops a few degrees.  Watching the main CPU temp and the GPU temp graph out a consistent (even if jagged) sine-wave is proof that someone just didn't make much of an effort when they wrote the fan control software.  The same moron engineer would probably also think it is a good idea to paint the walls in a dining room with glow-in-the-dark paint and turn on a blindingly bright light for a short time every few minutes.

After many futile web searches, I stumbled over an older conversation about a different Dell laptop model (XPS) and a different graphics card (Nvidia) that was doing the same stupid fan-on, fan-off thing (apologies to Mr. Miyagi).  The conclusion there was that the Video card drivers were to blame.  That would have been great for me if I had the same type of video card, but my M6700 has an ATI / AMD FirePro graphics card, with totally different drivers.  I decided it was worth a shot updating the graphics drivers anyway.

After updating to a new version of the Catalyst Pro Control Center from AMD (formerly ATI), and re-packaged by Dell for their own "special" "made for Dell" version of the graphics card, a new option (at least one I hadn't noticed before) showed up in the "Power" settings.  A feature called "PowerPlay" had previously plugged itself into the Windows power management options.  PowerPlay allowed one of two settings, "Maximize Performance" or "Maximize Battery Life."  One of those two options could be selected as active when "Plugged In" and one of the same two options could be selected as active when running on the battery.  It makes no sense to name something "Maximize Battery Life" as an option that is available when "Plugged In" but that's beside the point.  The "new" option available in the Catalyst Pro Control Center was a checkbox labeled "Enable PowerPlay."  Unchecking that box to completely disable "PowerPlay", and clicking the "Apply" button caused the GPU temperature to drop and stabilize around 50 degrees C.  At first, this seemed to resolve the on off on off on off nonsense, but after a little while it was back to the same on/off/on/off/on/off behavior.

I wish I could say this issue was resolved, but so far, the toggling fan on the m6700 seems to be be a fact of life.  This will probably be the very last Dell computer I ever bother to buy.  Sorry Dell... if you can't get something as simple as fan-speed right, I can't trust you with much else.

I'm hoping maybe this is one piece of the puzzle and that someone else may have figured out what else is contributing to the bizarre (lack of) fan control on the M6700.  Please leave a comment if you know of something else that helps with this issue.

Tuesday, April 9, 2013

payUSAtax.com is a ripoff

In case you owe a little bit more in taxes on your federal tax return, and you happen to be filing electronically using the HRBlock software, there's something I'd like to warn you about. The front page at https://payusatax.com/hrblockpaytax/Default.aspx says the "Credit card convenience fee" is 1.89%. That is a lie. I didn't want to make a trip to the post office to mail the $15 I owed in taxes so I thought payusatax.com would be worth 1.89% of $15. That's only about 29¢, right? Well, I got charged $3.89 for the convenience fee.

That's about 26%

I searched to see if I could find out what the fee would be before I selected the credit card payment option but couldn't find much. I'm posting this so that others might find it before they make the decision to pay such an exorbitant "convenience" fee. HRBlock should be ashamed.

Tuesday, January 1, 2013

Alternative Minimum Tax (AMT) for 2012 Taxes

I bought a copy of the HRBlock At Home tax software early this year so I could figure out how much extra withholding to request on my last paycheck to avoid an under-payment penalty. After putting in all the rough numbers, which are basically the same as they were last year, I noticed that my total tax liability was considerably higher than last year... by a few thousand $$.  This puzzled me because I didn't think the "fiscal cliff" tax issues affected 2012 taxes.

After snooping around a bit, I found the reason was related to the calculation of "Alternative Minimum Tax" or "AMT". I had heard rumblings about that bit of the tax code needing to be "patched" but didn't quite understand what that meant, mostly because it had NEVER affected me before. It took a little bit of reading, and reading between the sometimes-ambiguous lines on the tax forms to figure out how my tax liability had suddenly jumped up, even for the 2012 tax year, so now that I have it boiled down to the nuts and bolts, I'm posting an explanation here to save a few others the trouble of sorting it out on their own.

Note that the announced "fiscal cliff deal" supposedly fixes this, but the tax law hasn't changed yet, and neither has the "early release" tax software I have.  This may end up being a moot point, but even if it describes a bomb that didn't get dropped, someone may still find it informative. 

So, here's what the Alternative Minimum Tax requires a tax payer to calculate.
  1. The regular "Taxable Income" is calculated as usual by reducing the "Adjusted Gross Income" (AGI) by either a standard deduction ($11,900) or the total amount of itemized deductions (if that is more than $11,900), and then further reducing that by a fixed amount, $3,800, for each personal exemption.  
    • Example: Suppose a married couple with two kids (total of 4 personal exemptions) had an AGI of $90,000 and total itemized deductions of $13,000 (made up of $6000 in mortgage interest and charitable donations and $7000 of state tax and property tax).  Their taxable income would be $90K - $13K - (4 * $3,800) = $61,800.
  2. Then to calculate the "gross" AMT income, all state tax, local/city tax, or property tax and personal exemptions get ADDED BACK
    • Example (continued): $61,800 + $7,000 + (4 * $3,800) = $84,000
  3. Then a single "AMT exemption" amount, which is primarily based on filing status, is subtracted from the "gross" AMT income.
    • Example(continued): The 2011 exemption amount for a married couple was $74,500, so AMT taxable income $84,000 would be reduced by $74,500, leaving $9,500.
  4. Then, an "alternative" tax amount would be calculated on the AMT taxable income amount (i.e the amount left over after the AMT exemption is subtracted from the "gross" AMT income).
    • Example (continued): The AMT tax rate in this case is 26% (and it jumps to 28% for AMT taxable income over $175K), so in this case the tax amount is $9,500 * 0.26 = $2,470.  The normal tax on the original $61,800 taxable income would be $8,424, which is higher than the AMT tax amount anyway, so in 2011, AMT would not even apply... but keep reading about 2012 below...
    • See 2011 tax table: http://www.irs.gov/pub/irs-pdf/i1040tt.pdf
    • See 2011 form 6251 (AMT): http://www.esmarttax.com/uploadedfiles/media/tax_forms/2011/2011-federal-6251.pdf  (looking for an IRS direct link but 2012 is the only one there right now.)
In 2012 (unless the AMT is "patched") the AMT exemption amounts are being drastically reduced.  So this is what would happen in the example above where the exemption amount is now $45,000 instead of $74,500.

  1. Regular taxable income is calculated the same way
    • Same example: $61,800
  2. State and local / property taxes and personal exemptions are still added back for AMT purposes
    • Same example: $84,000
  3. HERE'S WHERE 2012 IS DIFFERENT!! The MUCH SMALLER AMT EXEMPTION AMOUNT is subtracted to find the final amount of AMT taxable income.
    • Example: As of 1/1/2012, the official 2012 Married-Filing-Jointly exemption is only $45,000, so $84K - $45K leaves $39K to be taxed at 26%.  This means the AMT tax amount is $10,140.  This WOULD be higher than the regular tax amount on taxable income of  $61,800, which was only $8424. So, that would be $10,140 - $8,424 or...
      $1,716 EXTRA TAX DUE ON APRIL 15th!!
    • See 2012 Tax table: http://www.irs.gov/pub/irs-dft/i1040tt--dft.pdf
    • See 2012 form 6251 (AMT): http://www.irs.gov/pub/irs-pdf/f6251.pdf
      • Note: As of 1/1/2013, the exemption amounts are not on the 6251 form.  The form says to refer to the instructions for the exemption amount on line 29.  However, the 2012 instructions were not out yet.  Check this IRS.gov page to get a copy of the 2012 form 6251 instructions when they're finally published.

Summary and Commentary

If the federal government doesn't "patch" the AMT exemption amounts, a lot of people with so-called "middle class"income levels will get slapped with a big chunk of extra taxes, due in April of 2013, on their 2012 income.  There's no time left to make adjustments.  For most people, they'd have to accumulate the money to pay the extra tax in the first few months of 2013.  As everyone knows, the economy is already in bad shape thanks to the out-of-control government spending and economic reluctance due to looming regulation and tax increases.  This would pile on by taking a few thousand dollars out of the economy for a very large number of families (perhaps 20 to 30 million families).  If the problem isn't fixed as part of the "fiscal cliff deal," that would remove 20 to 30 billion dollars from the already hurting economy to be spent instead on government programs that have been well proven to NOT motivate anywhere near as much useful economic activity.  Considering the "multiplier effect" (Google it if you don't know what that is) that could cause more like 250 billion in economic damage.  Then the economy shrinks, and the tax rate has to go up again to cover the cost of the rampant spending.  Then more damage is done by clamping off economic growth with a higher percentage of the whole economy executed as inefficient government spending, and the spiral continues until everything collapses.