Skip to content

Commit

Permalink
Change SVT to clamp speed from 0-13
Browse files Browse the repository at this point in the history
This based on comments from
AOMediaCodec#2422 (comment)
  • Loading branch information
FrankGalligan committed Oct 18, 2024
1 parent a410bd2 commit 5d73dea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The changes are relative to the previous release, unless the baseline is specifi
avifGainMapMetadataDouble structs.
* Add avif(Un)SignedFraction structs and avifDoubleTo(Un)SignedFraction
utility functions.
* In avif.h, changed "AVIF_SPEED_FASTEST" value to 13 from 10.
* Change codec_svt.c to clamp from 0 to 13.

## [1.1.1] - 2024-07-30

Expand Down
5 changes: 1 addition & 4 deletions apps/avifenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void syntaxLong(void)
AVIF_QUALITY_LOSSLESS);
printf(" -s,--speed S : Encoder speed (%d-%d, slowest-fastest, 'default' or 'd' for codec internal defaults. default speed: 6)\n",
AVIF_SPEED_SLOWEST,
AVIF_SPEED_FASTEST);
13);
printf(" libaom range 0-9 & rav1e range 0-10\n");
printf("\n");
printf("Advanced options:\n");
Expand Down Expand Up @@ -1735,9 +1735,6 @@ int main(int argc, char * argv[])
settings.speed = AVIF_SPEED_DEFAULT;
} else {
settings.speed = atoi(arg);
if (settings.speed > AVIF_SPEED_FASTEST) {
settings.speed = AVIF_SPEED_FASTEST;
}
if (settings.speed < AVIF_SPEED_SLOWEST) {
settings.speed = AVIF_SPEED_SLOWEST;
}
Expand Down
4 changes: 1 addition & 3 deletions include/avif/avif.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ typedef int avifBool;

#define AVIF_SPEED_DEFAULT -1
#define AVIF_SPEED_SLOWEST 0

// Libaom and Rav1e fastest speed setting is 10, while SVT-AV1 fastest profile is 13.
#define AVIF_SPEED_FASTEST 13
#define AVIF_SPEED_FASTEST 10

// This value is used to indicate that an animated AVIF file has to be repeated infinitely.
#define AVIF_REPETITION_COUNT_INFINITE -1
Expand Down
2 changes: 1 addition & 1 deletion src/codec_svt.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
}
if (encoder->speed != AVIF_SPEED_DEFAULT) {
#if SVT_AV1_CHECK_VERSION(0, 9, 0)
int speed = AVIF_CLAMP(encoder->speed, 0, AVIF_SPEED_FASTEST);
int speed = AVIF_CLAMP(encoder->speed, 0, 13);
#else
int speed = AVIF_CLAMP(encoder->speed, 0, 8);
#endif
Expand Down

0 comments on commit 5d73dea

Please sign in to comment.