File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,8 @@ pub unsafe fn dequantize_and_idct_block_8x8(
148
148
149
149
// Read the DCT coefficients, scale them up and dequantize them.
150
150
let mut data = [ _mm_setzero_si128 ( ) ; 8 ] ;
151
- for i in 0 .. 8 {
152
- data [ i ] = _mm_slli_epi16 (
151
+ for ( i , item ) in data . iter_mut ( ) . enumerate ( ) {
152
+ * item = _mm_slli_epi16 (
153
153
_mm_mullo_epi16 (
154
154
_mm_loadu_si128 ( coefficients. as_ptr ( ) . wrapping_add ( i * 8 ) as * const _ ) ,
155
155
_mm_loadu_si128 ( quantization_table. as_ptr ( ) . wrapping_add ( i * 8 ) as * const _ ) ,
@@ -164,7 +164,7 @@ pub unsafe fn dequantize_and_idct_block_8x8(
164
164
idct8 ( & mut data) ;
165
165
transpose8 ( & mut data) ;
166
166
167
- for i in 0 .. 8 {
167
+ for ( i , item ) in data . iter_mut ( ) . enumerate ( ) {
168
168
let mut buf = [ 0u8 ; 16 ] ;
169
169
// The two passes of the IDCT algorithm give us a factor of 8, so the shift here is
170
170
// increased by 3.
@@ -174,7 +174,7 @@ pub unsafe fn dequantize_and_idct_block_8x8(
174
174
// We want rounding right shift, so we should add (1/2) << (SHIFT+3) before shifting.
175
175
const ROUNDING_BIAS : i16 = ( 1 << ( SHIFT + 3 ) ) >> 1 ;
176
176
177
- let data_with_offset = _mm_adds_epi16 ( data [ i ] , _mm_set1_epi16 ( OFFSET + ROUNDING_BIAS ) ) ;
177
+ let data_with_offset = _mm_adds_epi16 ( * item , _mm_set1_epi16 ( OFFSET + ROUNDING_BIAS ) ) ;
178
178
179
179
_mm_storeu_si128 (
180
180
buf. as_mut_ptr ( ) as * mut _ ,
You can’t perform that action at this time.
0 commit comments