[Libva] [Libva-intel-driver][PATCH 3/5] svct: Save the current slice type per layer

Xiang, Haihao haihao.xiang at intel.com
Mon Oct 24 04:49:40 UTC 2016


Use the right previous slice type to estimate a QP for next frame
in the same layer

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/gen6_mfc.h        | 1 +
 src/gen6_mfc_common.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/gen6_mfc.h b/src/gen6_mfc.h
index e68c5c5..bc3465f 100644
--- a/src/gen6_mfc.h
+++ b/src/gen6_mfc.h
@@ -234,6 +234,7 @@ struct gen6_mfc_context
         double bits_per_frame[MAX_TEMPORAL_LAYERS];
         double qpf_rounding_accumulator[MAX_TEMPORAL_LAYERS];
         int bits_prev_frame[MAX_TEMPORAL_LAYERS];
+        int prev_slice_type[MAX_TEMPORAL_LAYERS];
 
         double saved_bps;
         double saved_fps;
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index a38c6d0..62fe8cf 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -228,6 +228,9 @@ int intel_mfc_brc_postpack(struct encode_state *encode_state,
     mfc_context->brc.bits_prev_frame[curr_frame_layer_id] = frame_bits;
     frame_bits = mfc_context->brc.bits_prev_frame[next_frame_layer_id];
 
+    mfc_context->brc.prev_slice_type[curr_frame_layer_id] = slicetype;
+    slicetype = mfc_context->brc.prev_slice_type[next_frame_layer_id];
+
     if (encoder_context->layer.num_layers < 2 || encoder_context->layer.size_frame_layer_ids == 0)
         factor = 1.0;
     else
-- 
1.9.1



More information about the Libva mailing list