Discussion:
[PATCH][libva-intel-driver] ConfigAttribEncROI: check entrypoint on VAGetConfigAttrib
(too old to reply)
Daniel Charles
2016-10-12 22:45:11 UTC
Permalink
The attribute VAConfigAttribEncROI has to check that the entrypoint
is actually a VAEntrypointEncSlice or VAEntrypointEncSliceLP

Signed-off-by: Daniel Charles <***@intel.com>
---
src/i965_drv_video.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index c9357f5..3a33356 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -984,22 +984,29 @@ i965_GetConfigAttributes(VADriverContextP ctx,
break;

case VAConfigAttribEncROI:
- if (profile == VAProfileH264ConstrainedBaseline ||
- profile == VAProfileH264Main ||
- profile == VAProfileH264High) {
- VAConfigAttribValEncROI *roi_config = (VAConfigAttribValEncROI *)&(attrib_list[i].value);
-
- if(entrypoint == VAEntrypointEncSliceLP) {
- roi_config->bits.num_roi_regions = 3;
- roi_config->bits.roi_rc_priority_support = 0;
- roi_config->bits.roi_rc_qp_delat_support = 0;
- } else {
- roi_config->bits.num_roi_regions = I965_MAX_NUM_ROI_REGIONS;
- roi_config->bits.roi_rc_priority_support = 0;
- roi_config->bits.roi_rc_qp_delat_support = 1;
+ if (entrypoint == VAEntrypointEncSlice ||
+ entrypoint == VAEntrypointEncSliceLP) {
+
+ if (profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High) {
+
+ VAConfigAttribValEncROI *roi_config =
+ (VAConfigAttribValEncROI *)&(attrib_list[i].value);
+
+ if(entrypoint == VAEntrypointEncSliceLP) {
+ roi_config->bits.num_roi_regions = 3;
+ roi_config->bits.roi_rc_priority_support = 0;
+ roi_config->bits.roi_rc_qp_delat_support = 0;
+ } else {
+ roi_config->bits.num_roi_regions =
+ I965_MAX_NUM_ROI_REGIONS;
+ roi_config->bits.roi_rc_priority_support = 0;
+ roi_config->bits.roi_rc_qp_delat_support = 1;
+ }
+ }else {
+ attrib_list[i].value = 0;
}
- }else {
- attrib_list[i].value = 0;
}

break;
--
2.5.5
Xiang, Haihao
2016-10-13 08:22:35 UTC
Permalink
Thanks for the patch, applied.
Post by Daniel Charles
The attribute VAConfigAttribEncROI has to check that the entrypoint
is actually a VAEntrypointEncSlice or VAEntrypointEncSliceLP
---
 src/i965_drv_video.c | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index c9357f5..3a33356 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -984,22 +984,29 @@ i965_GetConfigAttributes(VADriverContextP ctx,
             break;
 
-            if (profile == VAProfileH264ConstrainedBaseline ||
-                profile == VAProfileH264Main ||
-                profile == VAProfileH264High) {
-                VAConfigAttribValEncROI *roi_config =
(VAConfigAttribValEncROI *)&(attrib_list[i].value);
-
-                if(entrypoint == VAEntrypointEncSliceLP) {
-                    roi_config->bits.num_roi_regions = 3;
-                    roi_config->bits.roi_rc_priority_support = 0;
-                    roi_config->bits.roi_rc_qp_delat_support = 0;
-                } else {
-                    roi_config->bits.num_roi_regions =
I965_MAX_NUM_ROI_REGIONS;
-                    roi_config->bits.roi_rc_priority_support = 0;
-                    roi_config->bits.roi_rc_qp_delat_support = 1;
+            if (entrypoint == VAEntrypointEncSlice ||
+                entrypoint == VAEntrypointEncSliceLP) {
+
+                if (profile == VAProfileH264ConstrainedBaseline ||
+                    profile == VAProfileH264Main ||
+                    profile == VAProfileH264High) {
+
+                    VAConfigAttribValEncROI *roi_config =
+                        (VAConfigAttribValEncROI
*)&(attrib_list[i].value);
+
+                    if(entrypoint == VAEntrypointEncSliceLP) {
+                        roi_config->bits.num_roi_regions = 3;
+                        roi_config->bits.roi_rc_priority_support =
0;
+                        roi_config->bits.roi_rc_qp_delat_support =
0;
+                    } else {
+                        roi_config->bits.num_roi_regions =
+                            I965_MAX_NUM_ROI_REGIONS;
+                        roi_config->bits.roi_rc_priority_support =
0;
+                        roi_config->bits.roi_rc_qp_delat_support =
1;
+                    }
+                }else {
+                    attrib_list[i].value = 0;
                 }
-            }else {
-                attrib_list[i].value = 0;
             }
 
             break;
Loading...