@@ -868,10 +868,8 @@ impl<W: io::Write> UncompressedHeader for BitWriter<W, BigEndian> {
868
868
fn write_frame_size < T : Pixel > (
869
869
& mut self , fi : & FrameInvariants < T > ,
870
870
) -> io:: Result < ( ) > {
871
- // width_bits and height_bits will have to be moved to the sequence header OBU
872
- // when we add support for it.
873
- let width_bits = 32 - ( fi. width as u32 ) . leading_zeros ( ) ;
874
- let height_bits = 32 - ( fi. height as u32 ) . leading_zeros ( ) ;
871
+ let width_bits = fi. sequence . num_bits_width ;
872
+ let height_bits = fi. sequence . num_bits_height ;
875
873
assert ! ( width_bits <= 16 ) ;
876
874
assert ! ( height_bits <= 16 ) ;
877
875
self . write ( 4 , width_bits - 1 ) ?;
@@ -884,10 +882,8 @@ impl<W: io::Write> UncompressedHeader for BitWriter<W, BigEndian> {
884
882
fn write_frame_size_override < T : Pixel > (
885
883
& mut self , fi : & FrameInvariants < T > ,
886
884
) -> io:: Result < ( ) > {
887
- // width_bits and height_bits will have to be moved to the sequence header OBU
888
- // when we add support for it.
889
- let width_bits = 32 - ( fi. width as u32 ) . leading_zeros ( ) ;
890
- let height_bits = 32 - ( fi. height as u32 ) . leading_zeros ( ) ;
885
+ let width_bits = fi. sequence . num_bits_width ;
886
+ let height_bits = fi. sequence . num_bits_height ;
891
887
assert ! ( width_bits <= 16 ) ;
892
888
assert ! ( height_bits <= 16 ) ;
893
889
self . write ( width_bits, ( fi. width - 1 ) as u16 ) ?;
0 commit comments