Thanks for the compliment, Emil, but it's not deserved. The right part of the window (which doesn't appear on the image) has some moire. Although I have better results than the following I'm not able to find a way for interpolating it correctly. It's the hardest file I've ever tried:

http://raw.fotosite.pl/download-Pent...4/IMGP7093.PEF
How does AMaZE deal with this RAW? It will be a relief for me knowing that this window can be perfectly demosaiced. 
If you don't mind I would like to answer your questions here since I think they are of general interest and I will send you some more information privately in a while:
HOI is the acronym of High-Order Interpolation (at pixel level) which takes advantadge of the spectral correlation of the neighbor pixels in one direction up to five pixel distance from the guessed value. The best method I've found is the one proposed by Li and Randhawa in their Color Filter Array Demosaicking Using High-Order Interpolation Techniques With a Weighted Median Filter for Sharp Color Edge Preservation reference:
Código:
N=CLIP((23*pix[-u][1]+23*pix[-w][1]+pix[-y][1]+pix[+u][1]+8*(pix[-v][c]-pix[-x][c])+40*(pix[0][c]-pix[-v][c]))/48);
E=CLIP((23*pix[+1][1]+23*pix[+3][1]+pix[+5][1]+pix[-1][1]+8*(pix[+2][c]-pix[+4][c])+40*(pix[0][c]-pix[+2][c]))/48);
S=CLIP((23*pix[+u][1]+23*pix[+w][1]+pix[+y][1]+pix[-u][1]+8*(pix[+v][c]-pix[+x][c])+40*(pix[0][c]-pix[+v][c]))/48);
W=CLIP((23*pix[-1][1]+23*pix[-3][1]+pix[-5][1]+pix[+1][1]+8*(pix[-2][c]-pix[-4][c])+40*(pix[0][c]-pix[-2][c]))/48);
For those not used to dcraw notation, "CLIP" limits the guessed value between 0 and 65535, "c" are the red/blue channel depending on the location, and "u","v","w","x","y" are the inmediately 1st,2nd,3rd,4th,5th upper pixels respectively. After that they use a weighted median for smoothing overshoted pixels but I've never coded it to see how it works.
This method is really nice (color rendition is near perfection) in the absence of a sharp edge and also seems to increase accutance in high ISO shots, giving a pleasant, colorless noise but it fails noticeably in some obvious regions.

For comparison purposes, the widely used Hamilton-Adams method (in fact I think it's the one chosen both in LMMSE and in AFD) is as follows:
Código:
N=CLIP(pix[-u][1]+(pix[0][c]-pix[-v][c])/2);
E=CLIP(pix[+1][1]+(pix[0][c]-pix[+2][c])/2);
S=CLIP(pix[+u][1]+(pix[0][c]-pix[+v][c])/2);
W=CLIP(pix[-1][1]+(pix[0][c]-pix[-2][c])/2);
I find more accurate working with ratios but it's also more tricky when strong signal variations are present. I know there is an old reference from Lukac that also uses ratios, but I've never had access to it. Basically I use a mix between H/A and my adaptive ratios. I've tried an adaptive method with HOI in low frequency regions but time consumption was too high and the improvements didn't worth it.
Just for curiosity I believe the new demosaicing in Lightroom Beta 3 is also using ratios with any kind of limit based on the following picture (the output of my algorithm is "AR + H/A" -without the color degradation near the letters introduced by the GIF-):

I supppose those dots are a non reported bug they will fix sooner or later. Adobe team, if you are reading this, my algorithm is on sale. 
On the other side EECI is a kind of refinement partially coded by Paul Lee some time ago. The reference is the following:
http://www3.ntu.edu.sg/home5/CHAN0069/JEI013003.pdf
It's used by some algorithms (vg. LMMSE) in order to increase PSNR and reduce false colors.
Best regards,
-Luis
Marcadores