@@ -171,7 +171,7 @@ use crate::include::dav1d::common::{Dav1dDataProps, Rav1dDataProps};
171
171
use crate :: include:: dav1d:: data:: { Dav1dData , Rav1dData } ;
172
172
use crate :: include:: dav1d:: dav1d:: {
173
173
Dav1dContext , Dav1dEventFlags , Dav1dSettings , Rav1dDecodeFrameType , Rav1dInloopFilterType ,
174
- Rav1dSettings ,
174
+ Rav1dSettings , RAV1D_MAX_THREADS ,
175
175
} ;
176
176
use crate :: include:: dav1d:: headers:: { Dav1dSequenceHeader , Rav1dFilmGrainData } ;
177
177
use crate :: include:: dav1d:: picture:: { Dav1dPicture , Rav1dPicture } ;
@@ -230,10 +230,10 @@ pub extern "C" fn dav1d_version_api() -> c_uint {
230
230
impl Default for Rav1dSettings {
231
231
fn default ( ) -> Self {
232
232
Self {
233
- n_threads : InRange :: < u16 , 0 , 256 > :: new ( 0 ) . unwrap ( ) ,
234
- max_frame_delay : InRange :: < u16 , 0 , 256 > :: new ( 0 ) . unwrap ( ) ,
233
+ n_threads : InRange :: new ( 0 ) . unwrap ( ) ,
234
+ max_frame_delay : InRange :: new ( 0 ) . unwrap ( ) ,
235
235
apply_grain : true ,
236
- operating_point : InRange :: < u8 , 0 , 31 > :: new ( 0 ) . unwrap ( ) ,
236
+ operating_point : InRange :: new ( 0 ) . unwrap ( ) ,
237
237
all_layers : true ,
238
238
frame_size_limit : 0 ,
239
239
allocator : Default :: default ( ) ,
@@ -268,7 +268,9 @@ fn get_num_threads(s: &Rav1dSettings) -> NumThreads {
268
268
let n_tc = if s. n_threads . get ( ) != 0 {
269
269
s. n_threads . get ( ) as usize // TODO propagate `InRange`
270
270
} else {
271
- rav1d_num_logical_processors ( ) . get ( ) . clamp ( 1 , 256 )
271
+ rav1d_num_logical_processors ( )
272
+ . get ( )
273
+ . clamp ( 1 , RAV1D_MAX_THREADS )
272
274
} ;
273
275
let n_fc = if s. max_frame_delay . get ( ) != 0 {
274
276
cmp:: min ( s. max_frame_delay . get ( ) as usize , n_tc) // TODO propagate `InRange`
0 commit comments