Discussion:
[Libva-intel-driver][PATCH] Set default framerate to 30fps if user doesn't set the corresponding sequence parameter
(too old to reply)
Xiang, Haihao
2016-09-27 14:49:24 UTC
Permalink
User can update framerate using VAEncMiscParameterTypeFrameRate buffer later

Signed-off-by: Xiang, Haihao <***@intel.com>
---
src/i965_encoder.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 7e44a5a..8587fd5 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -312,7 +312,12 @@ intel_encoder_check_brc_h264_sequence_parameter(VADriverContextP ctx,

assert(seq_param);
bits_per_second = seq_param->bits_per_second; // for the highest layer
- framerate_per_100s = seq_param->time_scale * 100 / (2 * seq_param->num_units_in_tick); // for the highest layer
+
+ if (!seq_param->num_units_in_tick || !seq_param->time_scale)
+ framerate_per_100s = 3000;
+ else
+ framerate_per_100s = seq_param->time_scale * 100 / (2 * seq_param->num_units_in_tick); // for the highest layer
+
encoder_context->brc.num_iframes_in_gop = 1; // Always 1

if (seq_param->intra_period == 0) { // E.g. IDRPP... / IDR(PBB)... (no IDR/I any more)
--
1.9.1
Zhao Yakui
2016-09-28 01:04:04 UTC
Permalink
Post by Xiang, Haihao
User can update framerate using VAEncMiscParameterTypeFrameRate buffer later
It looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Yakui
Post by Xiang, Haihao
---
src/i965_encoder.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 7e44a5a..8587fd5 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -312,7 +312,12 @@ intel_encoder_check_brc_h264_sequence_parameter(VADriverContextP ctx,
assert(seq_param);
bits_per_second = seq_param->bits_per_second; // for the highest layer
- framerate_per_100s = seq_param->time_scale * 100 / (2 * seq_param->num_units_in_tick); // for the highest layer
+
+ if (!seq_param->num_units_in_tick || !seq_param->time_scale)
+ framerate_per_100s = 3000;
+ else
+ framerate_per_100s = seq_param->time_scale * 100 / (2 * seq_param->num_units_in_tick); // for the highest layer
+
encoder_context->brc.num_iframes_in_gop = 1; // Always 1
if (seq_param->intra_period == 0) { // E.g. IDRPP... / IDR(PBB)... (no IDR/I any more)
Sean V Kelley
2016-10-04 21:23:29 UTC
Permalink
Post by Zhao Yakui
Post by Xiang, Haihao
User can update framerate using VAEncMiscParameterTypeFrameRate buffer later
It looks good to me.
Sorry Yakui, didn't see your reply until after I reviewed and pushed.

Thanks,

Sean
Post by Zhao Yakui
Thanks
    Yakui
Post by Xiang, Haihao
---
  src/i965_encoder.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 7e44a5a..8587fd5 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -312,7 +312,12 @@
intel_encoder_check_brc_h264_sequence_parameter(VADriverContextP
ctx,
      assert(seq_param);
      bits_per_second = seq_param->bits_per_second; // for the
highest layer
-    framerate_per_100s = seq_param->time_scale * 100 / (2 *
seq_param->num_units_in_tick); // for the highest layer
+
+    if (!seq_param->num_units_in_tick || !seq_param->time_scale)
+        framerate_per_100s = 3000;
+    else
+        framerate_per_100s = seq_param->time_scale * 100 / (2 *
seq_param->num_units_in_tick); // for the highest layer
+
      encoder_context->brc.num_iframes_in_gop = 1; // Always 1
      if (seq_param->intra_period == 0) { // E.g. IDRPP... /
IDR(PBB)... (no IDR/I any more)
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Sean V Kelley
2016-10-04 21:21:23 UTC
Permalink
Post by Xiang, Haihao
User can update framerate using VAEncMiscParameterTypeFrameRate buffer later
I am okay with this.  lgtm, applied.

Thanks,

Sean
Post by Xiang, Haihao
---
 src/i965_encoder.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 7e44a5a..8587fd5 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -312,7 +312,12 @@
intel_encoder_check_brc_h264_sequence_parameter(VADriverContextP ctx,
 
     assert(seq_param);
     bits_per_second = seq_param->bits_per_second; // for the highest
layer
-    framerate_per_100s = seq_param->time_scale * 100 / (2 *
seq_param->num_units_in_tick); // for the highest layer
+
+    if (!seq_param->num_units_in_tick || !seq_param->time_scale)
+        framerate_per_100s = 3000;
+    else
+        framerate_per_100s = seq_param->time_scale * 100 / (2 *
seq_param->num_units_in_tick); // for the highest layer
+
     encoder_context->brc.num_iframes_in_gop = 1; // Always 1
 
     if (seq_param->intra_period == 0) { // E.g. IDRPP... /
IDR(PBB)... (no IDR/I any more)
Loading...