<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal text */
{
font-size: 9pt;
font-family: 'Courier New';
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* Heading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #0000ff;
}
span.rvts2 /* Subheading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #000080;
}
span.rvts3 /* Keywords */
{
font-size: 10pt;
font-family: 'Arial';
font-style: italic;
color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
span.rvts6
{
font-size: 11pt;
font-family: 'tahoma';
font-weight: bold;
color: #ffffff;
background-color: #0000ff;
}
span.rvts7
{
font-size: 11pt;
font-family: 'calibri';
color: #454545;
}
span.rvts8
{
}
span.rvts9
{
font-size: 8pt;
font-family: 'arial';
font-style: italic;
color: #c0c0c0;
}
a.rvts10, span.rvts10
{
font-size: 8pt;
font-family: 'arial';
color: #0000ff;
text-decoration: underline;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
--></style>
</head>
<body>
<p>Hello Chang,</p>
<p><br></p>
<p>Monday, April 21, 2008, 7:38:14 AM, you wrote:</p>
<p><br></p>
<p>and what about this solution?</p>
<p><br></p>
<p>- CHECKED_MALLOC( frame->buffer[4+i],</p>
<p>- frame->i_stride[0] * ( frame->i_lines[0] + 2*i_padv ) );</p>
<p>- frame->filtered[i+1] = ((uint8_t*)frame->buffer[4+i]) +</p>
<p>- frame->i_stride[0] * i_padv + PADH;</p>
<p>+ CHECKED_MALLOC( frame->buffer[i], luma_plane_size/4 );</p>
<p>+ frame->plane[i] = (uint8_t*)frame->buffer[i] + (frame->i_stride[i] * i_padv + PADH)/2;</p>
<p> }</p>
<p>+ /* all 4 luma planes allocated together, since the cacheline split code</p>
<p>+ * requires them to be in-phase wrt cacheline alignment. */</p>
<p>+ CHECKED_MALLOC( frame->buffer[0], 4*luma_plane_size);</p>
<p>+ for( i = 0; i < 4; i++ )</p>
<p>+ frame->filtered[i] = (uint8_t*)frame->buffer[0] + i*luma_plane_size + frame->i_stride[0] * i_padv + PADH;</p>
<p>+ frame->plane[0] = frame->filtered[0];</p>
<p><br></p>
<p>in this case MSVS2005 says it's fine... and compiles it perfectly. (i've wrote that on doom9 last week)</p>
<p><br></p>
<div><table border=0 cellpadding=1 cellspacing=2>
<tr valign=top>
<td width=12 style="background-color: #0000ff;">
<p><span class=rvts6>></span></p>
</td>
<td width=751 style="background-color: #ffffff;">
<p><span class=rvts7>Hi </span></p>
<p><span class=rvts7> </span></p>
<p><span class=rvts7>For the “cacheline split workaround for mc_luma”</span></p>
<p><span class=rvts7> </span></p>
<p><span class=rvts8>+ for( i = 1; i < 3; i++ )</span></p>
<p><span class=rvts8> {</span></p>
<p><span class=rvts8>- CHECKED_MALLOC( frame->buffer[4+i],</span></p>
<p><span class=rvts8>- frame->i_stride[0] * ( frame->i_lines[0] + 2*i_padv ) );</span></p>
<p><span class=rvts8>- frame->filtered[i+1] = ((uint8_t*)frame->buffer[4+i]) +</span></p>
<p><span class=rvts8>- frame->i_stride[0] * i_padv + PADH;</span></p>
<p><span class=rvts8>+ CHECKED_MALLOC( frame->buffer[i], luma_plane_size/4 );</span></p>
<p><span class=rvts8>+ frame->plane[i] = frame->buffer[i] + (frame->i_stride[i] * i_padv + PADH)/2;</span></p>
<p><span class=rvts8> }</span></p>
<p><span class=rvts7> </span></p>
<p><span class=rvts7>This line would be problematic, </span></p>
<p><span class=rvts7> </span></p>
<p><span class=rvts7>frame->plane[i] = frame->buffer[i] + (frame->i_stride[i] * i_padv + PADH)/2;</span></p>
<p><span class=rvts7> </span></p>
<p><span class=rvts7>the buffer array is defined as “void *buffer[4];” and plane is defined as ”uint8_t *plane[3]”, so it leads a compile issue at MSVC71 </span></p>
</td>
</tr>
</table>
</div>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts9>-- </span></p>
<p><span class=rvts9>Best regards,</span></p>
<p><span class=rvts9> Paul 'Spawn' Rysevets </span><a class=rvts10 href="mailto:P.Rysevets@sam-solutions.net">P.Rysevets@sam-solutions.net</a></p>
<p><span class=rvts9> SpAwN_gUy.aka.WAREZMasta </span><a class=rvts10 href="mailto:WAREZMasta@gmail.com">WAREZMasta@gmail.com</a></p>
<p><span class=rvts9> ICQ(PRiMARY):968978 ICQ(Secondary):169588436</span></p>
</body></html>