Skip to content

Add support for super-res

Ronald S. Bultje requested to merge rbultje/dav1d:superres into master

Fixes #172 (closed).

To give a slightly longer explanation of what the patch does. Super_res allows a picture to be upscaled horizontally by a factor of up to 2 between CDEF and LR. Therefore, we make the following changes to accomodate:

  • split f->cur (Dav1dThreadPicture) into f->sr_cur (Dav1dThreadPicture) and f->cur (Dav1dPicture); the first deals with reconstruction (pre-resize), and the second deals only with LR (post-resize). Since progress to next frames is signaled after all post-filters, that means only sr_cur needs to be a Dav1dThreadPicture. If super_res is disabled, both point to the same data. If super_res is enabled, we use a normative scaling filter to upscale cur to sr_cur;
  • LR is changed so it decides whether to read LR coefs for edge superblocks based on pixel-accurate units, not block (aligned to 8 pixels) units;
  • we add parsing for LR coefs when super_res is enabled;
  • Av1Filter is split into Av1Filter (cdef/deblock) and Av1Restoration (LR), since the dimensions of one are pre-resize and the other one are post-resize. Same for lr_lpf_line;
  • normative horizontal rescaling filter in MCDSPContext.
Edited by Ronald S. Bultje

Merge request reports