-
Notifications
You must be signed in to change notification settings - Fork 254
Support update encoder settings during encoding #1033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
25ea727
5851a6d
0ebc70f
539aeb7
544d211
0e49fd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,9 @@ typedef enum avifResult | |
| AVIF_RESULT_WAITING_ON_IO, // similar to EAGAIN/EWOULDBLOCK, this means the avifIO doesn't have necessary data available yet | ||
| AVIF_RESULT_INVALID_ARGUMENT, // an argument passed into this function is invalid | ||
| AVIF_RESULT_NOT_IMPLEMENTED, // a requested code path is not (yet) implemented | ||
| AVIF_RESULT_OUT_OF_MEMORY | ||
| AVIF_RESULT_OUT_OF_MEMORY, | ||
| AVIF_RESULT_CANNOT_CHANGE_SETTING, // a setting that can't change is changed during encoding | ||
| AVIF_RESULT_INCOMPATIBLE_IMAGE // given image is not compatible with already encoded image | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: I do not mind adding values to this enum but maybe we should be careful not to have too many. There is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understand. If both are newly added, I would make |
||
| } avifResult; | ||
|
|
||
| AVIF_API const char * avifResultToString(avifResult result); | ||
|
|
@@ -1037,12 +1039,17 @@ struct avifCodecSpecificOptions; | |
| // image in less bytes. AVIF_SPEED_DEFAULT means "Leave the AV1 codec to its default speed settings"./ | ||
| // If avifEncoder uses rav1e, the speed value is directly passed through (0-10). If libaom is used, | ||
| // a combination of settings are tweaked to simulate this speed range. | ||
| // * AV1 encoder settings and codec specific options set by avifEncoderSetCodecSpecificOption() | ||
| // will be applied / updated to AV1 encoder before each call to avifEncoderAddImage(). | ||
| typedef struct avifEncoder | ||
| { | ||
| // Defaults to AVIF_CODEC_CHOICE_AUTO: Preference determined by order in availableCodecs table (avif.c) | ||
| avifCodecChoice codecChoice; | ||
|
|
||
| // settings (see Notes above) | ||
| int keyframeInterval; // How many frames between automatic forced keyframes; 0 to disable (default). | ||
| uint64_t timescale; // timescale of the media (Hz) | ||
| // AV1 encoder settings. | ||
| int maxThreads; | ||
| int minQuantizer; | ||
| int maxQuantizer; | ||
|
|
@@ -1051,8 +1058,6 @@ typedef struct avifEncoder | |
| int tileRowsLog2; | ||
| int tileColsLog2; | ||
| int speed; | ||
| int keyframeInterval; // How many frames between automatic forced keyframes; 0 to disable (default). | ||
| uint64_t timescale; // timescale of the media (Hz) | ||
|
|
||
| // stats from the most recent write | ||
| avifIOStats ioStats; | ||
|
|
@@ -1104,9 +1109,7 @@ AVIF_API avifResult avifEncoderAddImageGrid(avifEncoder * encoder, | |
| avifAddImageFlags addImageFlags); | ||
| AVIF_API avifResult avifEncoderFinish(avifEncoder * encoder, avifRWData * output); | ||
|
|
||
| // Codec-specific, optional "advanced" tuning settings, in the form of string key/value pairs. These | ||
| // should be set as early as possible, preferably just after creating avifEncoder but before | ||
| // performing any other actions. | ||
| // Codec-specific, optional "advanced" tuning settings, in the form of string key/value pairs. | ||
| // key must be non-NULL, but passing a NULL value will delete that key, if it exists. | ||
| // Setting an incorrect or unknown option for the current codec will cause errors of type | ||
| // AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage(). | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.