@@ -42,7 +42,7 @@ use crate::include::common::bitdepth::bd_fn;
42
42
pub const GRAIN_WIDTH : usize = 82 ;
43
43
pub const GRAIN_HEIGHT : usize = 73 ;
44
44
45
- pub const BLOCK_SIZE : usize = 32 ;
45
+ pub const FG_BLOCK_SIZE : usize = 32 ;
46
46
47
47
const SUB_GRAIN_WIDTH : usize = 44 ;
48
48
const SUB_GRAIN_HEIGHT : usize = 38 ;
@@ -123,7 +123,7 @@ impl fgy_32x32xn::Fn {
123
123
row_num : usize ,
124
124
bd : BD ,
125
125
) {
126
- let row_strides = ( row_num * BLOCK_SIZE ) as isize ;
126
+ let row_strides = ( row_num * FG_BLOCK_SIZE ) as isize ;
127
127
let dst_row = dst. with_offset :: < BD > ( ) + row_strides * dst. pixel_stride :: < BD > ( ) ;
128
128
let src_row = src. with_offset :: < BD > ( ) + row_strides * src. pixel_stride :: < BD > ( ) ;
129
129
let dst_row_ptr = dst_row. as_mut_ptr :: < BD > ( ) . cast ( ) ;
@@ -195,7 +195,7 @@ impl fguv_32x32xn::Fn {
195
195
bd : BD ,
196
196
) {
197
197
let ss_y = ( layout == Rav1dPixelLayoutSubSampled :: I420 ) as usize ;
198
- let row_strides = ( row_num * BLOCK_SIZE ) as isize ;
198
+ let row_strides = ( row_num * FG_BLOCK_SIZE ) as isize ;
199
199
let dst_row = dst. with_offset :: < BD > ( ) + ( row_strides * dst. pixel_stride :: < BD > ( ) >> ss_y) ;
200
200
let src_row = src. with_offset :: < BD > ( ) + ( row_strides * src. pixel_stride :: < BD > ( ) >> ss_y) ;
201
201
let dst_row_ptr = dst_row. as_mut_ptr :: < BD > ( ) . cast ( ) ;
@@ -572,7 +572,7 @@ fn sample_lut<BD: BitDepth>(
572
572
let randval = offsets[ bx] [ by] as usize ;
573
573
let offx = 3 + ( 2 >> subx) * ( 3 + ( randval >> 4 ) ) ;
574
574
let offy = 3 + ( 2 >> suby) * ( 3 + ( randval & ( ( 1 << 4 ) - 1 ) ) ) ;
575
- grain_lut[ offy + y + ( BLOCK_SIZE >> suby) * by] [ offx + x + ( BLOCK_SIZE >> subx) * bx]
575
+ grain_lut[ offy + y + ( FG_BLOCK_SIZE >> suby) * by] [ offx + x + ( FG_BLOCK_SIZE >> subx) * bx]
576
576
. as_ :: < i32 > ( )
577
577
}
578
578
@@ -638,13 +638,13 @@ fn fgy_32x32xn_rust<BD: BitDepth>(
638
638
639
639
let mut seed = row_seed ( rows, row_num, data) ;
640
640
641
- assert ! ( dst_row. stride( ) % ( BLOCK_SIZE * mem:: size_of:: <BD :: Pixel >( ) ) as isize == 0 ) ;
641
+ assert ! ( dst_row. stride( ) % ( FG_BLOCK_SIZE * mem:: size_of:: <BD :: Pixel >( ) ) as isize == 0 ) ;
642
642
643
643
let mut offsets: [ [ c_int ; 2 ] ; 2 ] = [ [ 0 ; 2 /* row offset */ ] ; 2 /* col offset */ ] ;
644
644
645
- // process this row in BLOCK_SIZE ^2 blocks
646
- for bx in ( 0 ..pw) . step_by ( BLOCK_SIZE ) {
647
- let bw = cmp:: min ( BLOCK_SIZE , pw - bx) ;
645
+ // process this row in FG_BLOCK_SIZE ^2 blocks
646
+ for bx in ( 0 ..pw) . step_by ( FG_BLOCK_SIZE ) {
647
+ let bw = cmp:: min ( FG_BLOCK_SIZE , pw - bx) ;
648
648
649
649
if data. overlap_flag && bx != 0 {
650
650
// shift previous offsets left
@@ -780,13 +780,13 @@ fn fguv_32x32xn_rust<BD: BitDepth>(
780
780
781
781
let mut seed = row_seed ( rows, row_num, data) ;
782
782
783
- assert ! ( dst_row. stride( ) % ( BLOCK_SIZE * mem:: size_of:: <BD :: Pixel >( ) ) as isize == 0 ) ;
783
+ assert ! ( dst_row. stride( ) % ( FG_BLOCK_SIZE * mem:: size_of:: <BD :: Pixel >( ) ) as isize == 0 ) ;
784
784
785
785
let mut offsets: [ [ c_int ; 2 ] ; 2 ] = [ [ 0 ; 2 /* row offset */ ] ; 2 /* col offset */ ] ;
786
786
787
- // process this row in BLOCK_SIZE ^2 blocks (subsampled)
788
- for bx in ( 0 ..pw) . step_by ( BLOCK_SIZE >> sx) {
789
- let bw = cmp:: min ( BLOCK_SIZE >> sx, pw - bx) ;
787
+ // process this row in FG_BLOCK_SIZE ^2 blocks (subsampled)
788
+ for bx in ( 0 ..pw) . step_by ( FG_BLOCK_SIZE >> sx) {
789
+ let bw = cmp:: min ( FG_BLOCK_SIZE >> sx, pw - bx) ;
790
790
if data. overlap_flag && bx != 0 {
791
791
// shift previous offsets left
792
792
for i in 0 ..rows {
@@ -1011,8 +1011,8 @@ unsafe fn fgy_32x32xn_neon<BD: BitDepth>(
1011
1011
1012
1012
let mut offsets: [ [ c_int ; 2 ] ; 2 ] = [ [ 0 ; 2 /* row offset */ ] ; 2 /* col offset */ ] ;
1013
1013
1014
- // process this row in BLOCK_SIZE ^2 blocks
1015
- for bx in ( 0 ..pw) . step_by ( BLOCK_SIZE ) {
1014
+ // process this row in FG_BLOCK_SIZE ^2 blocks
1015
+ for bx in ( 0 ..pw) . step_by ( FG_BLOCK_SIZE ) {
1016
1016
if data. overlap_flag && bx != 0 {
1017
1017
// shift previous offsets left
1018
1018
for i in 0 ..rows {
@@ -1128,8 +1128,8 @@ unsafe fn fguv_32x32xn_neon<BD: BitDepth, const NM: usize, const IS_SX: bool, co
1128
1128
1129
1129
let mut offsets: [ [ c_int ; 2 ] ; 2 ] = [ [ 0 ; 2 /* row offset */ ] ; 2 /* col offset */ ] ;
1130
1130
1131
- // process this row in BLOCK_SIZE ^2 blocks (subsampled)
1132
- for bx in ( 0 ..pw) . step_by ( BLOCK_SIZE >> sx) {
1131
+ // process this row in FG_BLOCK_SIZE ^2 blocks (subsampled)
1132
+ for bx in ( 0 ..pw) . step_by ( FG_BLOCK_SIZE >> sx) {
1133
1133
if data. overlap_flag && bx != 0 {
1134
1134
// shift previous offsets left
1135
1135
for i in 0 ..rows {
0 commit comments