Skip to content

Commit

Permalink
fix(svt): Don't clamp enc_mode to [0,8] (#1824)
Browse files Browse the repository at this point in the history
SVT-AV1 added encoder modes 9-12 in v0.9. Because speed is still clamped
to max 8 it's not possible to use a faster preset.
  • Loading branch information
fdintino authored Dec 4, 2023
1 parent bccbcc0 commit c44a43b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/codec_svt.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
svt_config->tile_columns = tileColsLog2;
}
if (encoder->speed != AVIF_SPEED_DEFAULT) {
#if SVT_AV1_CHECK_VERSION(0, 9, 0)
svt_config->enc_mode = (int8_t)encoder->speed;
#else
int speed = AVIF_CLAMP(encoder->speed, 0, 8);
svt_config->enc_mode = (int8_t)speed;
#endif
}

if (color_format == EB_YUV422 || image->depth > 10) {
Expand Down

0 comments on commit c44a43b

Please sign in to comment.