Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
19th January 2016, 11:44 | #1 | Link |
Registered User
Join Date: Nov 2015
Posts: 4
|
VP9 Loopfilter sizing.
Hello everyone!
I'm trying to size a VP9 decoder. To do so I'm trying to understand the VP9 loopfilter system. More specifically, I'm trying to know the theoretical maximum number of filtering that can occur when decoding a frame given a certain resolution. When I say "number of filtering" I mean: the number of time the processing part of filter4, filter8 or filter16 (from libvpx) are called. I've been trying several time to understand the mask mechanism used in libvpx, but I always failed to do it entirely. Maybe you guys know where I can find a simpler explanation ? I've been looking on this thread from pieter3d which was a great help in my overall understanding of the codec, but not specific enough to compute what I wanted. I've monitored libvpx to see if I could figure a relation between resolution and number of filtering but I haven't been successful. Here's what I measured: on a 8x8 resolution: a maximum of 16 filtering occurred on a 16x16 resolution: a maximum of 128 filtering occurred on a 32x32 resolution: a maximum of 1072 filtering occurred on a 64x64 resolution: a maximum of 3664 filtering occurred Any hint to find the theoretical maximum of filtering ? Thanks a lot! Dorian |
19th January 2016, 15:14 | #2 | Link |
Registered User
Join Date: Jul 2015
Posts: 706
|
What do you mean? Macroblocks.
The codec VP8 is described here. In the decoder VPXdec (v1.5.0-132 LigH) you can't turn off the blocks for VP9 / VP10. There are no such functions. They are only: Code:
VP8 Postprocessing Options: --noise-level=<arg> Enable VP8 postproc add noise --deblock Enable VP8 deblocking --demacroblock-level=<arg> Enable VP8 demacroblocking, w/ level --pp-debug-info=<arg> Enable VP8 visible debug info --pp-dbg-ref-frame=<arg> Display only selected reference frame per macro block --pp-dbg-mb-modes=<arg> Display only selected macro block modes --pp-dbg-b-modes=<arg> Display only selected block modes --pp-dbg-mvs=<arg> Draw only selected motion vectors --mfqe Enable multiframe quality enhancement Last edited by Jamaika; 19th January 2016 at 15:29. |
19th January 2016, 16:52 | #3 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
I don't think a full final spec was ever released, nor is there a way (without changing the internals) to force the loop filter to always be one size, to profile each size's maximum, which makes answering that very difficult. It'd probably be best to ask Google directly.
Last edited by foxyshadis; 19th January 2016 at 16:54. |
19th January 2016, 17:04 | #4 | Link |
Registered User
Join Date: Nov 2015
Posts: 4
|
Well I use the libvpx source code as "specification". I discussed with google's vp9 team, this seems to be the best way (since the actual spec is more of a draft and the bistream is frozen)
Let's assume I can force 4x4 partitioning in an encoder. This way, if I understood the code correctly, all filters must be filter4. But I don't understand why there are so many filtering actually being done. Even if I add all the left edge and top edge of every 4x4 partitions both for luma and chroma, my theoretical result is far below the empirical measures. |
19th January 2016, 18:24 | #5 | Link |
Registered User
Join Date: Jul 2007
Posts: 552
|
I didn't seen the code so this is only guess but may be additional filtering is due RDO i.e. it is used to calculate possible decisions distortion/bitcost and not only of final MBs that are written to bitstream.
Last edited by MasterNobody; 19th January 2016 at 18:27. |
21st January 2016, 02:56 | #7 | Link |
Registered User
Join Date: Jan 2013
Location: Santa Clara CA
Posts: 114
|
The filter8 and filter16 are only called for large transforms. For each 64x64 superblock, the filters are applied at the left and top edge of each transform block, and the no wider than half that transform block. So 16x16 and 32x32 transforms are the only ones that get filter16 applied. Note that it doesn't matter what the size is of the blocks on the other side, i.e. to the left or above.
If all transforms are 4x4, only filter4 will be applied. Remember that the filters are cascaded. If filter16 is attempted but the threshold condition fails, filter8 is attempted next and so on. So the threshold conditions can be evaluated multiple times per edge, but only one filter is ever finally applied. |
21st January 2016, 09:24 | #8 | Link |
Registered User
Join Date: Nov 2015
Posts: 4
|
Thank you for the detailed explanation. It matches what I understood from the code and the commentaries, so I guess I'm not far from getting the whole thing figured out . I will give it another try.
PS: and thanks again for both your posts on HEVC and VP9 |
|
|