[Libva] [Libva-intel-driver][PATCH v3 18/18] Add support for VAConfigAttribEncRateControlExt attribute

Xiang, Haihao haihao.xiang at intel.com
Tue Sep 13 08:02:47 UTC 2016


Currently bit rate control per temporal layer is disabled

v2: rebased

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
Tested-by: Luo, Focus <focus.luo at intel.com>
---
 src/i965_drv_video.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index ddad70a..c9357f5 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1004,6 +1004,21 @@ i965_GetConfigAttributes(VADriverContextP ctx,
 
             break;
 
+        case VAConfigAttribEncRateControlExt:
+            if ((profile == VAProfileH264ConstrainedBaseline ||
+                 profile == VAProfileH264Main ||
+                 profile == VAProfileH264High) &&
+                entrypoint == VAEntrypointEncSlice) {
+                VAConfigAttribValEncRateControlExt *val_config = (VAConfigAttribValEncRateControlExt *)&(attrib_list[i].value);
+
+                val_config->bits.max_num_temporal_layers_minus1 = MAX_TEMPORAL_LAYERS - 1;
+                val_config->bits.temporal_layer_bitrate_control_flag = 1;
+            } else {
+                attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
+            }
+
+            break;
+
         default:
             /* Do nothing */
             attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
-- 
1.9.1



More information about the Libva mailing list