12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838 |
- #LyX 2.1 created this file. For more info see http://www.lyx.org/
- \lyxformat 474
- \begin_document
- \begin_header
- \textclass article
- \begin_preamble
- \usepackage{color}
- \usepackage{url}
- \usepackage[pdfpagemode=None,pdfstartview=FitH,pdfview=FitH,colorlinks=true,pdftitle=Directional Deringing Filter,pdfauthor=Jean-Marc Valin]{hyperref}
- \end_preamble
- \use_default_options true
- \maintain_unincluded_children false
- \language english
- \language_package default
- \inputencoding auto
- \fontencoding global
- \font_roman default
- \font_sans default
- \font_typewriter default
- \font_math auto
- \font_default_family default
- \use_non_tex_fonts false
- \font_sc false
- \font_osf false
- \font_sf_scale 100
- \font_tt_scale 100
- \graphics default
- \default_output_format default
- \output_sync 0
- \bibtex_command default
- \index_command default
- \paperfontsize default
- \spacing single
- \use_hyperref false
- \papersize default
- \use_geometry true
- \use_package amsmath 1
- \use_package amssymb 1
- \use_package cancel 1
- \use_package esint 1
- \use_package mathdots 1
- \use_package mathtools 1
- \use_package mhchem 1
- \use_package stackrel 1
- \use_package stmaryrd 1
- \use_package undertilde 1
- \cite_engine basic
- \cite_engine_type default
- \biblio_style plain
- \use_bibtopic false
- \use_indices false
- \paperorientation portrait
- \suppress_date false
- \justification true
- \use_refstyle 1
- \index Index
- \shortcut idx
- \color #008000
- \end_index
- \leftmargin 2cm
- \topmargin 2cm
- \rightmargin 2cm
- \bottommargin 2cm
- \secnumdepth 3
- \tocdepth 3
- \paragraph_separation indent
- \paragraph_indentation default
- \quotes_language english
- \papercolumns 1
- \papersides 1
- \paperpagestyle default
- \tracking_changes false
- \output_changes false
- \html_math_output 0
- \html_css_as_file 0
- \html_be_strict false
- \end_header
- \begin_body
- \begin_layout Title
- Directional Deringing Filter
- \end_layout
- \begin_layout Author
- Jean-Marc Valin
- \end_layout
- \begin_layout Section
- Introduction
- \end_layout
- \begin_layout Standard
- This document describes a deringing filter that takes into account the direction
- of edges and patterns being filtered.
- The filter works by identifying the direction of each block and then adaptively
- filtering along the identified direction.
- In a second pass, the blocks are also filtered in a different direction,
- with more conservative thresholds to avoid blurring edges.
- \end_layout
- \begin_layout Section
- Direction Search
- \end_layout
- \begin_layout Standard
- The first step is to divide the image into blocks of fixed or variable size.
- Variable-size blocks make it possible to use large blocks on long, continuous
- edges and small blocks where edges intersect or change direction.
- A fixed block size is easier to implement and does not require signaling
- the sizes on a block-by-block basis.
- For this work, we consider a fixed block size of 8x8.
- \end_layout
- \begin_layout Standard
- Once the image is divided into blocks, we determine which direction best
- matches the pattern in each block.
- One way to determine the direction is to minimize mean squared difference
- (MSD) between the input block and a perfectly directional block.
- A perfectly directional block is a block for which each line along a certain
- direction has a constant value.
- For each direction, we assign a line number to each pixel, as shown in
- Fig.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand ref
- reference "fig:Lines-for-direction"
- \end_inset
- .
-
- \end_layout
- \begin_layout Standard
- \begin_inset Float figure
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Graphics
- filename dlines.eps
- scale 70
- \end_inset
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Line numbers for pixels following one direction in an 8x8 block.
- \begin_inset CommandInset label
- LatexCommand label
- name "fig:Lines-for-direction"
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \end_inset
- For each direction
- \begin_inset Formula $d$
- \end_inset
- , the MSD is defined as:
- \begin_inset Formula
- \begin{equation}
- \sigma_{d}^{2}=\frac{1}{N}\sum_{k\in\mathrm{block},d}\left[\sum_{p\in P_{d,k}}\left(x_{p}-\mu_{d,k}\right)^{2}\right]\ ,\label{eq:direction-variance0}
- \end{equation}
- \end_inset
- where
- \begin_inset Formula $x_{p}$
- \end_inset
- is the value of pixel
- \begin_inset Formula $p$
- \end_inset
- ,
- \begin_inset Formula $P_{d,k}$
- \end_inset
- is the set of pixels in line
- \begin_inset Formula $k$
- \end_inset
- following direction
- \begin_inset Formula $d$
- \end_inset
- ,
- \begin_inset Formula $N$
- \end_inset
- is the total number of pixels in the block, and
- \begin_inset Formula $\mu_{k}$
- \end_inset
- is the pixel average for line
- \begin_inset Formula $k$
- \end_inset
- :
- \begin_inset Formula
- \begin{equation}
- \mu_{d,k}=\frac{1}{N_{d,k}}\sum_{p\in P_{d,k}}x_{p}\ ,\label{eq:pixel-average}
- \end{equation}
- \end_inset
- where
- \begin_inset Formula $N_{d,k}$
- \end_inset
- is the cardinality of
- \begin_inset Formula $P_{d,k}$
- \end_inset
- .
- Substituting
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:pixel-average"
- \end_inset
- into
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:direction-variance0"
- \end_inset
- and simplifying, we get
- \begin_inset Formula
- \begin{equation}
- \sigma_{d}^{2}=\frac{1}{N}\left[\sum_{p\in\mathrm{block}}x_{p}^{2}-\sum_{k\in\mathrm{block},d}\frac{1}{N_{d,k}}\left(\sum_{p\in P_{d,k}}x_{p}\right)^{2}\right]\,,\label{eq:direction-variance1}
- \end{equation}
- \end_inset
- Considering that the first term of Eq.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:direction-variance1"
- \end_inset
- is constant with respect to
- \begin_inset Formula $d$
- \end_inset
- , we simply find the optimal direction
- \begin_inset Formula $d_{opt}$
- \end_inset
- as:
- \begin_inset Formula
- \begin{equation}
- d_{opt}=\max_{d}s_{d}\,,\label{eq:direction-variance2}
- \end{equation}
- \end_inset
- where
- \begin_inset Formula
- \begin{equation}
- s_{d}=\sum_{k\in\mathrm{block},d}\frac{1}{N_{d,k}}\left(\sum_{p\in P_{d,k}}x_{p}\right)^{2}\ .\label{eq:direction-variance3}
- \end{equation}
- \end_inset
- \end_layout
- \begin_layout Section
- Conditional Replacement Filter
- \end_layout
- \begin_layout Standard
- Just like the median filter and the bilateral filter, the conditional replacemen
- t filter is designed to remove noise without sharp blurring edges.
- However, it is simpler to compute and is easier to vectorize than the median
- filter of the bilateral filter.
- A regular linear filter with
- \begin_inset Formula $\left(2M+1\right)$
- \end_inset
- taps is defined as
- \begin_inset Formula
- \begin{equation}
- y\left(n\right)=\frac{1}{W}\sum_{k=-M}^{k=M}w_{k}x\left(n+k\right)\ ,\label{eq:linear-filter}
- \end{equation}
- \end_inset
- where
- \begin_inset Formula $W=\sum_{k=-M}^{M}w_{k}$
- \end_inset
- .
- \end_layout
- \begin_layout Standard
- The main difference between a regular filter and the conditional replacement
- filter is that for each tap, if
- \begin_inset Formula $x\left(n+k\right)$
- \end_inset
- differs from
- \begin_inset Formula $x\left(n\right)$
- \end_inset
- by more than a threshold
- \begin_inset Formula $T$
- \end_inset
- , then we use
- \begin_inset Formula $x\left(n\right)$
- \end_inset
- instead for the tap.
- The filter computation is illustrated in Fig.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand ref
- reference "fig:Conditional-filter-computation"
- \end_inset
- and an example is shown in Fig.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand ref
- reference "fig:Conditional-filter-example"
- \end_inset
- .
- \end_layout
- \begin_layout Standard
- \begin_inset Float figure
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Graphics
- filename crf_def.eps
- width 60col%
- \end_inset
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Conditional replacement filter computation
- \begin_inset CommandInset label
- LatexCommand label
- name "fig:Conditional-filter-computation"
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Standard
- \begin_inset Float figure
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Graphics
- filename crf_orig.eps
- lyxscale 60
- width 40col%
- \end_inset
- \begin_inset Graphics
- filename crf_noisy.eps
- lyxscale 60
- width 40col%
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Graphics
- filename crf_linear.eps
- lyxscale 60
- width 40col%
- \end_inset
- \begin_inset Graphics
- filename crf_out.eps
- lyxscale 60
- width 40col%
- \end_inset
- \lang english
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Conditional replacement filter example.
- Up-left: original signal, up-right: noisy signal, bottom-left: filtered
- with 7-tap linear filter, bottom-right: filtered with 7-tap conditional
- replacement filter.
-
- \begin_inset CommandInset label
- LatexCommand label
- name "fig:Conditional-filter-example"
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Standard
- Through alegbraic simplifications, the filter definition can be written
- in terms of the differences
- \begin_inset Formula $x\left(n+k\right)-x\left(n\right)$
- \end_inset
- , which yields
- \begin_inset Formula
- \begin{equation}
- y\left(n\right)=x\left(n\right)+\frac{1}{W}\sum_{k=-M,k\neq0}^{k=M}w_{k}f\left(x\left(n+k\right)-x\left(n\right),T\right)\ ,\label{eq:conditional-replacement-diff}
- \end{equation}
- \end_inset
- with the threshold function
- \begin_inset Formula
- \begin{equation}
- f\left(d,T\right)=\left\{ \begin{array}{ll}
- d & ,\left|d\right|<T\\
- 0 & ,\mathrm{otherwise}
- \end{array}\right.\ .\label{eq:threshold-function}
- \end{equation}
- \end_inset
- The advantage of this formulation is that the normalization by
- \begin_inset Formula $\frac{1}{W}$
- \end_inset
- can be approximated without causing any bias, even when
- \begin_inset Formula $W$
- \end_inset
- is not a power of two.
- \end_layout
- \begin_layout Subsection
- Directional Filtering
- \end_layout
- \begin_layout Standard
- The directional filter for pixel
- \begin_inset Formula $\left(i,j\right)$
- \end_inset
- is defined as the 7-tap conditional replacement filter
- \begin_inset Formula
- \begin{gather}
- y\left(i,j\right)=x\left(i,j\right)+\frac{1}{W}\sum_{k=1}^{3}w_{k}\left[f\left(x\left(i,j\right)-x\left(i+\left\lfloor kd_{y}\right\rfloor ,j+\left\lfloor kd_{x}\right\rfloor \right),T_{d}\right)\right.\nonumber \\
- \left.+f\left(x\left(i,j\right)-x\left(i-\left\lfloor kd_{y}\right\rfloor ,j-\left\lfloor kd_{x}\right\rfloor \right),T_{d}\right)\right]\label{eq:directional_filter}
- \end{gather}
- \end_inset
- where
- \begin_inset Formula $d_{x}$
- \end_inset
- and
- \begin_inset Formula $d_{y}$
- \end_inset
- define the direction,
- \begin_inset Formula $W$
- \end_inset
- is a constant normalizing factor,
- \begin_inset Formula $T_{d}$
- \end_inset
- is the filtering threshold for the block.
- The direction parameters are shown in Table
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand ref
- reference "tab:Direction-parameters"
- \end_inset
- .
- The weights
- \begin_inset Formula $w_{k}$
- \end_inset
- can be chosen so that
- \begin_inset Formula $W$
- \end_inset
- is a power of two.
- For example, Daala currently uses
- \begin_inset Formula $\mathbf{w}=\left[\begin{array}{ccc}
- 3 & 2 & 2\end{array}\right]$
- \end_inset
- with
- \begin_inset Formula $W=16$
- \end_inset
- .
- Since the direction is constant over 8x8 blocks, all operations in this
- filter are directly vectorizable over the blocks.
-
- \end_layout
- \begin_layout Standard
- \begin_inset Float table
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Tabular
- <lyxtabular version="3" rows="9" columns="3">
- <features rotate="0" tabularvalignment="middle">
- <column alignment="center" valignment="top">
- <column alignment="center" valignment="top">
- <column alignment="center" valignment="top">
- <row>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- Direction
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $d_{x}$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $d_{y}$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- -1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $-1/2$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 2
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 3
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $1/2$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 4
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 5
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $1/2$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 6
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 7
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $-1/2$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- </lyxtabular>
- \end_inset
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Direction parameters
- \begin_inset CommandInset label
- LatexCommand label
- name "tab:Direction-parameters"
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Subsection
- Second Stage Filter
- \end_layout
- \begin_layout Standard
- \begin_inset Float figure
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Graphics
- filename crf_direction.eps
- width 23col%
- \end_inset
- \begin_inset Graphics
- filename crf_across.eps
- width 40col%
- \end_inset
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Filtering along the direction (left) and filtering across the direction
- (right)
- \begin_inset CommandInset label
- LatexCommand label
- name "fig:Filtering-along-across"
- \end_inset
- .
-
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Standard
- The 7-tap directional filter is sometimes not enough to eliminate all ringing,
- so we use an additional filtering step that operates across the direction
- lines used in the first filter.
- Considering that the input of the second filter has considerably less ringing
- than the input of the second filter, and the fact that the second filter
- risks blurring edges, the position-dependent threshold
- \begin_inset Formula $T_{2}\left(i,j\right)$
- \end_inset
- for the second filter is set lower than that of the first filter
- \begin_inset Formula $T_{d}$
- \end_inset
- .
- The filter structure is the same as the one in Eq.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:directional_filter"
- \end_inset
- .
- The direction parameters for the second stage filter are shown in Table
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "tab:Ortho-parameters"
- \end_inset
- and the filter weights are
- \begin_inset Formula $\mathbf{w}=\left[\begin{array}{cc}
- 1 & 1\end{array}\right]$
- \end_inset
- with
- \begin_inset Formula $W=16/3$
- \end_inset
- .
- \end_layout
- \begin_layout Standard
- \begin_inset Float table
- wide false
- sideways false
- status open
- \begin_layout Plain Layout
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- centering{
- \end_layout
- \end_inset
- \begin_inset Tabular
- <lyxtabular version="3" rows="9" columns="3">
- <features rotate="0" tabularvalignment="middle">
- <column alignment="center" valignment="top">
- <column alignment="center" valignment="top">
- <column alignment="center" valignment="top">
- <row>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- Direction
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $d_{x}$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- \begin_inset Formula $d_{y}$
- \end_inset
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 2
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 3
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 4
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 5
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 6
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- </row>
- <row>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 7
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 1
- \end_layout
- \end_inset
- </cell>
- <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
- \begin_inset Text
- \begin_layout Plain Layout
- 0
- \end_layout
- \end_inset
- </cell>
- </row>
- </lyxtabular>
- \end_inset
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- }
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption Standard
- \begin_layout Plain Layout
- Second stage filter parameters
- \begin_inset CommandInset label
- LatexCommand label
- name "tab:Ortho-parameters"
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Section
- Setting Thresholds
- \end_layout
- \begin_layout Standard
- The thresholds
- \begin_inset Formula $T_{d}$
- \end_inset
- and
- \begin_inset Formula $T_{2}$
- \end_inset
- must be set high enough to smooth out ringing artefacts, but low enough
- to avoid blurring important details in the image.
- Although the ringing is
- \emph on
- roughly
- \emph default
- proportional to the quantization step size
- \begin_inset Formula $Q$
- \end_inset
- , as the quantizer increases the error grows slightly less than linearly
- because the unquantized coefficients become very small compared to
- \begin_inset Formula $Q$
- \end_inset
- .
- As a starting point for determining the thresholds, we use a power model
- of the form
- \begin_inset Formula
- \begin{equation}
- T_{0}=\alpha_{1}Q^{\beta}\ ,\label{eq:setting-Td}
- \end{equation}
- \end_inset
- with
- \begin_inset Formula $\beta=0.842$
- \end_inset
- in Daala, and where
- \begin_inset Formula $\alpha_{1}$
- \end_inset
- depends on the input scaling.
-
- \end_layout
- \begin_layout Standard
- Another factor that affects the optimal filtering threshold is the presence
- of strong directional edges/patterns.
- These can be estimated from the
- \begin_inset Formula $s_{d}$
- \end_inset
- parameters computed in Eq.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:direction-variance3"
- \end_inset
- as
- \begin_inset Formula
- \begin{equation}
- \delta=s_{d_{opt}}-s_{d_{ortho}}\ ,\label{eq:variande-delta}
- \end{equation}
- \end_inset
- where
- \begin_inset Formula $d_{ortho}=d_{opt}+4\ \left(\mathrm{mod}\,8\right)$
- \end_inset
- .
- We compute the direction filtering threshold for each block as
- \begin_inset Formula
- \[
- T_{d}=T_{0}\cdot\max\left(\frac{1}{2},\min\left(3,\alpha_{2}\left(\delta\cdot\delta_{sb}\right)^{1/6}\right)\right)\ ,
- \]
- \end_inset
- where
- \begin_inset Formula $\delta_{sb}$
- \end_inset
- is the average of the
- \begin_inset Formula $\delta$
- \end_inset
- values over the entire superblock and
- \begin_inset Formula $\alpha_{2}$
- \end_inset
- also depends on the input scaling.
- For the second filter, we use a more conservative threshold that depends
- on the amount of change caused by the directional filter.
- \begin_inset Formula
- \begin{equation}
- T_{2}\left(i,j\right)=\min\left(T_{d},\frac{T_{d}}{3}+\left|y\left(i,j\right)-x\left(i,j\right)\right|\right)\ .\label{eq:setting-T2}
- \end{equation}
- \end_inset
- \end_layout
- \begin_layout Standard
- As a special case, when the pixels corresponding to the 8x8 block being
- filtered are all skipped, then
- \begin_inset Formula $T_{d}=T_{2}=0$
- \end_inset
- , so no deringing is performed.
-
- \end_layout
- \begin_layout Section
- Superblock Filtering
- \end_layout
- \begin_layout Standard
- The filtering is applied one superblock at a time, conditional on a flag
- coded in the bit-stream.
- This binary flag is the only information coded in the bitstream by the
- deringing filter.
- The flag is only coded for superblocks that are not skipped and it is entropy-c
- oded based on the neighbour values.
-
- \end_layout
- \begin_layout Standard
- The deringing process sometimes reads pixels that lie outside of the superblock
- being processed.
- When these pixels belong to another superblock, the filtering always uses
- the unfiltered pixel values -- even for the second stage filter -- so that
- no dependency is added between the superblocks.
- This makes it possible -- in theory -- to filter all superblocks in parallel.
- When the pixels used for a filter lie outside of the viewable image, we
- set
- \begin_inset Formula $f\left(d,T\right)=0$
- \end_inset
- in Eq.
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset ref
- LatexCommand eqref
- reference "eq:threshold-function"
- \end_inset
- .
- \end_layout
- \begin_layout Section
- Results
- \end_layout
- \begin_layout Standard
- The deringing filter described here has been implemented for the Daala
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset citation
- LatexCommand cite
- key "Daala"
- \end_inset
- codec.
- It is available from the Daala Git repository
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset citation
- LatexCommand cite
- key "Daala-Git"
- \end_inset
- .
- We tested the deringing filter on the Are We Compressed Yet
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset citation
- LatexCommand cite
- key "AWCY"
- \end_inset
- ntt-short1 set over the 0.025
- \begin_inset space ~
- \end_inset
- bit/pixel to 0.1
- \begin_inset space ~
- \end_inset
- bit/pixel range, corresponding to a 1080p30 bitrate of 1.5
- \begin_inset space ~
- \end_inset
- Mbit/s to 6
- \begin_inset space ~
- \end_inset
- Mbit/s.
- The Bjøntegaard-delta
- \begin_inset space ~
- \end_inset
- \begin_inset CommandInset citation
- LatexCommand cite
- key "Testing-draft"
- \end_inset
- rate reduction over that range was 6.5% for PSNR, 4.7% for PSNR-HVS, 5.6%
- for SSIM and -6.0% (regression) for FAST-SSIM.
- Visual inspection confirmed that the quality is indeed improved, despite
- the regression in the FAST-SSIM result.
-
- \end_layout
- \begin_layout Section
- Conclusion
- \end_layout
- \begin_layout Standard
- We have demonstrated an effective algorithm to remove ringing artefacts
- from coded images and videos.
- The proposed filter takes into account the directionality of the patterns
- it is filtering to reduce the risk of blurring.
-
- \end_layout
- \begin_layout Bibliography
- \begin_inset CommandInset bibitem
- LatexCommand bibitem
- key "Daala"
- \end_inset
- Daala website, Xiph.Org Foundation.
-
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- url{http://xiph.org/daala/}
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Bibliography
- \begin_inset CommandInset bibitem
- LatexCommand bibitem
- key "Daala-Git"
- \end_inset
- Daala Git repository.
-
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- url{http://git.xiph.org/?p=daala.git;a=summary}
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Bibliography
- \begin_inset CommandInset bibitem
- LatexCommand bibitem
- label "3"
- key "AWCY"
- \end_inset
- Are We Compressed Yet.
-
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- url{https://arewecompressedyet.com/}
- \end_layout
- \end_inset
- \end_layout
- \begin_layout Bibliography
- \begin_inset CommandInset bibitem
- LatexCommand bibitem
- label "4"
- key "Testing-draft"
- \end_inset
- T.
- Daede, J.
- Moffitt,
- \emph on
- Video Codec Testing and Quality Measurement
- \emph default
- , IETF Internet draft, 2015.
-
- \begin_inset ERT
- status open
- \begin_layout Plain Layout
- \backslash
- url{https://tools.ietf.org/html/draft-daede-netvc-testing}
- \end_layout
- \end_inset
- \end_layout
- \end_body
- \end_document
|