-
Notifications
You must be signed in to change notification settings - Fork 66
decode_coefs experiment
#1325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
decode_coefs experiment
#1325
Changes from 9 commits
1977ffd
63c3147
d33c83e
462ecb2
6a761f5
f6ab903
7e89b23
6cd908c
a5731dd
29d4351
749e7f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,10 +192,19 @@ impl BlockSize { | |
| } | ||
| } | ||
|
|
||
| pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | ||
| pub const fn dav1d_txfm_size<const TX: usize>() -> TxfmSize { | ||
| let Some(size) = TxfmSize::from_repr(TX) else { | ||
| unsafe { | ||
| std::hint::unreachable_unchecked(); | ||
lqd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| }; | ||
| size | ||
| } | ||
|
|
||
| pub const fn dav1d_txfm_dimension<const TX: usize>() -> TxfmInfo { | ||
| use TxfmSize::*; | ||
| [ | ||
| TxfmInfo { | ||
| match dav1d_txfm_size::<TX>() { | ||
| S4x4 => TxfmInfo { | ||
| w: 1, | ||
| h: 1, | ||
| lw: 0, | ||
|
|
@@ -205,7 +214,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: DefaultValue::DEFAULT, | ||
| ctx: 0, | ||
| }, | ||
| TxfmInfo { | ||
| S8x8 => TxfmInfo { | ||
| w: 2, | ||
| h: 2, | ||
| lw: 1, | ||
|
|
@@ -215,7 +224,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S4x4, | ||
| ctx: 1, | ||
| }, | ||
| TxfmInfo { | ||
| S16x16 => TxfmInfo { | ||
| w: 4, | ||
| h: 4, | ||
| lw: 2, | ||
|
|
@@ -225,7 +234,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S8x8, | ||
| ctx: 2, | ||
| }, | ||
| TxfmInfo { | ||
| S32x32 => TxfmInfo { | ||
| w: 8, | ||
| h: 8, | ||
| lw: 3, | ||
|
|
@@ -235,7 +244,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S16x16, | ||
| ctx: 3, | ||
| }, | ||
| TxfmInfo { | ||
| S64x64 => TxfmInfo { | ||
| w: 16, | ||
| h: 16, | ||
| lw: 4, | ||
|
|
@@ -245,7 +254,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S32x32, | ||
| ctx: 4, | ||
| }, | ||
| TxfmInfo { | ||
| R4x8 => TxfmInfo { | ||
| w: 1, | ||
| h: 2, | ||
| lw: 0, | ||
|
|
@@ -255,7 +264,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S4x4, | ||
| ctx: 1, | ||
| }, | ||
| TxfmInfo { | ||
| R8x4 => TxfmInfo { | ||
| w: 2, | ||
| h: 1, | ||
| lw: 1, | ||
|
|
@@ -265,7 +274,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S4x4, | ||
| ctx: 1, | ||
| }, | ||
| TxfmInfo { | ||
| R8x16 => TxfmInfo { | ||
| w: 2, | ||
| h: 4, | ||
| lw: 1, | ||
|
|
@@ -275,7 +284,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S8x8, | ||
| ctx: 2, | ||
| }, | ||
| TxfmInfo { | ||
| R16x8 => TxfmInfo { | ||
| w: 4, | ||
| h: 2, | ||
| lw: 2, | ||
|
|
@@ -285,7 +294,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S8x8, | ||
| ctx: 2, | ||
| }, | ||
| TxfmInfo { | ||
| R16x32 => TxfmInfo { | ||
| w: 4, | ||
| h: 8, | ||
| lw: 2, | ||
|
|
@@ -295,7 +304,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S16x16, | ||
| ctx: 3, | ||
| }, | ||
| TxfmInfo { | ||
| R32x16 => TxfmInfo { | ||
| w: 8, | ||
| h: 4, | ||
| lw: 3, | ||
|
|
@@ -305,7 +314,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S16x16, | ||
| ctx: 3, | ||
| }, | ||
| TxfmInfo { | ||
| R32x64 => TxfmInfo { | ||
| w: 8, | ||
| h: 16, | ||
| lw: 3, | ||
|
|
@@ -315,7 +324,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S32x32, | ||
| ctx: 4, | ||
| }, | ||
| TxfmInfo { | ||
| R64x32 => TxfmInfo { | ||
| w: 16, | ||
| h: 8, | ||
| lw: 4, | ||
|
|
@@ -325,7 +334,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: S32x32, | ||
| ctx: 4, | ||
| }, | ||
| TxfmInfo { | ||
| R4x16 => TxfmInfo { | ||
| w: 1, | ||
| h: 4, | ||
| lw: 0, | ||
|
|
@@ -335,7 +344,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R4x8, | ||
| ctx: 1, | ||
| }, | ||
| TxfmInfo { | ||
| R16x4 => TxfmInfo { | ||
| w: 4, | ||
| h: 1, | ||
| lw: 2, | ||
|
|
@@ -345,7 +354,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R8x4, | ||
| ctx: 1, | ||
| }, | ||
| TxfmInfo { | ||
| R8x32 => TxfmInfo { | ||
| w: 2, | ||
| h: 8, | ||
| lw: 1, | ||
|
|
@@ -355,7 +364,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R8x16, | ||
| ctx: 2, | ||
| }, | ||
| TxfmInfo { | ||
| R32x8 => TxfmInfo { | ||
| w: 8, | ||
| h: 2, | ||
| lw: 3, | ||
|
|
@@ -365,7 +374,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R16x8, | ||
| ctx: 2, | ||
| }, | ||
| TxfmInfo { | ||
| R16x64 => TxfmInfo { | ||
| w: 4, | ||
| h: 16, | ||
| lw: 2, | ||
|
|
@@ -375,7 +384,7 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R16x32, | ||
| ctx: 3, | ||
| }, | ||
| TxfmInfo { | ||
| R64x16 => TxfmInfo { | ||
| w: 16, | ||
| h: 4, | ||
| lw: 4, | ||
|
|
@@ -385,6 +394,31 @@ pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | |
| sub: R32x16, | ||
| ctx: 3, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| pub static dav1d_txfm_dimensions: [TxfmInfo; TxfmSize::COUNT] = { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be a static? Can it be const so we don't have to duplicate it in the const switch above? I don't see anywhere that really relies on being able to take the address of these elements (i.e. they don't seem to be used from ASM?)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hadn't seen a need for it to remain a static, but preferred to leave this out of the experiment to have your opinion about the const generics first.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did try Since the measurements seemed slightly worsened (and I haven't had the time t check the assembly), but still within noise most of the time, I didn't add this change to this PR. I can definitely push it to another branch if you'd like to test it yourself. I also tried completely removing the |
||
| use TxfmSize::*; | ||
| [ | ||
| dav1d_txfm_dimension::<{ S4x4 as _ }>(), | ||
| dav1d_txfm_dimension::<{ S8x8 as _ }>(), | ||
| dav1d_txfm_dimension::<{ S16x16 as _ }>(), | ||
| dav1d_txfm_dimension::<{ S32x32 as _ }>(), | ||
| dav1d_txfm_dimension::<{ S64x64 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R4x8 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R8x4 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R8x16 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R16x8 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R16x32 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R32x16 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R32x64 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R64x32 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R4x16 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R16x4 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R8x32 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R32x8 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R16x64 as _ }>(), | ||
| dav1d_txfm_dimension::<{ R64x16 as _ }>(), | ||
| ] | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.