summaryrefslogtreecommitdiff
path: root/src/gen75_vme.c
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2013-08-12 15:13:23 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-09-06 15:32:29 +0800
commit19c32cefd707c0b547be5da5123160eaf22411bb (patch)
tree619b15b2b581af3fe9dea6c8a4fa344779fe7ba9 /src/gen75_vme.c
parentfe782daf315bf491780dc61a6b866f13ec190762 (diff)
downloadlibva-intel-driver-19c32cefd707c0b547be5da5123160eaf22411bb.tar.gz
libva-intel-driver-19c32cefd707c0b547be5da5123160eaf22411bb.tar.bz2
libva-intel-driver-19c32cefd707c0b547be5da5123160eaf22411bb.zip
Use the scoreboard/walker to assure MB dependency for MPEG2 encoding
If MVP is added for MPEG2 encoding, it must be assured that the left macroblock should be already finished before processing the current macroblock. And this needs the scoreboard/walker mechanism to assure MB dependency. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 5d2163d02d395fc0a794d834979a06c287bf9ba5)
Diffstat (limited to 'src/gen75_vme.c')
-rw-r--r--src/gen75_vme.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/gen75_vme.c b/src/gen75_vme.c
index 3935528..3e769ed 100644
--- a/src/gen75_vme.c
+++ b/src/gen75_vme.c
@@ -916,14 +916,47 @@ gen75_vme_mpeg2_pipeline_programing(VADriverContextP ctx,
{
struct gen6_vme_context *vme_context = encoder_context->vme_context;
struct intel_batchbuffer *batch = encoder_context->base.batch;
+ VAEncPictureParameterBufferMPEG2 *pic_param = NULL;
VAEncSequenceParameterBufferMPEG2 *seq_param = (VAEncSequenceParameterBufferMPEG2 *)encode_state->seq_param_ext->buffer;
int width_in_mbs = ALIGN(seq_param->picture_width, 16) / 16;
int height_in_mbs = ALIGN(seq_param->picture_height, 16) / 16;
+ bool allow_hwscore = true;
+ int s;
+ int kernel_shader;
- gen75_vme_mpeg2_fill_vme_batchbuffer(ctx,
+ pic_param = (VAEncPictureParameterBufferMPEG2 *)encode_state->pic_param_ext->buffer;
+
+ for (s = 0; s < encode_state->num_slice_params_ext; s++) {
+ int j;
+ VAEncSliceParameterBufferMPEG2 *slice_param = (VAEncSliceParameterBufferMPEG2 *)encode_state->slice_params_ext[s]->buffer;
+
+ for (j = 0; j < encode_state->slice_params_ext[s]->num_elements; j++) {
+ if (slice_param->macroblock_address % width_in_mbs) {
+ allow_hwscore = false;
+ break;
+ }
+ }
+ }
+
+ pic_param = (VAEncPictureParameterBufferMPEG2 *)encode_state->pic_param_ext->buffer;
+ if (pic_param->picture_type == VAEncPictureTypeIntra) {
+ allow_hwscore = false;
+ kernel_shader = VME_INTRA_SHADER;
+ } else {
+ kernel_shader = VME_INTER_SHADER;
+ }
+
+ if (allow_hwscore)
+ gen7_vme_mpeg2_walker_fill_vme_batchbuffer(ctx,
+ encode_state,
+ width_in_mbs, height_in_mbs,
+ kernel_shader,
+ encoder_context);
+ else
+ gen75_vme_mpeg2_fill_vme_batchbuffer(ctx,
encode_state,
width_in_mbs, height_in_mbs,
- is_intra ? VME_INTRA_SHADER : VME_INTER_SHADER,
+ kernel_shader,
0,
encoder_context);