Skip to content

Commit

Permalink
Add LegacyIDCTFilter to weights.rs so we can verify new IDCT code exp…
Browse files Browse the repository at this point in the history
…orter against ancient file
  • Loading branch information
lilith committed Oct 21, 2020
1 parent 44dd251 commit a8b6e01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion imageflow_core/src/imaging/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum Filter {
MitchellFast = 28,
NCubic = 29,
NCubicSharp = 30,

LegacyIDCTFilter = 31
}


Expand Down Expand Up @@ -148,6 +148,12 @@ impl InterpolationDetails{
Filter::Robidoux => InterpolationDetails::bicubic(2f64, 1.0f64,
0.3782157550939987f64,
0.3108921224530007f64),

Filter::LegacyIDCTFilter => InterpolationDetails::bicubic(2f64, 1. / 1.1685777620836932,
0.3782157550939987f64,
0.3108921224530007f64),


Filter::Fastest => InterpolationDetails::bicubic(0.74f64,
0.74f64,
0.3782157550939987f64,
Expand Down
2 changes: 1 addition & 1 deletion imageflow_core/tests/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn test_output_weight_symmetric() {
/*upscale from 2px*/ 2, 3, 2, 4, 2, 5, 2, 17,
/*other*/ 11, 7, 7, 3,
/* IDCT kernel sizes */ 8, 8, 8, 7, 8, 6, 8, 5, 8, 4, 8, 3, 8, 2, 8, 1];
let filters = [RobidouxFast, Robidoux, RobidouxSharp, Ginseng, GinsengSharp, Lanczos, LanczosSharp, Lanczos2, Lanczos2Sharp, CubicFast,Cubic, CubicSharp, CatmullRom, Mitchell, CubicBSpline, Hermite, Jinc, RawLanczos3, RawLanczos3Sharp, RawLanczos2, RawLanczos2Sharp, Triangle, Linear, Box, CatmullRomFast, CatmullRomFastSharp, Fastest, MitchellFast, NCubic, NCubicSharp
let filters = [RobidouxFast, Robidoux, RobidouxSharp, Ginseng, GinsengSharp, Lanczos, LanczosSharp, Lanczos2, Lanczos2Sharp, CubicFast,Cubic, CubicSharp, CatmullRom, Mitchell, CubicBSpline, Hermite, Jinc, RawLanczos3, RawLanczos3Sharp, RawLanczos2, RawLanczos2Sharp, Triangle, Linear, Box, CatmullRomFast, CatmullRomFastSharp, Fastest, MitchellFast, NCubic, NCubicSharp, LegacyIDCTFilter
];
for &filter in filters.iter(){
let details = InterpolationDetails::create(filter);
Expand Down

0 comments on commit a8b6e01

Please sign in to comment.