[FFmpeg-cvslog] Merge commit 'a86aa16088ad7f22a8918d71adb8c040d6033d84'

Hendrik Leppkes git at videolan.org
Sun Jun 26 20:23:58 CEST 2016


ffmpeg | branch: release/3.1 | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Jun 26 15:44:43 2016 +0200| [f2a3798ea45932ebf36dba87feaac2b4f5851780] | committer: Hendrik Leppkes

Merge commit 'a86aa16088ad7f22a8918d71adb8c040d6033d84'

* commit 'a86aa16088ad7f22a8918d71adb8c040d6033d84':
  vaapi_h264: Add trivial support for low-power encoding

Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2a3798ea45932ebf36dba87feaac2b4f5851780
---

 libavcodec/vaapi_encode_h264.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index b304a66..39e2ec0 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -126,6 +126,7 @@ typedef struct VAAPIEncodeH264Context {
 typedef struct VAAPIEncodeH264Options {
     int qp;
     int quality;
+    int low_power;
 } VAAPIEncodeH264Options;
 
 
@@ -860,7 +861,17 @@ static av_cold int vaapi_encode_h264_init_internal(AVCodecContext *avctx)
                avctx->profile);
         return AVERROR(EINVAL);
     }
-    ctx->va_entrypoint = VAEntrypointEncSlice;
+    if (opt->low_power) {
+#if VA_CHECK_VERSION(0, 39, 1)
+        ctx->va_entrypoint = VAEntrypointEncSliceLP;
+#else
+        av_log(avctx, AV_LOG_ERROR, "Low-power encoding is not "
+               "supported with this VAAPI version.\n");
+        return AVERROR(EINVAL);
+#endif
+    } else {
+        ctx->va_entrypoint = VAEntrypointEncSlice;
+    }
 
     ctx->input_width    = avctx->width;
     ctx->input_height   = avctx->height;
@@ -943,7 +954,10 @@ static const AVOption vaapi_encode_h264_options[] = {
     { "qp", "Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)",
       OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 20 }, 0, 52, FLAGS },
     { "quality", "Set encode quality (trades off against speed, higher is faster)",
-      OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, FLAGS },
+      OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, FLAGS },
+    { "low_power", "Use low-power encoding mode (experimental: only supported "
+      "on some platforms, does not support all features)",
+      OFFSET(low_power), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
     { NULL },
 };
 


======================================================================




More information about the ffmpeg-cvslog mailing list