Skip to content

Commit

Permalink
add tests for trafos of size Nx2 and 2xN
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjw24 committed Nov 18, 2024
1 parent 27bad8d commit 0573a76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/vvenc_unit_test/vvenc_unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ static bool check_fastInvCore( TCoeffOps* ref, TCoeffOps* opt, unsigned num_case
{
// Clamp lines down to the next multiple of four when generating
// reducedLines to avoid existing x86 implementations over-writing.
unsigned lines = 1 << rng.get( 2, 6 );
unsigned reducedLines = std::min( 32u, rng.get( 4u, lines, 4 ) );
unsigned lines = 1 << rng.get( 1, 6 );
unsigned reducedLines = lines == 2 ? lines : std::min( 32u, rng.get( 4u, lines, 4 ) );
unsigned cutoff = rng.get( 4, trSize, 4 ); // Cutoff must be a non-zero multiple of four.
if( !check_one_fastInvCore( ref, opt, idx, trSize, lines, reducedLines, cutoff, g, t ) )
{
Expand All @@ -239,8 +239,8 @@ static bool check_fastFwdCore_2D( TCoeffOps* ref, TCoeffOps* opt, unsigned num_c
{
// Clamp line down to the next multiple of four when generating reducedLine
// to avoid existing x86 implementations over-writing.
unsigned line = 1 << rng.get( 2, 6 );
unsigned reducedLine = std::min( 32u, rng.get( 4u, line, 4 ) );
unsigned line = 1 << rng.get( 1, 6 );
unsigned reducedLine = line == 2 ? 2 : std::min( 32u, rng.get( 4u, line, 4 ) );
unsigned cutoff = rng.get( 4, trSize, 4 ); // Cutoff must be a non-zero multiple of four.
unsigned shift = rng.get( 1, 16 ); // Shift must be at least one to avoid UB.
if( !check_one_fastFwdCore_2D( ref, opt, idx, trSize, line, reducedLine, cutoff, shift, g, t ) )
Expand Down

0 comments on commit 0573a76

Please sign in to comment.