Commit 5ec173c 1 parent e69826f commit 5ec173c Copy full SHA for 5ec173c
File tree 4 files changed +17
-4
lines changed
4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,7 @@ impl Av1anContext {
368
368
temp_res. as_str ( ) ,
369
369
tq. vmaf_scaler . as_str ( ) ,
370
370
1 ,
371
+ 1 ,
371
372
tq. vmaf_filter . as_deref ( ) ,
372
373
tq. vmaf_threads ,
373
374
) {
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ pub struct TargetQuality {
25
25
pub vmaf_threads : usize ,
26
26
pub model : Option < PathBuf > ,
27
27
pub probing_rate : usize ,
28
+ pub vmaf_subsample : usize ,
28
29
pub probes : u32 ,
29
30
pub target : f64 ,
30
31
pub min_q : u32 ,
@@ -252,6 +253,7 @@ impl TargetQuality {
252
253
& self . vmaf_res ,
253
254
& self . vmaf_scaler ,
254
255
self . probing_rate ,
256
+ self . vmaf_subsample ,
255
257
self . vmaf_filter . as_deref ( ) ,
256
258
self . vmaf_threads ,
257
259
) ?;
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ pub fn plot(
122
122
res : & str ,
123
123
scaler : & str ,
124
124
sample_rate : usize ,
125
+ subsample : usize ,
125
126
filter : Option < & str > ,
126
127
threads : usize ,
127
128
) -> Result < ( ) , Box < EncoderCrash > > {
@@ -156,6 +157,7 @@ pub fn plot(
156
157
res,
157
158
scaler,
158
159
sample_rate,
160
+ subsample,
159
161
filter,
160
162
threads,
161
163
) ?;
@@ -172,6 +174,7 @@ pub fn run_vmaf(
172
174
res : & str ,
173
175
scaler : & str ,
174
176
sample_rate : usize ,
177
+ subsample : usize ,
175
178
vmaf_filter : Option < & str > ,
176
179
threads : usize ,
177
180
) -> Result < ( ) , Box < EncoderCrash > > {
@@ -193,16 +196,18 @@ pub fn run_vmaf(
193
196
194
197
let vmaf = if let Some ( model) = model {
195
198
format ! (
196
- "[distorted][ref]libvmaf=log_fmt='json':eof_action=endall:log_path={}:model_path={}:n_threads={}" ,
199
+ "[distorted][ref]libvmaf=log_fmt='json':eof_action=endall:log_path={}:model_path={}:n_threads={}:n_subsample={} " ,
197
200
ffmpeg:: escape_path_in_filter( stat_file) ,
198
201
ffmpeg:: escape_path_in_filter( & model) ,
199
- threads
202
+ threads,
203
+ subsample,
200
204
)
201
205
} else {
202
206
format ! (
203
- "[distorted][ref]libvmaf=log_fmt='json':eof_action=endall:log_path={}:n_threads={}" ,
207
+ "[distorted][ref]libvmaf=log_fmt='json':eof_action=endall:log_path={}:n_threads={}:n_subsample={} " ,
204
208
ffmpeg:: escape_path_in_filter( stat_file) ,
205
- threads
209
+ threads,
210
+ subsample,
206
211
)
207
212
} ;
208
213
Original file line number Diff line number Diff line change @@ -514,6 +514,10 @@ pub struct CliOpts {
514
514
#[ clap( long, default_value_t = 1 , help_heading = "Target Quality" ) ]
515
515
pub probing_rate : u32 ,
516
516
517
+ /// Vmaf subsample to speedup VMAF calculation
518
+ #[ clap( long, default_value_t = 1 , help_heading = "Target Quality" ) ]
519
+ pub vmaf_subsample : usize ,
520
+
517
521
/// Use encoding settings for probes specified by --video-params rather than faster, less accurate settings
518
522
///
519
523
/// Note that this always performs encoding in one-pass mode, regardless of --passes.
@@ -572,6 +576,7 @@ impl CliOpts {
572
576
video_params : video_params. clone ( ) ,
573
577
probe_slow : self . probe_slow ,
574
578
probing_rate : adapt_probing_rate ( self . probing_rate as usize ) ,
579
+ vmaf_subsample : self . vmaf_subsample ,
575
580
}
576
581
} )
577
582
}
You can’t perform that action at this time.
0 commit comments