Skip to content

Commit b0de5ea

Browse files
committed
fix typo, add ne enum val, fix checking speed
1 parent fca81c9 commit b0de5ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

avif-coder/src/main/cpp/JniEncoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jbyteArray encodeBitmap(JNIEnv *env, jobject thiz,
114114
throwException(env, str);
115115
return static_cast<jbyteArray>(nullptr);
116116
}
117-
if(speed > 0 && speed < 10){
117+
if(speed > -1 && speed <= 10){
118118
result = heif_encoder_set_parameter_string(encoder.get(), "speed", speed)
119119
if (result.code != heif_error_Ok) {
120120
std::string choke(result.message);

avif-coder/src/main/java/com/radzivon/bartoshyk/avif/coder/AvifSpeed.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.radzivon.bartoshyk.avif.coder
3030

3131
/**
3232
* Enum representing speed values from 0 to 10 (slowest-fastest).
33-
* Default iis 6.
33+
* Default is 6.
3434
* https://github.com/AOMediaCodec/libavif/blob/main/doc/avifenc.1.md
3535
*/
3636
enum class AvifSpeed(internal val value: Int) {
@@ -45,4 +45,7 @@ enum class AvifSpeed(internal val value: Int) {
4545
EIGHT(8), // Speed 8
4646
NINE(9), // Speed 9
4747
TEN(10) // Speed 10
48+
49+
// Not using speed parameter, fallback to use x265 instead of aom
50+
USE_X265(-1)
4851
}

0 commit comments

Comments
 (0)