intra_paint.lyx 21 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. #LyX 2.1 created this file. For more info see http://www.lyx.org/
  2. \lyxformat 474
  3. \begin_document
  4. \begin_header
  5. \textclass article
  6. \begin_preamble
  7. \usepackage{color}
  8. \usepackage{url}
  9. \usepackage[pdfpagemode=None,pdfstartview=FitH,pdfview=FitH,colorlinks=true,pdftitle=Perceptual Vector Quantization for Video Coding,pdfauthor=Jean-Marc Valin]{hyperref}
  10. \end_preamble
  11. \use_default_options true
  12. \maintain_unincluded_children false
  13. \language english
  14. \language_package default
  15. \inputencoding auto
  16. \fontencoding global
  17. \font_roman default
  18. \font_sans default
  19. \font_typewriter default
  20. \font_math auto
  21. \font_default_family default
  22. \use_non_tex_fonts false
  23. \font_sc false
  24. \font_osf false
  25. \font_sf_scale 100
  26. \font_tt_scale 100
  27. \graphics default
  28. \default_output_format default
  29. \output_sync 0
  30. \bibtex_command default
  31. \index_command default
  32. \paperfontsize default
  33. \spacing single
  34. \use_hyperref false
  35. \papersize default
  36. \use_geometry true
  37. \use_package amsmath 1
  38. \use_package amssymb 1
  39. \use_package cancel 1
  40. \use_package esint 1
  41. \use_package mathdots 1
  42. \use_package mathtools 1
  43. \use_package mhchem 1
  44. \use_package stackrel 1
  45. \use_package stmaryrd 1
  46. \use_package undertilde 1
  47. \cite_engine basic
  48. \cite_engine_type default
  49. \biblio_style plain
  50. \use_bibtopic false
  51. \use_indices false
  52. \paperorientation portrait
  53. \suppress_date false
  54. \justification true
  55. \use_refstyle 1
  56. \index Index
  57. \shortcut idx
  58. \color #008000
  59. \end_index
  60. \leftmargin 2cm
  61. \topmargin 2cm
  62. \rightmargin 2cm
  63. \bottommargin 2cm
  64. \secnumdepth 3
  65. \tocdepth 3
  66. \paragraph_separation indent
  67. \paragraph_indentation default
  68. \quotes_language english
  69. \papercolumns 1
  70. \papersides 1
  71. \paperpagestyle default
  72. \tracking_changes false
  73. \output_changes false
  74. \html_math_output 0
  75. \html_css_as_file 0
  76. \html_be_strict false
  77. \end_header
  78. \begin_body
  79. \begin_layout Title
  80. Intra Paint Deringing Filter
  81. \end_layout
  82. \begin_layout Author
  83. Jean-Marc Valin
  84. \end_layout
  85. \begin_layout Section
  86. Introduction
  87. \end_layout
  88. \begin_layout Standard
  89. Intra paint is a pixel domain technique designed to reconstruct images based
  90. only on a direction and the pixels that lie on block boundaries.
  91. Intra paint can be used either for directly encoding images, or as a post-proce
  92. ssing deringing filter to reduce coding artefacts.
  93. \end_layout
  94. \begin_layout Section
  95. Intra Paint Algorithm
  96. \end_layout
  97. \begin_layout Standard
  98. The intra paint algorithm works in four steps:
  99. \end_layout
  100. \begin_layout Subsection*
  101. Step 1: Dividing Into Blocks
  102. \end_layout
  103. \begin_layout Standard
  104. The first step is to divide the image into blocks of fixed or variable size
  105. (Fig.
  106. \begin_inset space ~
  107. \end_inset
  108. \begin_inset CommandInset ref
  109. LatexCommand ref
  110. reference "fig:Input-image-divided"
  111. \end_inset
  112. ).
  113. Variable-size blocks make it possible to use large blocks on long, continuous
  114. edges and small blocks where edges intersect or change direction.
  115. Fixed block size is easier to implement, especially in the deringing applicatio
  116. n where we do not wish to signal the sizes on a block-by-block basis.
  117. For deringing purposes a block size around 8x8 is generally suitable.
  118. \end_layout
  119. \begin_layout Standard
  120. \begin_inset Float figure
  121. wide false
  122. sideways false
  123. status open
  124. \begin_layout Plain Layout
  125. \begin_inset ERT
  126. status open
  127. \begin_layout Plain Layout
  128. \backslash
  129. centering{
  130. \end_layout
  131. \end_inset
  132. \begin_inset Graphics
  133. filename fruits_block2_luma.jpg
  134. width 85col%
  135. \end_inset
  136. \begin_inset ERT
  137. status open
  138. \begin_layout Plain Layout
  139. }
  140. \end_layout
  141. \end_inset
  142. \begin_inset Caption Standard
  143. \begin_layout Plain Layout
  144. Input image divided into fixed 32x32 blocks.
  145. \begin_inset CommandInset label
  146. LatexCommand label
  147. name "fig:Input-image-divided"
  148. \end_inset
  149. \end_layout
  150. \end_inset
  151. \end_layout
  152. \end_inset
  153. \end_layout
  154. \begin_layout Subsection*
  155. Step 2: Direction Search
  156. \end_layout
  157. \begin_layout Standard
  158. Once the image is divided into blocks, we determine which direction best
  159. matches the pattern in each block (Fig.
  160. \begin_inset space ~
  161. \end_inset
  162. \begin_inset CommandInset ref
  163. LatexCommand ref
  164. reference "fig:Dominant-direction"
  165. \end_inset
  166. ).
  167. The direction is only signaled when operating as an image encoder.
  168. One way to determine the direction is to minimize the pixel variance.
  169. For each direction, we assign a line number to each pixel, as shown in
  170. Fig.
  171. \begin_inset space ~
  172. \end_inset
  173. \begin_inset CommandInset ref
  174. LatexCommand ref
  175. reference "fig:Lines-for-direction"
  176. \end_inset
  177. .
  178. \end_layout
  179. \begin_layout Standard
  180. \begin_inset Float figure
  181. wide false
  182. sideways false
  183. status open
  184. \begin_layout Plain Layout
  185. \end_layout
  186. \begin_layout Plain Layout
  187. \begin_inset ERT
  188. status open
  189. \begin_layout Plain Layout
  190. \backslash
  191. centering{
  192. \end_layout
  193. \end_inset
  194. \begin_inset Graphics
  195. filename dlines.eps
  196. scale 80
  197. \end_inset
  198. \begin_inset ERT
  199. status open
  200. \begin_layout Plain Layout
  201. }
  202. \end_layout
  203. \end_inset
  204. \begin_inset Caption Standard
  205. \begin_layout Plain Layout
  206. Line numbers for pixels following one direction in an 8x8 block.
  207. \begin_inset CommandInset label
  208. LatexCommand label
  209. name "fig:Lines-for-direction"
  210. \end_inset
  211. \end_layout
  212. \end_inset
  213. \end_layout
  214. \end_inset
  215. For each direction
  216. \begin_inset Formula $d$
  217. \end_inset
  218. , the variance is defined as:
  219. \begin_inset Formula
  220. \begin{equation}
  221. \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}
  222. \end{equation}
  223. \end_inset
  224. where
  225. \begin_inset Formula $x_{p}$
  226. \end_inset
  227. is the value of pixel
  228. \begin_inset Formula $p$
  229. \end_inset
  230. ,
  231. \begin_inset Formula $P_{d,k}$
  232. \end_inset
  233. is the set of pixels in line
  234. \begin_inset Formula $k$
  235. \end_inset
  236. following direction
  237. \begin_inset Formula $d$
  238. \end_inset
  239. ,
  240. \begin_inset Formula $N$
  241. \end_inset
  242. is the total number of pixels in the block, and
  243. \begin_inset Formula $\mu_{k}$
  244. \end_inset
  245. is the pixel average for line
  246. \begin_inset Formula $k$
  247. \end_inset
  248. :
  249. \begin_inset Formula
  250. \begin{equation}
  251. \mu_{d,k}=\frac{1}{N_{d,k}}\sum_{p\in P_{d,k}}x_{p}\ ,\label{eq:pixel-average}
  252. \end{equation}
  253. \end_inset
  254. where
  255. \begin_inset Formula $N_{d,k}$
  256. \end_inset
  257. is the cardinality of
  258. \begin_inset Formula $P_{d,k}$
  259. \end_inset
  260. .
  261. Substituting
  262. \begin_inset CommandInset ref
  263. LatexCommand eqref
  264. reference "eq:pixel-average"
  265. \end_inset
  266. into
  267. \begin_inset CommandInset ref
  268. LatexCommand eqref
  269. reference "eq:direction-variance0"
  270. \end_inset
  271. and simplifying, we get
  272. \begin_inset Formula
  273. \begin{equation}
  274. \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}
  275. \end{equation}
  276. \end_inset
  277. Considering that the first term of Eq.
  278. \begin_inset CommandInset ref
  279. LatexCommand eqref
  280. reference "eq:direction-variance1"
  281. \end_inset
  282. is constant with respect to
  283. \begin_inset Formula $d$
  284. \end_inset
  285. , we simply find the optimal direction
  286. \begin_inset Formula $d_{opt}$
  287. \end_inset
  288. as:
  289. \begin_inset Formula
  290. \begin{equation}
  291. d_{opt}=\max_{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-variance2}
  292. \end{equation}
  293. \end_inset
  294. \end_layout
  295. \begin_layout Standard
  296. \begin_inset Float figure
  297. wide false
  298. sideways false
  299. status open
  300. \begin_layout Plain Layout
  301. \begin_inset ERT
  302. status open
  303. \begin_layout Plain Layout
  304. \backslash
  305. centering{
  306. \end_layout
  307. \end_inset
  308. \begin_inset Graphics
  309. filename fruits_direction_small.png
  310. width 85col%
  311. \end_inset
  312. \begin_inset ERT
  313. status open
  314. \begin_layout Plain Layout
  315. }
  316. \end_layout
  317. \end_inset
  318. \begin_inset Caption Standard
  319. \begin_layout Plain Layout
  320. Dominant direction for each block of the image (a dot means no dominant
  321. direction).
  322. \begin_inset CommandInset label
  323. LatexCommand label
  324. name "fig:Dominant-direction"
  325. \end_inset
  326. \end_layout
  327. \end_inset
  328. \end_layout
  329. \end_inset
  330. \end_layout
  331. \begin_layout Subsection*
  332. Step 3: Boundary Pixels
  333. \end_layout
  334. \begin_layout Standard
  335. Determine the pixel values at block boundaries (Fig.
  336. \begin_inset space ~
  337. \end_inset
  338. \begin_inset CommandInset ref
  339. LatexCommand ref
  340. reference "fig:Optimal-pixel-values"
  341. \end_inset
  342. ) that optimally match the image using the directions found in step
  343. \begin_inset space ~
  344. \end_inset
  345. 2.
  346. While directly using the pixels that lie on the block boundaries would
  347. work to some extent, we can generate a better image when also considering
  348. the pixels within the blocks.
  349. \end_layout
  350. \begin_layout Standard
  351. When operating as an encoder, we need to code these pixels, but we can use
  352. intra prediction from other block boundaries to help save bits.
  353. This can be done by copying already coded pixels in the same line as the
  354. pixels being predicted -- in a similar way to existing video codecs, except
  355. that only boundary pixels are predicted.
  356. \end_layout
  357. \begin_layout Standard
  358. \begin_inset Float figure
  359. wide false
  360. sideways false
  361. status open
  362. \begin_layout Plain Layout
  363. \begin_inset ERT
  364. status open
  365. \begin_layout Plain Layout
  366. \backslash
  367. centering{
  368. \end_layout
  369. \end_inset
  370. \begin_inset Graphics
  371. filename fruits_edges2_luma_small.png
  372. width 85col%
  373. \end_inset
  374. \begin_inset ERT
  375. status open
  376. \begin_layout Plain Layout
  377. }
  378. \end_layout
  379. \end_inset
  380. \begin_inset Caption Standard
  381. \begin_layout Plain Layout
  382. Optimal pixel values at block boundaries.
  383. \begin_inset CommandInset label
  384. LatexCommand label
  385. name "fig:Optimal-pixel-values"
  386. \end_inset
  387. \end_layout
  388. \end_inset
  389. \end_layout
  390. \end_inset
  391. \end_layout
  392. \begin_layout Subsection*
  393. Step 4: Painting
  394. \end_layout
  395. \begin_layout Standard
  396. For each block, use all four boundaries as well as the direction to paint
  397. the pixels inside the block (Fig.
  398. \begin_inset space ~
  399. \end_inset
  400. \begin_inset CommandInset ref
  401. LatexCommand ref
  402. reference "fig:Reconstructed-painted-image"
  403. \end_inset
  404. ).
  405. The boundary pixels encoded in step
  406. \begin_inset space ~
  407. \end_inset
  408. 3 are not taken directly from the original image, but rather optimized to
  409. give the best prediction of the original image at this stage.
  410. Block discontinuities are avoided by blending within blocks based on the
  411. distance to each boundary.
  412. Each pixel is reconstructed from up to 4
  413. \begin_inset space ~
  414. \end_inset
  415. boundary pixels as
  416. \begin_inset Formula
  417. \begin{equation}
  418. y_{p}=\sum_{i=1}^{4}w_{p,i,d}\cdot x_{p,i,d}\ ,\label{eq:pixel-painting}
  419. \end{equation}
  420. \end_inset
  421. where
  422. \begin_inset Formula $x_{p,i,d}$
  423. \end_inset
  424. are the 4
  425. \begin_inset space ~
  426. \end_inset
  427. boundary pixel values used to predict pixel
  428. \begin_inset Formula $p$
  429. \end_inset
  430. for direction
  431. \begin_inset Formula $d$
  432. \end_inset
  433. and
  434. \begin_inset Formula $w_{p,i,d}$
  435. \end_inset
  436. are the corresponding weights and sum to one.
  437. The weights are computed in such a way as to interpolate between adjacent
  438. boundary pixels, while also blending the prediction coming from each end
  439. of the prediction line.
  440. An example is provided in Fig.
  441. \begin_inset space ~
  442. \end_inset
  443. \begin_inset CommandInset ref
  444. LatexCommand ref
  445. reference "fig:Interpolation-of-pixel"
  446. \end_inset
  447. .
  448. \end_layout
  449. \begin_layout Standard
  450. \begin_inset Float figure
  451. wide false
  452. sideways false
  453. status open
  454. \begin_layout Plain Layout
  455. \begin_inset ERT
  456. status open
  457. \begin_layout Plain Layout
  458. \backslash
  459. centering{
  460. \backslash
  461. scalebox{1.0}{
  462. \backslash
  463. input{interp.pspdftex}}}
  464. \end_layout
  465. \end_inset
  466. \end_layout
  467. \begin_layout Plain Layout
  468. \begin_inset Caption Standard
  469. \begin_layout Plain Layout
  470. Interpolation of pixel (2,4) from pixels (-1,2), (-1,3), (7,6), and (7,7).
  471. The current block shown in gray.
  472. \begin_inset CommandInset label
  473. LatexCommand label
  474. name "fig:Interpolation-of-pixel"
  475. \end_inset
  476. \end_layout
  477. \end_inset
  478. \end_layout
  479. \begin_layout Plain Layout
  480. \end_layout
  481. \end_inset
  482. \end_layout
  483. \begin_layout Standard
  484. It turns out that the weights used in
  485. \begin_inset CommandInset ref
  486. LatexCommand ref
  487. reference "eq:pixel-painting"
  488. \end_inset
  489. are exactly the same as those we want to use in Step
  490. \begin_inset space ~
  491. \end_inset
  492. 3.
  493. In other words, for each pixel in the block in Step
  494. \begin_inset space ~
  495. \end_inset
  496. 3, we use the weights to do the accumulation on the corresponding boundary
  497. pixels.
  498. This in turn minimizes the distance between the original and the painted
  499. image
  500. \begin_inset Formula
  501. \begin{equation}
  502. D=\sum_{p}\left(x_{p}-y_{p}\right)^{2}\label{eq:distance}
  503. \end{equation}
  504. \end_inset
  505. over the entire image.
  506. \end_layout
  507. \begin_layout Standard
  508. \begin_inset Float figure
  509. wide false
  510. sideways false
  511. status open
  512. \begin_layout Plain Layout
  513. \begin_inset ERT
  514. status open
  515. \begin_layout Plain Layout
  516. \backslash
  517. centering{
  518. \end_layout
  519. \end_inset
  520. \begin_inset Graphics
  521. filename fruits_recons2_luma.jpg
  522. width 85col%
  523. \end_inset
  524. \begin_inset ERT
  525. status open
  526. \begin_layout Plain Layout
  527. }
  528. \end_layout
  529. \end_inset
  530. \begin_inset Caption Standard
  531. \begin_layout Plain Layout
  532. Reconstructed
  533. \begin_inset Quotes eld
  534. \end_inset
  535. painted
  536. \begin_inset Quotes erd
  537. \end_inset
  538. image.
  539. \begin_inset CommandInset label
  540. LatexCommand label
  541. name "fig:Reconstructed-painted-image"
  542. \end_inset
  543. \end_layout
  544. \end_inset
  545. \end_layout
  546. \end_inset
  547. \end_layout
  548. \begin_layout Section
  549. Deringing Filter
  550. \end_layout
  551. \begin_layout Standard
  552. Intra paint can be used as a post-processing step to attenuate the coding
  553. artefacts.
  554. The idea is that there are regions of the image (e.g.
  555. close to edges) where the painted version looks better than the coded image,
  556. especially at low bitrate.
  557. Of course, it would be bad to replace the entire image with the painted
  558. version.
  559. We would only want to do use it in places where it improves quality.
  560. We also want to avoid spending too many bits on the painting process or
  561. on signaling which are the pixels that benefit.
  562. \end_layout
  563. \begin_layout Standard
  564. For deringing purposes, instead of running the paint algorithm on the original
  565. image and sending information about the directions and edges, we can simply
  566. run the algorithm on the decoded image.
  567. The second part is trickier.
  568. How can we know which pixels should be replaced with the painted pixels
  569. and which ones are best unmodified? Intuitively, we see that in regions
  570. of the image that have clear directional patterns, the painted image should
  571. be much closer to the decoded image than in regions with unpredictable
  572. texture.
  573. Not only that, but knowing the quality at which the image was coded, we
  574. have an idea of the amount of quantization noise that was introduced, which
  575. is also the magnitude of the difference we can expect between decoded image
  576. and its painted version.
  577. \end_layout
  578. \begin_layout Standard
  579. Let
  580. \begin_inset Formula $\mathbf{x}_{k}$
  581. \end_inset
  582. be the decoded pixels on a line
  583. \begin_inset Formula $k$
  584. \end_inset
  585. and
  586. \begin_inset Formula $\mathbf{y}_{k}$
  587. \end_inset
  588. be the painted version of the same line, the deringing output is given
  589. by
  590. \begin_inset Formula
  591. \begin{equation}
  592. \mathbf{z}_{k}=\left(1-g_{k}\right)\mathbf{x}_{k}+g_{k}\mathbf{y}_{k}\ ,\label{eq:deringing-output}
  593. \end{equation}
  594. \end_inset
  595. where
  596. \begin_inset Formula $g_{k}$
  597. \end_inset
  598. is the filter gain.
  599. The gain that minimizes the expected mean squared error is given by
  600. \begin_inset Formula
  601. \begin{equation}
  602. g_{k}=\min\left[1,\ \frac{\alpha Q^{2}}{12\sigma_{k}^{2}}\right]\label{eq:deringing-weight}
  603. \end{equation}
  604. \end_inset
  605. where
  606. \begin_inset Formula $Q$
  607. \end_inset
  608. is the image quality (quantization step size),
  609. \begin_inset Formula $\sigma_{k}^{2}=\left\Vert \mathbf{x}_{k}-\mathbf{y}_{k}\right\Vert ^{2}$
  610. \end_inset
  611. is the mean squared distance between decoded image and the painted image,
  612. and
  613. \begin_inset Formula $\alpha$
  614. \end_inset
  615. is a tunable parameter between 0 and 1.
  616. Computing a weight along each line of a diven direction provides more control
  617. than computing the weight at the block level.
  618. \end_layout
  619. \begin_layout Standard
  620. Instead of computing
  621. \begin_inset CommandInset ref
  622. LatexCommand eqref
  623. reference "eq:deringing-output"
  624. \end_inset
  625. and
  626. \begin_inset CommandInset ref
  627. LatexCommand eqref
  628. reference "eq:deringing-weight"
  629. \end_inset
  630. separately on each line of each block, we can compute
  631. \begin_inset Formula $\sigma_{k}^{2}$
  632. \end_inset
  633. on block boundary pixels in the same way as we computed the pixel averages
  634. in Step 3.
  635. This allows us to compute the partial gain
  636. \begin_inset Formula
  637. \begin{equation}
  638. g_{k}^{*}=\frac{Q^{2}}{12\sigma_{k}^{2}}\label{eq:partial-gain}
  639. \end{equation}
  640. \end_inset
  641. on each boundary pixel.
  642. From there, we can treat the
  643. \begin_inset Formula $g_{k}^{*}$
  644. \end_inset
  645. values in the same way as pixels and apply the paint algorithm in Step
  646. 4 to fill the
  647. \begin_inset Formula $g_{k}^{*}$
  648. \end_inset
  649. values that are inside the blocks.
  650. This provides us with a continuously-varying gain across the image.
  651. The final gain then becomes
  652. \begin_inset Formula
  653. \begin{equation}
  654. g_{k}=\min\left[1,\ \alpha g_{k}^{*}\right]\label{eq:final_gain}
  655. \end{equation}
  656. \end_inset
  657. where the
  658. \begin_inset Formula $\alpha$
  659. \end_inset
  660. parameter is the only information coded for the deringing filter.
  661. Typically, the encoder selects
  662. \begin_inset Formula $\alpha$
  663. \end_inset
  664. by comparing the filter output to the original image and picking the
  665. \begin_inset Formula $\alpha$
  666. \end_inset
  667. value that minimizes a certain cost metric (e.g.
  668. PSNR).
  669. To reduce the signaling overhead,
  670. \begin_inset Formula $\alpha$
  671. \end_inset
  672. is typically signaled over a larger block size than the painting itself.
  673. For example, good results were obtained when signaling
  674. \begin_inset Formula $\alpha$
  675. \end_inset
  676. only on 32x32 superblocks.
  677. \end_layout
  678. \begin_layout Subsection
  679. Simplifications
  680. \end_layout
  681. \begin_layout Standard
  682. \begin_inset CommandInset label
  683. LatexCommand label
  684. name "sub:Simplifications"
  685. \end_inset
  686. \end_layout
  687. \begin_layout Standard
  688. In some applications, applying the algorithm as described above may require
  689. too much CPU time.
  690. In that case, some simplifications are possible.
  691. It is possible to reduce complexity by skipping Step 3 of the paint algorithm
  692. and painting each block independently.
  693. Although this may increase boundary effects around blocks, it may still
  694. be acceptable for deringing purposes.
  695. Alternatively, the painting may be performed on overlapping blocks, which
  696. would reduce blocking artefacts at the cost of higher complexity.
  697. \end_layout
  698. \begin_layout Standard
  699. It is also possible to reduce the complexity of the filter gain computation
  700. by only computing
  701. \begin_inset Formula $g$
  702. \end_inset
  703. on a block-by-block basis.
  704. \end_layout
  705. \begin_layout Section
  706. Implementation
  707. \end_layout
  708. \begin_layout Standard
  709. A deringing filter based on the intra paint algorithm has been implemented
  710. for the Daala
  711. \begin_inset space ~
  712. \end_inset
  713. \begin_inset CommandInset citation
  714. LatexCommand cite
  715. key "Daala"
  716. \end_inset
  717. codec.
  718. It is available from the Daala Git repository
  719. \begin_inset space ~
  720. \end_inset
  721. \begin_inset CommandInset citation
  722. LatexCommand cite
  723. key "Daala-Git"
  724. \end_inset
  725. , in the
  726. \family typewriter
  727. exp_paint_deringing4
  728. \family default
  729. branch.
  730. To maximize the resulting quality, the implementation does not include
  731. the simplifications described in Section
  732. \begin_inset space ~
  733. \end_inset
  734. \begin_inset CommandInset ref
  735. LatexCommand ref
  736. reference "sub:Simplifications"
  737. \end_inset
  738. .
  739. \end_layout
  740. \begin_layout Section
  741. Conclusion
  742. \end_layout
  743. \begin_layout Standard
  744. We have demonstrated an effective algorithm to remove ringing artefacts
  745. from coded images and videos.
  746. While this algorithm does not significantly improve objective quality metrics
  747. we have been using on Daala (PSNR, PSNR-HVS, SSIM, FAST-SSIM
  748. \begin_inset space ~
  749. \end_inset
  750. \begin_inset CommandInset citation
  751. LatexCommand cite
  752. key "Testing-draft"
  753. \end_inset
  754. ), the improvement in subjective quality is significant, mostly on edges.
  755. See this technilogy demo
  756. \begin_inset space ~
  757. \end_inset
  758. \begin_inset CommandInset citation
  759. LatexCommand cite
  760. key "Paint-demo"
  761. \end_inset
  762. for more information.
  763. \end_layout
  764. \begin_layout Bibliography
  765. \begin_inset CommandInset bibitem
  766. LatexCommand bibitem
  767. key "Daala"
  768. \end_inset
  769. Daala website, Xiph.Org Foundation.
  770. \begin_inset ERT
  771. status open
  772. \begin_layout Plain Layout
  773. \backslash
  774. url{http://xiph.org/daala/}
  775. \end_layout
  776. \end_inset
  777. \end_layout
  778. \begin_layout Bibliography
  779. \begin_inset CommandInset bibitem
  780. LatexCommand bibitem
  781. key "Daala-Git"
  782. \end_inset
  783. Daala Git repository.
  784. \begin_inset ERT
  785. status open
  786. \begin_layout Plain Layout
  787. \backslash
  788. url{http://git.xiph.org/?p=daala.git;a=summary}
  789. \end_layout
  790. \end_inset
  791. \end_layout
  792. \begin_layout Bibliography
  793. \begin_inset CommandInset bibitem
  794. LatexCommand bibitem
  795. key "Testing-draft"
  796. \end_inset
  797. T.
  798. Daede, J.
  799. Moffitt,
  800. \emph on
  801. Video Codec Testing and Quality Measurement
  802. \emph default
  803. , IETF Internet draft, 2015.
  804. \begin_inset ERT
  805. status open
  806. \begin_layout Plain Layout
  807. \backslash
  808. url{https://tools.ietf.org/html/draft-daede-netvc-testing}
  809. \end_layout
  810. \end_inset
  811. \end_layout
  812. \begin_layout Bibliography
  813. \begin_inset CommandInset bibitem
  814. LatexCommand bibitem
  815. key "Paint-demo"
  816. \end_inset
  817. J.-M.
  818. Valin,
  819. \emph on
  820. Daala: Painting Images for Fun (and Profit?)
  821. \emph default
  822. .
  823. \lang english
  824. \begin_inset ERT
  825. status open
  826. \begin_layout Plain Layout
  827. \backslash
  828. url{http://people.xiph.org/~jm/daala/paint_demo/}
  829. \end_layout
  830. \end_inset
  831. \end_layout
  832. \end_body
  833. \end_document