Appendix Filter Intra - AlexBoswellVCD/gitlab_wiki_test GitHub Wiki
Filter intra mode involves generating intra sample prediction in a raster scan order based on a set of neighboring predicted samples. As an illustration of the basic idea consider the sample P shown in the figure below. The intra prediction for sample P is the weighted sum of samples A, B and C. The latter could be reference pixels for the block and/or already predicted (i.e. filtered) samples.
The prediction procedure is outlined as follows:
- The predicted block is divided into 4x2 sub-blocks. Example: An 8x8 block is divided into 8 4x2 blocks. See the example of the 8x8 block in Figure 1 below.
- For each 4x2 sub-block:
- An array of 7 neighboring samples is prepared. For example, as shown in Figure 2, the 7 neighboring samples for Block_0 are reference samples for the 8x8 block. For Block_1, the above 5 neighboring samples are reference sample for the 8x8 block, the left neighboring samples are filtered samples from Block_0.
- The predicted pixels in the 4x2 sub-block are obtained by filtering the array of 7 neighboring pixels using the filtering methods. To illustrate the procedure, consider the 4x2 block shown in Figure 3 below:
The predicted kth pixels, k=0,…,7 in the 4x2 block is given by:
av1_filter_intra_taps[mode][k][0] * P0 +
av1_filter_intra_taps[mode][k][1] * P1 +
av1_filter_intra_taps[mode][k][2] * P2 +
av1_filter_intra_taps[mode][k][3] * P3 +
av1_filter_intra_taps[mode][k][4] * P4 +
av1_filter_intra_taps[mode][k][5] * P5 +
av1_filter_intra_taps[mode][k][6] * P6
where mode refers to one of the five supported filter intra modes listed in the table below:
filter_intra_mode index | Filter intra mode |
---|---|
0 | FILTER_DC_PRED |
1 | FILTER_V_PRED |
2 | FILTER_H_PRED |
3 | FILTER_D157_PRED |
4 | FILTER_PAETH_PRED |
The best filtering mode (i.e. set of weights) is selected through, for example, a rate distortion performance measure.
The 4x2 blocks can be processed in a wavefront manner. For the 8x8 block example shown in Figure 1, the order of processing the 4x2 blocks could be: Block_0, then Block_1 and Block2, then Block_3 and Block_4, then Block_5 and Block_6.
The Filter Intra feature is applicable only to luma intra prediction and to blocks that have width and height less than or equal to 32.
A diagram of the main function calls associated with the filter intra algorithm is shown in Figure 1 below. The functions are shown according to the depth of the function call.
The function inject_filter_intra_candidates
is responsible of
injecting all Filter intra candidates in MD. Candidates are injected for
a given block if the flag pic_filter_intra_mode > 0
,
enable_filter_intra
is set to 1, and both the block width and block
height are smaller than or equal to 32.
A total of 5 intra based candidates are injected where the candidate
field filter_intra_mode
is assigned a value from the following list:
FILTER_DC_PRED
/ FILTER_V_PRED
/ FILTER_H_PRED
/
FILTER_D157_PRED
/ FILTER_PAETH_PRED
. For other regular intra
candidates filter_intra_mode
is assigned a special value
(FILTER_INTRA_MODES
) to make sure it is not a filter intra candidate.
A special class is assigned to all Filter Intra candidates.
Note that when inter-intra compound is used, no filter intra modes are allowed in the intra part of the prediction.
The generation of the filter predictions is performed in the function
eb_av1_filter_intra_predictor
. The generation of the prediction is
performed as described above. The block is split into 4x2 blocks and the
predictions for the 4x2 blocks are generated in a raster scan order.
The control flags associated with the filter intra flag are listed in the table below.
Flag | Level (sequence/Picture) | Description |
---|---|---|
enable_filter_intra | sequence | Enable/disable the feature at the sequence header |
pic_filter_intra_mode | picture | Enable/disable the feature at the picture level. sc_content_detected should be set to zero for pic_filter_intra_mode to be enabled. |
To reduce the complexity associated with the filter intra feature, the latter is enabled only for base layer pictures.
At the sequence header the flag enable_filter_intra
will enable filter
intra in the bit-stream
When filter intra mode is selected:
-
The intra mode that is sent to the decoder is
DC_PRED
. -
There is no need to send intra angular information in the block info part of the bit-stream.
-
Palette prediction should be disabled.