@@ -35,7 +35,7 @@ fn setup_encoder<T: Pixel>(
35
35
enc. speed_settings . no_scene_detection = no_scene_detection;
36
36
enc. rdo_lookahead_frames = rdo_lookahead_frames;
37
37
38
- let cfg = Config { enc , threads : 0 } ;
38
+ let cfg = Config :: new ( ) . with_encoder_config ( enc ) . with_threads ( 1 ) ;
39
39
40
40
cfg. new_context ( ) . unwrap ( )
41
41
}
@@ -1724,60 +1724,58 @@ fn rdo_lookahead_frames_overflow() {
1724
1724
1725
1725
#[ test]
1726
1726
fn log_q_exp_overflow ( ) {
1727
- let config = Config {
1728
- enc : EncoderConfig {
1729
- width : 16 ,
1730
- height : 16 ,
1731
- bit_depth : 8 ,
1732
- chroma_sampling : ChromaSampling :: Cs420 ,
1733
- chroma_sample_position : ChromaSamplePosition :: Unknown ,
1734
- pixel_range : PixelRange :: Limited ,
1735
- color_description : None ,
1736
- mastering_display : None ,
1737
- content_light : None ,
1738
- enable_timing_info : false ,
1739
- still_picture : false ,
1740
- error_resilient : false ,
1741
- switch_frame_interval : 0 ,
1742
- time_base : Rational { num : 1 , den : 25 } ,
1743
- min_key_frame_interval : 12 ,
1744
- max_key_frame_interval : 240 ,
1745
- reservoir_frame_delay : None ,
1746
- low_latency : false ,
1747
- quantizer : 100 ,
1748
- min_quantizer : 64 ,
1749
- bitrate : 1 ,
1750
- tune : Tune :: Psychovisual ,
1751
- tile_cols : 0 ,
1752
- tile_rows : 0 ,
1753
- tiles : 0 ,
1754
- rdo_lookahead_frames : 40 ,
1755
- speed_settings : SpeedSettings {
1756
- partition_range : PartitionRange :: new (
1757
- BlockSize :: BLOCK_64X64 ,
1758
- BlockSize :: BLOCK_64X64 ,
1759
- ) ,
1760
- multiref : false ,
1761
- fast_deblock : true ,
1762
- reduced_tx_set : true ,
1763
- tx_domain_distortion : true ,
1764
- tx_domain_rate : false ,
1765
- encode_bottomup : false ,
1766
- rdo_tx_decision : false ,
1767
- prediction_modes : PredictionModesSetting :: Simple ,
1768
- include_near_mvs : false ,
1769
- no_scene_detection : true ,
1770
- fast_scene_detection : false ,
1771
- diamond_me : true ,
1772
- cdef : true ,
1773
- lrf : true ,
1774
- use_satd_subpel : false ,
1775
- non_square_partition : false ,
1776
- ..Default :: default ( )
1777
- } ,
1727
+ let enc = EncoderConfig {
1728
+ width : 16 ,
1729
+ height : 16 ,
1730
+ bit_depth : 8 ,
1731
+ chroma_sampling : ChromaSampling :: Cs420 ,
1732
+ chroma_sample_position : ChromaSamplePosition :: Unknown ,
1733
+ pixel_range : PixelRange :: Limited ,
1734
+ color_description : None ,
1735
+ mastering_display : None ,
1736
+ content_light : None ,
1737
+ enable_timing_info : false ,
1738
+ still_picture : false ,
1739
+ error_resilient : false ,
1740
+ switch_frame_interval : 0 ,
1741
+ time_base : Rational { num : 1 , den : 25 } ,
1742
+ min_key_frame_interval : 12 ,
1743
+ max_key_frame_interval : 240 ,
1744
+ reservoir_frame_delay : None ,
1745
+ low_latency : false ,
1746
+ quantizer : 100 ,
1747
+ min_quantizer : 64 ,
1748
+ bitrate : 1 ,
1749
+ tune : Tune :: Psychovisual ,
1750
+ tile_cols : 0 ,
1751
+ tile_rows : 0 ,
1752
+ tiles : 0 ,
1753
+ rdo_lookahead_frames : 40 ,
1754
+ speed_settings : SpeedSettings {
1755
+ partition_range : PartitionRange :: new (
1756
+ BlockSize :: BLOCK_64X64 ,
1757
+ BlockSize :: BLOCK_64X64 ,
1758
+ ) ,
1759
+ multiref : false ,
1760
+ fast_deblock : true ,
1761
+ reduced_tx_set : true ,
1762
+ tx_domain_distortion : true ,
1763
+ tx_domain_rate : false ,
1764
+ encode_bottomup : false ,
1765
+ rdo_tx_decision : false ,
1766
+ prediction_modes : PredictionModesSetting :: Simple ,
1767
+ include_near_mvs : false ,
1768
+ no_scene_detection : true ,
1769
+ fast_scene_detection : false ,
1770
+ diamond_me : true ,
1771
+ cdef : true ,
1772
+ lrf : true ,
1773
+ use_satd_subpel : false ,
1774
+ non_square_partition : false ,
1775
+ ..Default :: default ( )
1778
1776
} ,
1779
- threads : 1 ,
1780
1777
} ;
1778
+ let config = Config :: new ( ) . with_encoder_config ( enc) . with_threads ( 1 ) ;
1781
1779
1782
1780
let mut ctx: Context < u8 > = config. new_context ( ) . unwrap ( ) ;
1783
1781
for _ in 0 ..2 {
@@ -1791,60 +1789,58 @@ fn log_q_exp_overflow() {
1791
1789
1792
1790
#[ test]
1793
1791
fn guess_frame_subtypes_assert ( ) {
1794
- let config = Config {
1795
- enc : EncoderConfig {
1796
- width : 16 ,
1797
- height : 16 ,
1798
- bit_depth : 8 ,
1799
- chroma_sampling : ChromaSampling :: Cs420 ,
1800
- chroma_sample_position : ChromaSamplePosition :: Unknown ,
1801
- pixel_range : PixelRange :: Limited ,
1802
- color_description : None ,
1803
- mastering_display : None ,
1804
- content_light : None ,
1805
- enable_timing_info : false ,
1806
- still_picture : false ,
1807
- error_resilient : false ,
1808
- switch_frame_interval : 0 ,
1809
- time_base : Rational { num : 1 , den : 25 } ,
1810
- min_key_frame_interval : 0 ,
1811
- max_key_frame_interval : 1 ,
1812
- reservoir_frame_delay : None ,
1813
- low_latency : false ,
1814
- quantizer : 100 ,
1815
- min_quantizer : 0 ,
1816
- bitrate : 16384 ,
1817
- tune : Tune :: Psychovisual ,
1818
- tile_cols : 0 ,
1819
- tile_rows : 0 ,
1820
- tiles : 0 ,
1821
- rdo_lookahead_frames : 40 ,
1822
- speed_settings : SpeedSettings {
1823
- partition_range : PartitionRange :: new (
1824
- BlockSize :: BLOCK_64X64 ,
1825
- BlockSize :: BLOCK_64X64 ,
1826
- ) ,
1827
- multiref : false ,
1828
- fast_deblock : true ,
1829
- reduced_tx_set : true ,
1830
- tx_domain_distortion : true ,
1831
- tx_domain_rate : false ,
1832
- encode_bottomup : false ,
1833
- rdo_tx_decision : false ,
1834
- prediction_modes : PredictionModesSetting :: Simple ,
1835
- include_near_mvs : false ,
1836
- no_scene_detection : true ,
1837
- fast_scene_detection : false ,
1838
- diamond_me : true ,
1839
- cdef : true ,
1840
- lrf : true ,
1841
- use_satd_subpel : false ,
1842
- non_square_partition : false ,
1843
- ..Default :: default ( )
1844
- } ,
1792
+ let enc = EncoderConfig {
1793
+ width : 16 ,
1794
+ height : 16 ,
1795
+ bit_depth : 8 ,
1796
+ chroma_sampling : ChromaSampling :: Cs420 ,
1797
+ chroma_sample_position : ChromaSamplePosition :: Unknown ,
1798
+ pixel_range : PixelRange :: Limited ,
1799
+ color_description : None ,
1800
+ mastering_display : None ,
1801
+ content_light : None ,
1802
+ enable_timing_info : false ,
1803
+ still_picture : false ,
1804
+ error_resilient : false ,
1805
+ switch_frame_interval : 0 ,
1806
+ time_base : Rational { num : 1 , den : 25 } ,
1807
+ min_key_frame_interval : 0 ,
1808
+ max_key_frame_interval : 1 ,
1809
+ reservoir_frame_delay : None ,
1810
+ low_latency : false ,
1811
+ quantizer : 100 ,
1812
+ min_quantizer : 0 ,
1813
+ bitrate : 16384 ,
1814
+ tune : Tune :: Psychovisual ,
1815
+ tile_cols : 0 ,
1816
+ tile_rows : 0 ,
1817
+ tiles : 0 ,
1818
+ rdo_lookahead_frames : 40 ,
1819
+ speed_settings : SpeedSettings {
1820
+ partition_range : PartitionRange :: new (
1821
+ BlockSize :: BLOCK_64X64 ,
1822
+ BlockSize :: BLOCK_64X64 ,
1823
+ ) ,
1824
+ multiref : false ,
1825
+ fast_deblock : true ,
1826
+ reduced_tx_set : true ,
1827
+ tx_domain_distortion : true ,
1828
+ tx_domain_rate : false ,
1829
+ encode_bottomup : false ,
1830
+ rdo_tx_decision : false ,
1831
+ prediction_modes : PredictionModesSetting :: Simple ,
1832
+ include_near_mvs : false ,
1833
+ no_scene_detection : true ,
1834
+ fast_scene_detection : false ,
1835
+ diamond_me : true ,
1836
+ cdef : true ,
1837
+ lrf : true ,
1838
+ use_satd_subpel : false ,
1839
+ non_square_partition : false ,
1840
+ ..Default :: default ( )
1845
1841
} ,
1846
- threads : 1 ,
1847
1842
} ;
1843
+ let config = Config :: new ( ) . with_encoder_config ( enc) . with_threads ( 1 ) ;
1848
1844
1849
1845
let mut ctx: Context < u8 > = config. new_context ( ) . unwrap ( ) ;
1850
1846
ctx. send_frame ( ctx. new_frame ( ) ) . unwrap ( ) ;
0 commit comments