<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">AVC SPEC only allow max 16 frames for 1080P at level 5.1. and Level 4/4.1/4.2 only allow max 4 ref frames. And level 5 allow max 13 ref frames for
1080P.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Here the user should be careful when set “denom”. The driver now use the default value “1” to set the VME. it is safe by now.<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Pengfei<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Peter Frühberger [mailto:peter.fruehberger@gmail.com]
<br>
<b>Sent:</b> Saturday, July 9, 2016 2:05 PM<br>
<b>To:</b> Qu, Pengfei <pengfei.qu@intel.com><br>
<b>Cc:</b> libva@lists.freedesktop.org; Meng, Jia <jia.meng@intel.com><br>
<b>Subject:</b> Re: [Libva] [PATCH 11/13] Adjust the maximum number of motion vectors for B frame on HSW+<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Be careful here, please,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">some real life files lie about their spec, e.g. they are announcing Level 4.1 High but ship 16 Reframes at 1920x1080. Afaik mpeg-2 always uses 2 (one past and one future). That would result in pixelation, right?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Best regards<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Peter<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">2016-07-07 11:18 GMT+02:00 Pengfei Qu <<a href="mailto:Pengfei.Qu@intel.com" target="_blank">Pengfei.Qu@intel.com</a>>:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><span lang="EN-US">From: Jia Meng <<a href="mailto:jia.meng@intel.com">jia.meng@intel.com</a>><br>
<br>
Signed-off-by: Jia Meng <<a href="mailto:jia.meng@intel.com">jia.meng@intel.com</a>><br>
Signed-off-by: Pengfei Qu <<a href="mailto:Pengfei.Qu@intel.com">Pengfei.Qu@intel.com</a>><br>
---<br>
src/gen75_vme.c | 13 +++++++------<br>
src/gen8_vme.c | 15 ++++++++-------<br>
src/gen9_vme.c | 17 +++++++++--------<br>
3 files changed, 24 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/src/gen75_vme.c b/src/gen75_vme.c<br>
index 174a642..81925fe 100644<br>
--- a/src/gen75_vme.c<br>
+++ b/src/gen75_vme.c<br>
@@ -330,7 +330,8 @@ static VAStatus gen75_vme_interface_setup(VADriverContextP ctx,<br>
<br>
static VAStatus gen75_vme_constant_setup(VADriverContextP ctx,<br>
struct encode_state *encode_state,<br>
- struct intel_encoder_context *encoder_context)<br>
+ struct intel_encoder_context *encoder_context,<br>
+ int denom)<br>
{<br>
struct gen6_vme_context *vme_context = encoder_context->vme_context;<br>
unsigned char *constant_buffer;<br>
@@ -342,13 +343,13 @@ static VAStatus gen75_vme_constant_setup(VADriverContextP ctx,<br>
if (encoder_context->codec == CODEC_H264 ||<br>
encoder_context->codec == CODEC_H264_MVC) {<br>
if (vme_context->h264_level >= 30) {<br>
- mv_num = 16;<br>
+ mv_num = 16 / denom;<br>
<br>
if (vme_context->h264_level >= 31)<br>
- mv_num = 8;<br>
+ mv_num = 8 / denom;<br>
}<br>
} else if (encoder_context->codec == CODEC_MPEG2) {<br>
- mv_num = 2;<br>
+ mv_num = 2 / denom;<br>
}<br>
<br>
vme_state_message[31] = mv_num;<br>
@@ -675,7 +676,7 @@ static VAStatus gen75_vme_prepare(VADriverContextP ctx,<br>
gen75_vme_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen75_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen75_vme_vme_state_setup(ctx, encode_state, is_intra, encoder_context);<br>
- gen75_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen75_vme_constant_setup(ctx, encode_state, encoder_context, (pSliceParameter->slice_type == SLICE_TYPE_B) ? 2 : 1);<br>
<br>
/*Programing media pipeline*/<br>
gen75_vme_pipeline_programing(ctx, encode_state, encoder_context);<br>
@@ -987,7 +988,7 @@ gen75_vme_mpeg2_prepare(VADriverContextP ctx,<br>
gen75_vme_interface_setup(ctx, encode_state, encoder_context);<br>
gen75_vme_vme_state_setup(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
intel_vme_mpeg2_state_setup(ctx, encode_state, encoder_context);<br>
- gen75_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen75_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen75_vme_mpeg2_pipeline_programing(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
diff --git a/src/gen8_vme.c b/src/gen8_vme.c<br>
index 28b8195..f4a874e 100644<br>
--- a/src/gen8_vme.c<br>
+++ b/src/gen8_vme.c<br>
@@ -363,7 +363,8 @@ static VAStatus gen8_vme_interface_setup(VADriverContextP ctx,<br>
<br>
static VAStatus gen8_vme_constant_setup(VADriverContextP ctx,<br>
struct encode_state *encode_state,<br>
- struct intel_encoder_context *encoder_context)<br>
+ struct intel_encoder_context *encoder_context,<br>
+ int denom)<br>
{<br>
struct gen6_vme_context *vme_context = encoder_context->vme_context;<br>
unsigned char *constant_buffer;<br>
@@ -375,13 +376,13 @@ static VAStatus gen8_vme_constant_setup(VADriverContextP ctx,<br>
if (encoder_context->codec == CODEC_H264 ||<br>
encoder_context->codec == CODEC_H264_MVC) {<br>
if (vme_context->h264_level >= 30) {<br>
- mv_num = 16;<br>
+ mv_num = 16 / denom;<br>
<br>
if (vme_context->h264_level >= 31)<br>
- mv_num = 8;<br>
+ mv_num = 8 / denom;<br>
}<br>
} else if (encoder_context->codec == CODEC_MPEG2) {<br>
- mv_num = 2;<br>
+ mv_num = 2 / denom;<br>
}<br>
<br>
vme_state_message[31] = mv_num;<br>
@@ -749,7 +750,7 @@ static VAStatus gen8_vme_prepare(VADriverContextP ctx,<br>
gen8_vme_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen8_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen8_vme_vme_state_setup(ctx, encode_state, is_intra, encoder_context);<br>
- gen8_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen8_vme_constant_setup(ctx, encode_state, encoder_context, (pSliceParameter->slice_type == SLICE_TYPE_B) ? 2 : 1);<br>
<br>
/*Programing media pipeline*/<br>
gen8_vme_pipeline_programing(ctx, encode_state, encoder_context);<br>
@@ -1139,7 +1140,7 @@ gen8_vme_mpeg2_prepare(VADriverContextP ctx,<br>
gen8_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen8_vme_vme_state_setup(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
intel_vme_mpeg2_state_setup(ctx, encode_state, encoder_context);<br>
- gen8_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen8_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen8_vme_mpeg2_pipeline_programing(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
@@ -1272,7 +1273,7 @@ static VAStatus gen8_vme_vp8_prepare(VADriverContextP ctx,<br>
/*Setup all the memory object*/<br>
gen8_vme_vp8_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen8_vme_interface_setup(ctx, encode_state, encoder_context);<br>
- gen8_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen8_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen8_vme_vp8_pipeline_programing(ctx, encode_state, is_intra, encoder_context);<br>
diff --git a/src/gen9_vme.c b/src/gen9_vme.c<br>
index 46ba9c0..b495f28 100644<br>
--- a/src/gen9_vme.c<br>
+++ b/src/gen9_vme.c<br>
@@ -400,7 +400,8 @@ static VAStatus gen9_vme_interface_setup(VADriverContextP ctx,<br>
<br>
static VAStatus gen9_vme_constant_setup(VADriverContextP ctx,<br>
struct encode_state *encode_state,<br>
- struct intel_encoder_context *encoder_context)<br>
+ struct intel_encoder_context *encoder_context,<br>
+ int denom)<br>
{<br>
struct gen6_vme_context *vme_context = encoder_context->vme_context;<br>
unsigned char *constant_buffer;<br>
@@ -412,13 +413,13 @@ static VAStatus gen9_vme_constant_setup(VADriverContextP ctx,<br>
if (encoder_context->codec == CODEC_H264 ||<br>
encoder_context->codec == CODEC_H264_MVC) {<br>
if (vme_context->h264_level >= 30) {<br>
- mv_num = 16;<br>
+ mv_num = 16 / denom;<br>
<br>
if (vme_context->h264_level >= 31)<br>
- mv_num = 8;<br>
+ mv_num = 8 / denom;<br>
}<br>
} else if (encoder_context->codec == CODEC_MPEG2) {<br>
- mv_num = 2;<br>
+ mv_num = 2 / denom;<br>
}else if (encoder_context->codec == CODEC_HEVC) {<br>
if (vme_context->hevc_level >= 30*3) {<br>
mv_num = 16;<br>
@@ -795,7 +796,7 @@ static VAStatus gen9_vme_prepare(VADriverContextP ctx,<br>
gen9_vme_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen9_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen9_vme_vme_state_setup(ctx, encode_state, is_intra, encoder_context);<br>
- gen9_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen9_vme_constant_setup(ctx, encode_state, encoder_context, (pSliceParameter->slice_type == SLICE_TYPE_B) ? 2 : 1);<br>
<br>
/*Programing media pipeline*/<br>
gen9_vme_pipeline_programing(ctx, encode_state, encoder_context);<br>
@@ -1187,7 +1188,7 @@ gen9_vme_mpeg2_prepare(VADriverContextP ctx,<br>
gen9_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen9_vme_vme_state_setup(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
intel_vme_mpeg2_state_setup(ctx, encode_state, encoder_context);<br>
- gen9_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen9_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen9_vme_mpeg2_pipeline_programing(ctx, encode_state, slice_param->is_intra_slice, encoder_context);<br>
@@ -1322,7 +1323,7 @@ static VAStatus gen9_vme_vp8_prepare(VADriverContextP ctx,<br>
/*Setup all the memory object*/<br>
gen9_vme_vp8_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen9_vme_interface_setup(ctx, encode_state, encoder_context);<br>
- gen9_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen9_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen9_vme_vp8_pipeline_programing(ctx, encode_state, is_intra, encoder_context);<br>
@@ -1754,7 +1755,7 @@ static VAStatus gen9_vme_hevc_prepare(VADriverContextP ctx,<br>
gen9_vme_hevc_surface_setup(ctx, encode_state, is_intra, encoder_context);<br>
gen9_vme_interface_setup(ctx, encode_state, encoder_context);<br>
//gen9_vme_vme_state_setup(ctx, encode_state, is_intra, encoder_context);<br>
- gen9_vme_constant_setup(ctx, encode_state, encoder_context);<br>
+ gen9_vme_constant_setup(ctx, encode_state, encoder_context, 1);<br>
<br>
/*Programing media pipeline*/<br>
gen9_vme_hevc_pipeline_programing(ctx, encode_state, encoder_context);<br>
<span class="hoenzb"><span style="color:#888888">--</span></span><span style="color:#888888"><br>
<span class="hoenzb">2.7.4</span><br>
<br>
<span class="hoenzb">_______________________________________________</span><br>
<span class="hoenzb">Libva mailing list</span><br>
<span class="hoenzb"><a href="mailto:Libva@lists.freedesktop.org">Libva@lists.freedesktop.org</a></span><br>
<span class="hoenzb"><a href="https://lists.freedesktop.org/mailman/listinfo/libva" target="_blank">https://lists.freedesktop.org/mailman/listinfo/libva</a></span></span><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span lang="EN-US"><br>
<br clear="all">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"> Key-ID: 0x1A995A9B<br>
keyserver: <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>
==============================================================<br>
Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>