Skip to content

Commit 1c48d7d

Browse files
committed
Added Advanced usage
1 parent 03f6bed commit 1c48d7d

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

advanced usage

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
## Advanced Usage ( through Exposed Parameters )
2+
The FFmpeg plugin for Enhanced RAISR exposes a number of parameters that can be changed for advanced customization
3+
### threadcount (only for CPU)
4+
Allowable values (1,120), default (20)
5+
6+
Changes the number of software threads used in the algorithm. Values 1..120 will operate on segments of an image such that efficient threading can greatly increase the performance of the upscale. The value itself is the number of threads allocated.
7+
### filterfolder
8+
Allowable values: (Any folder path containing the 4 required filter files: Qfactor_cohbin_2_8/10, Qfactor_strbin_2_8/10, filterbin_2_8/10, config), default (“filters_2x/filters_lowres”)
9+
10+
Changing the way Enhanced RAISR is trained (using different parameters and datasets) can alter the way ML-based algorithms do upscale. For the current release, provides 3 filters for 2x upscaling and 2 filters for 1.5x upscaling, current the 1.5x upscaling only support 8-bit. And for each filter you can find the training informantion in filternotes.txt of each filter folder.The following is a brief introduction to the usage scenarios of each filter.
11+
<table border="1">
12+
<tbody>
13+
<tr>
14+
<th rowspan=2>Upscaling</th>
15+
<th rowspan=2>Filters</th>
16+
<th rowspan=2>Resolution (recommendation)</th>
17+
<th rowspan=2>Usage</th>
18+
<th colspan=2>Effect</th>
19+
</tr>
20+
<tr>
21+
<th rowspan=1>1pass</th>
22+
<th rowspan=1>2pass</th>
23+
</tr>
24+
<tr>
25+
<td rowspan=3>2x(support 8-bit and 10-bit)</td>
26+
<td >filters_lowres</td>
27+
<td >low resolution
28+
360p->720p,540p->1080p</td>
29+
<td >filterfolder=filters_2x/filters_lowres:passes=1/2</td>
30+
<td >2x upscaling</td>
31+
<td >2x upscaling and sharpening</td>
32+
</tr>
33+
<tr>
34+
<td >filters_highres</td>
35+
<td >high resolution
36+
1080p->4k</td>
37+
<td >filterfolder=filters_2x/filters_highres:passes=1/2</td>
38+
<td >2x upscaling and sharpening</td>
39+
<td >2x upscaling and more sharpening than 1st pass</td>
40+
</tr>
41+
<tr>
42+
<td >filters_denoise</td>
43+
<td >no limitation</td>
44+
<td >filterfolder=filters_2x/filters_denoise:passes=2:mode=2</td>
45+
<td >denosing only for input</td>
46+
<td >2x upscaling and sharpening</td>
47+
</tr>
48+
<tr>
49+
<td rowspan=2>1.5x(only support 8-bit)</td>
50+
<td >filters_highres</td>
51+
<td >high resolution
52+
720p->1080p</td>
53+
<td >filterfolder=filters_1.5x/filters_highres:passes=1:ratio=1.5</td>
54+
<td >1.5x upscaling and sharpening</td>
55+
<td >N/A</td>
56+
</tr>
57+
<tr>
58+
<td >filters_denoise</td>
59+
<td >no limitation</td>
60+
<td >filterfolder=filters_1.5x/filters_denoise:passes=2:mode=2:ratio=1.5</td>
61+
<td >denosing only for input</td>
62+
<td >1.5x upscaling and sharpening </td>
63+
</tr>
64+
</tbody>
65+
</table>
66+
67+
Please see the examples under the "Evaluating the Quality" section above where we suggest 3 command lines based upon preference.
68+
Note that for second pass to work, the filter folder must contain 3 additional files: Qfactor_cohbin_2_8/10_2, Qfactor_strbin_2_8/10_2, filterbin_2_8/10_2
69+
### bits
70+
Allowable values (8: 8-bit depth, 10: 10-bit depth), default (8)
71+
72+
The model supports 8 and 10-bit depth input. Use HEVC encoder to encoder yuv420p10le format.
73+
```
74+
./ffmpeg -y -i [10bits video clip] -vf "raisr=threadcount=20:bits=10" -c:v libx265 -preset medium -crf 28 -pix_fmt yuv420p10le output_10bit.mp4
75+
```
76+
### range
77+
Allowable values (video: video range, full: full range), default (video)
78+
79+
The implementation caps color within video/full range.
80+
```
81+
./ffmpeg -y -i [image/video file] -vf "raisr=threadcount=20:range=full" outputfile
82+
```
83+
### blending
84+
Allowable values (1: Randomness, 2: CountOfBitsChanged), default (2 ). For GPU only support 2:CountOfBitsChanged blending.
85+
86+
The implementation holds two different functions which blend the initial (cheap) upscaled image with the Enhanced RAISR filtered image. This can be a means of removing any aggressive or outlying artifacts that get introduced by the filtered image.
87+
### passes
88+
Allowable values (1,2), default(1)
89+
90+
`passes=2` enables a second pass. Adding a second pass can further enhance the output image quality, but doubles the time to upscale. Note that for second pass to work, the filter folder must contain 3 additional files: Qfactor_cohbin_2_8/10_2, Qfactor_strbin_2_8/10_2, filterbin_2_8/10_2
91+
### mode
92+
Allowable values (1,2), default(1). Requires flag passes=2”
93+
94+
Dictates which pass the upscaling should occur in. Some filters have the best results when it is applied on a high resolution image that was upscaled during a first pass by using mode=1. Alternatively, the Enhanced RAISR can apply filters on low resolution images during the first pass THEN upscale the image in the second pass if mode=2, for a different outcome.
95+
```
96+
./ffmpeg -i /input_files/input.mp4 -vf "raisr=threadcount=20:passes=2:mode=2" -pix_fmt yuv420p /output_files/out.yuv
97+
```
98+
### asm
99+
Allowable values ("avx512fp16", "avx512","avx2","opencl"), default("avx512fp16")
100+
101+
The Enhanced RAISR requires an x86 processor which has the Intel® Advanced Vector Extensions 2 (Intel® AVX2) available. Intel AVX2 was first introduced into the Intel Xeon roadmap with Haswell in 2015. Performance can be further increased if the newer Intel® AVX512 Foundation and Vector Length Extensions are available. Intel AVX512 was introduced into the Xeon Scalable Processors (Skylake gen) in 2017. Performance improves again with the introduction of FP16 for Intel AVX512, which uses _Float16 instead of float(32bit) with minimal precision and visual quality loss. FP16 was introduced into the 4th Gen Intel Xeon Scalable Processors (formerly known as Sapphire Rappids) in 2022. The implementation always check for the highest available Instruction Set Architecture (ISA) first, then fallback according to what is available. However if the use case requires it, this asm parameter allows the default behavior to be changed. User can also choose opencl if the opencl is supported in their system.

0 commit comments

Comments
 (0)