[FFmpeg-trac] #3404(avfilter:open): High quality magnification filter
FFmpeg
trac at avcodec.org
Sun Jun 1 00:07:39 CEST 2014
#3404: High quality magnification filter
-------------------------------------+------------------------------------
Reporter: wyatt8740 | Owner: ubitux
Type: enhancement | Status: open
Priority: wish | Component: avfilter
Version: git-master | Resolution:
Keywords: hqx xbr | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+------------------------------------
Comment (by ubitux):
So I've been working on hqx recently, and more specifically on hq2x to
begin with. I'll try here to detail the progression of my understanding of
that algorithm.
hq2x will transform 1 pixel into 2x2 pixels.
hq3x will transform 1 pixel into 3x3 pixels.
hq4x will transform 1 pixel into 4x4 pixels.
hq2x, hq3x and hq4x all use a 3x3 area around the current pixel to
determine the interpolation to use.
Attached is a (hopefully correct) representation of one of the 4 pixels to
interpolate on hq2x: the top-left (others should be symmetrical). Note:
for hq3x, the symmetry will probably be a bit tricky because the output is
odd. And for hq4x, we will probably have to make a symmetry with 2x2
pixels...
So on that picture (hq2x/topleft):
On the left (the 3x3 blocks with the blue gradients) is the chosen
interpolation when one of the combination on the right is matched. More
blue means a more important coefficient, more white means a less important
coefficient. Center pixel is the current one.
On the right is the list of all the different combinations triggering that
interpolation. When a pixel is red it means there is a visual difference
with the current pixel (center). When present, the green lines link 2
pixels which must have a visual difference (in addition to all the other
visual diff conditions represented in red).
In various cases we can observe a common pattern in the combinations. For
example for the first interpolation (which actually isn't, we just pick
the current pixel), we can distinguish the same pattern with some
"optional" differences. The representation could be improved to factorize
these combinations and mark the optional diff in a different way.
Unfortunately, it's not so easy to factorize because of cases like
"exclusive optional differences", or "multiple optional differences only".
It might be possible to also swap the representation, but I'm not sure if
that would help.
This picture is generated using https://github.com/ubitux/hqx. The
repository will continue to evolve while I progress on this. The final
goal being of course to try to determine the generic rules triggering
these interpolation based on the combinations we observe here.
(BTW, if anyone wants to help, feel free to contact me)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/3404#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list