The only common option here is low_power - it was previously supported for H.264 only, that specific option is removed.
Unified · Split
| @@ -2599,6 +2599,18 @@ Size / quality tradeoff: higher values are smaller / worse quality. · 2598 unmodified lines | ||
| 2599 | 2599 | @option{b_qoffset} / @option{b_quant_offset} |
| 2600 | 2600 | @end itemize |
| 2601 | 2601 | |
| 2602 | +All encoders support the following options: | |
| 2603 | +@itemize | |
| 2604 | +@item | |
| 2605 | +@option{low_power} | |
| 2606 | + | |
| 2607 | +Some drivers/platforms offer a second encoder for some codecs intended to use | |
| 2608 | +less power than the default encoder; setting this option will attempt to use | |
| 2609 | +that encoder. Note that it may support a reduced feature set, so some other | |
| 2610 | +options may not be available in this mode. | |
| 2611 | +@end itemize | |
| 2612 | + | |
| 2613 | +Each encoder also has its own specific options: | |
| 2602 | 2614 | @table @option |
| 2603 | 2615 | |
| 2604 | 2616 | @item h264_vaapi |
| @@ -2606,8 +2618,6 @@ Size / quality tradeoff: higher values are smaller / worse quality. · 1 unmodified line | ||
| 2606 | 2618 | @option{level} sets the value of @emph{level_idc}. |
| 2607 | 2619 | |
| 2608 | 2620 | @table @option |
| 2609 | −@item low_power | |
| 2610 | −Use low-power encoding mode. | |
| 2611 | 2621 | @item coder |
| 2612 | 2622 | Set entropy encoder (default is @emph{cabac}). Possible values: |
| 2613 | 2623 | |
| @@ -298,4 +298,13 @@ int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt, · 297 unmodified lines | ||
| 298 | 298 | int ff_vaapi_encode_init(AVCodecContext *avctx); |
| 299 | 299 | int ff_vaapi_encode_close(AVCodecContext *avctx); |
| 300 | 300 | |
| 301 | + | |
| 302 | +#define VAAPI_ENCODE_COMMON_OPTIONS \ | |
| 303 | + { "low_power", \ | |
| 304 | + "Use low-power encoding mode (only available on some platforms; " \ | |
| 305 | + "may not support all encoding features)", \ | |
| 306 | + OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \ | |
| 307 | + { .i64 = 0 }, 0, 1, FLAGS } | |
| 308 | + | |
| 309 | + | |
| 301 | 310 | #endif /* AVCODEC_VAAPI_ENCODE_H */ |
| @@ -52,7 +52,6 @@ typedef struct VAAPIEncodeH264Context { · 51 unmodified lines | ||
| 52 | 52 | // User options. |
| 53 | 53 | int qp; |
| 54 | 54 | int quality; |
| 55 | − int low_power; | |
| 56 | 55 | int coder; |
| 57 | 56 | int aud; |
| 58 | 57 | int sei; |
| @@ -936,8 +935,6 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) · 877 unmodified lines | ||
| 936 | 935 | return AVERROR_PATCHWELCOME; |
| 937 | 936 | } |
| 938 | 937 | |
| 939 | − ctx->low_power = priv->low_power; | |
| 940 | − | |
| 941 | 938 | if (avctx->bit_rate > 0) { |
| 942 | 939 | if (avctx->rc_max_rate == avctx->bit_rate) |
| 943 | 940 | ctx->va_rc_mode = VA_RC_CBR; |
| @@ -970,13 +967,12 @@ static av_cold int vaapi_encode_h264_close(AVCodecContext *avctx) · 26 unmodified lines | ||
| 970 | 967 | #define OFFSET(x) offsetof(VAAPIEncodeH264Context, x) |
| 971 | 968 | #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) |
| 972 | 969 | static const AVOption vaapi_encode_h264_options[] = { |
| 970 | + VAAPI_ENCODE_COMMON_OPTIONS, | |
| 971 | + | |
| 973 | 972 | { "qp", "Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)", |
| 974 | 973 | OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 20 }, 0, 52, FLAGS }, |
| 975 | 974 | { "quality", "Set encode quality (trades off against speed, higher is faster)", |
| 976 | 975 | OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, FLAGS }, |
| 977 | − { "low_power", "Use low-power encoding mode (experimental: only supported " | |
| 978 | − "on some platforms, does not support all features)", | |
| 979 | − OFFSET(low_power), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS }, | |
| 980 | 976 | { "coder", "Entropy coder type", |
| 981 | 977 | OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "coder" }, |
| 982 | 978 | { "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS, "coder" }, |
| @@ -1099,6 +1099,8 @@ static av_cold int vaapi_encode_h265_close(AVCodecContext *avctx) · 1098 unmodified lines | ||
| 1099 | 1099 | #define OFFSET(x) offsetof(VAAPIEncodeH265Context, x) |
| 1100 | 1100 | #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) |
| 1101 | 1101 | static const AVOption vaapi_encode_h265_options[] = { |
| 1102 | + VAAPI_ENCODE_COMMON_OPTIONS, | |
| 1103 | + | |
| 1102 | 1104 | { "qp", "Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)", |
| 1103 | 1105 | OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 25 }, 0, 52, FLAGS }, |
| 1104 | 1106 | |
| @@ -228,6 +228,7 @@ static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx) · 227 unmodified lines | ||
| 228 | 228 | #define OFFSET(x) offsetof(VAAPIEncodeVP8Context, x) |
| 229 | 229 | #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) |
| 230 | 230 | static const AVOption vaapi_encode_vp8_options[] = { |
| 231 | + VAAPI_ENCODE_COMMON_OPTIONS, | |
| 231 | 232 | { "loop_filter_level", "Loop filter level", |
| 232 | 233 | OFFSET(loop_filter_level), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 63, FLAGS }, |
| 233 | 234 | { "loop_filter_sharpness", "Loop filter sharpness", |
| @@ -251,6 +251,7 @@ static av_cold int vaapi_encode_vp9_init(AVCodecContext *avctx) · 250 unmodified lines | ||
| 251 | 251 | #define OFFSET(x) offsetof(VAAPIEncodeVP9Context, x) |
| 252 | 252 | #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) |
| 253 | 253 | static const AVOption vaapi_encode_vp9_options[] = { |
| 254 | + VAAPI_ENCODE_COMMON_OPTIONS, | |
| 254 | 255 | { "loop_filter_level", "Loop filter level", |
| 255 | 256 | OFFSET(loop_filter_level), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 63, FLAGS }, |
| 256 | 257 | { "loop_filter_sharpness", "Loop filter sharpness", |