function Deblock_QED ( clip clp, int "quant1", int "quant2", \ int "aOff1", int "bOff1", int "aOff2", int "bOff2", int "uv" ) { quant1 = default( quant1, 24 ) quant2 = default( quant2, 22 ) aOff1 = default( aOff1, 2 ) bOff1 = default( bOff1, 4 ) aOff2 = default( aOff2, 4 ) bOff2 = default( bOff2, 8 ) uv = default( uv, 1 ) # uv=3 -> use proposed method for chroma deblocking # uv=2 -> no chroma deblocking at all (fastest method) # uv=1|-1 -> directly use chroma debl. from the normal|strong deblock() ox = clp.width() oy = clp.height() xmod = 16-(ox%16) ymod = 16-(oy%16) clp = (xmod==16) ? clp : clp.pointresize(ox+xmod,oy,0,0,ox+xmod+0.01,oy) clp = (ymod==16) ? clp : clp.pointresize(clp.width(),oy+ymod,0,0,clp.width(),oy+ymod-0.01) # With avisynth scripting, there is no information available about the position of the currently # processed pixel ... there simply is no such thing like an "actual" processed pixel. # So first I've to build up a grid covering the transitions between all 8x8 blocks, # and make some LUTmania with it later. Yes, this is cumbersome. block = blankclip(clp,width=6*4,height=6*4,color=$000000).addborders(4,4,4,4,color=$FFFFFF) block = stackhorizontal( block,block,block,block) block = stackvertical( block,block,block,block) .pointresize(32,32) .mt_binarize(upper=false) block = stackhorizontal( block,block,block,block,block,block,block,block) block = stackvertical( block,block,block,block,block,block) block = stackhorizontal( block,block,block) block = stackvertical( block,block,block) block = (block.width