Skip to content

Commit

Permalink
💥 Change choices of --with-downsample
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed May 12, 2023
1 parent 3122b58 commit d3b53d5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ $ ./configure --help
--with-bin2c[=/the/path/of/WxH.yuv]
use bin2c to convert a yuv to yuv.h

--with-downsample[=0|1] downsample from 720p to 360p, 0, 1 means bilinear,
bicubic. default=0
--with-downsample[=1|2] downsample from 720p to 360p, 1, 2 means bilinear,
bicubic. default=1

--with-downsample-scale[=X]
downsample scale. default=2
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ AS_IF([test "x$with_bin2c" != "xno"],
)

AC_ARG_WITH([downsample],
[AS_HELP_STRING([--with-downsample@<:@=0|1@:>@],
[downsample from 720p to 360p, 0, 1 means bilinear, bicubic. default=0]
[AS_HELP_STRING([--with-downsample@<:@=1|2@:>@],
[downsample from 720p to 360p, 1, 2 means bilinear, bicubic. default=1]
)
],
[],
[with_downsample=no]
)
AS_IF([test "x$with_downsample" = "xyes"],
[with_downsample=0],
[with_downsample=1],
[]
)
AS_IF([test "x$with_downsample" != xno],
Expand Down
4 changes: 2 additions & 2 deletions downsample.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <stdint.h>
#include "config.h"

#define DOWNSAMPLE_BILINEAR 0
#define DOWNSAMPLE_BICUBIC 1
#define DOWNSAMPLE_BILINEAR 1
#define DOWNSAMPLE_BICUBIC 2
// https://pytorch.org/vision/stable/generated/torchvision.transforms.Pad.html
#define PADDING_EDGE 1
#define PADDING_REFLECT 2
Expand Down
2 changes: 1 addition & 1 deletion test/downsample.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ setup() {
}

@test with-downsample=2 {
run sh -c './configure --with-downsample=2'
run sh -c './configure --with-downsample=9'
assert_failure
}

0 comments on commit d3b53d5

Please sign in to comment.