Commit b6a59e00 authored by COCQUEBERT Cédric's avatar COCQUEBERT Cédric Committed by Laurent Aimar

Fixed video offsets and horizontal edge blending.

Signed-off-by: default avatarCOCQUEBERT Cédric <cedric.cocquebert@cea.fr>
Signed-off-by: default avatarLaurent Aimar <fenrir@videolan.org>
parent 1eaa7b8c
......@@ -850,7 +850,7 @@ static int Init( vout_thread_t *p_vout )
else if (i_row == p_vout->p_sys->i_row -1)
p_entry->p_vout->i_alignment |= VOUT_ALIGN_TOP;
}
// i_n : number of active pp_vout
// i_active : number of active pp_vout
int i_active = 0;
for( int i = 0; i <= p_vout->p_sys->i_vout; i++ )
{
......@@ -858,8 +858,8 @@ static int Init( vout_thread_t *p_vout )
i_active++;
}
var_SetInteger( p_vout, "align", p_entry->p_vout->i_alignment );
var_SetInteger( p_vout, "video-x", i_video_x + p_vout->p_sys->i_offset_x + ((i_active + 1) % p_vout->p_sys->i_col) * p_vout->i_window_width);
var_SetInteger( p_vout, "video-y", i_video_y + ((i_active + 1) / p_vout->p_sys->i_col) * p_vout->i_window_height);
var_SetInteger( p_vout, "video-x", i_video_x + p_vout->p_sys->i_offset_x + (i_active % p_vout->p_sys->i_col) * p_vout->i_window_width);
var_SetInteger( p_vout, "video-y", i_video_y + (i_active / p_vout->p_sys->i_col) * p_vout->i_window_height);
#endif
}
}
......@@ -1040,7 +1040,7 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
if( p_vout->p_sys->i_col > 2 )
{
const int halfl = length / 2;
if( b_col_first == 0)
if( b_col_first)
vlc_memcpy( &p_out[halfl], &p_in[0], i_copy_pitch - halfl );
else if( b_col_last )
vlc_memcpy( &p_out[ 0], &p_in[-halfl], i_copy_pitch - halfl );
......@@ -1085,9 +1085,6 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
p_dst[i_index] = (p_vout->p_sys->lambda[0][i_plane][i_index] * p_dst[i_index]) / ACCURACY +
p_vout->p_sys->cstYUV[0][i_plane][i_index];
#else
fprintf( stderr, "r=%d c=%d, i_plane=%d i_index=%d | %d %d\n", i_row, i_col, i_plane, i_index,
i_copy_pitch, length );
fprintf( stderr, "# %d\n", p_dst[i_index] );
p_dst[i_index] = p_vout->p_sys->LUT[i_plane][p_vout->p_sys->lambda[0][i_plane][i_index]][p_dst[i_index]];
#endif
}
......@@ -1100,9 +1097,29 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
}
#ifdef OVERLAP
// horizontal blend
if( p_vout->p_sys->i_row > 2 )
if ( p_vout->p_sys->i_row >= 2 )
{
// black bar
if (( p_vout->p_sys->i_row > 2 ) && (( b_row_first ) || ( b_row_last )))
{
int height = 2 * p_vout->p_sys->i_halfHeight / i_div;
if ( b_row_first )
{
length = 2 * p_vout->p_sys->i_halfHeight / i_div;
TopOffset = i_lines + (2 * p_vout->p_sys->i_halfHeight) / i_div;
}
else
{
TopOffset = height - (2 * p_vout->p_sys->i_halfHeight) / i_div;
}
uint8_t *p_dst = p_out - TopOffset * i_out_pitch;
for (i_index = 0; i_index < height; i_index++)
for (i_index2 = 0; i_index2 < i_copy_pitch; i_index2++)
p_dst[i_index * i_out_pitch + i_index2] = constantYUV[i_plane];
}
if( p_vout->p_sys->b_attenuate )
{
length = 2 * p_vout->p_sys->i_halfHeight / (p_vout->p_sys->pp_vout[i_vout].i_width / i_copy_pitch);
if (p_vout->p_sys->b_has_changed)
{
Denom = F2(length);
......@@ -1116,19 +1133,9 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
p_vout->p_sys->cstYUV2[i_col_mod][i_plane][i_index] = ((ACCURACY - p_vout->p_sys->lambda2[i_col_mod][i_plane][i_index]) * constantYUV[i_plane]) / ACCURACY;
}
}
if( b_row_first )
{
// black bar
TopOffset = i_lines + (2 * p_vout->p_sys->i_halfHeight) / i_div;
uint8_t *p_dst = p_out - TopOffset * i_out_pitch;
for (i_index = 0; i_index < length; i_index++)
memset( &p_dst[i_index * i_out_pitch], constantYUV[i_plane], i_copy_pitch );
}
else if( p_vout->p_sys->b_attenuate )
{
// first blended zone
if ( !b_row_first )
{
TopOffset = i_lines;
uint8_t *p_dst = p_out - TopOffset * i_out_pitch;
......@@ -1146,19 +1153,9 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
}
}
}
if( b_row_last )
{
// black bar
TopOffset = length - (2 * p_vout->p_sys->i_halfHeight) / i_div;
uint8_t *p_dst = p_out - TopOffset * p_outpic->p[i_plane].i_pitch;
for (i_index = 0; i_index < length; i_index++)
memset( &p_dst[i_index * i_out_pitch], constantYUV[i_plane], i_copy_pitch );
}
else if( p_vout->p_sys->b_attenuate )
{
// second blended zone
if ( !b_row_last )
{
TopOffset = length;
uint8_t *p_dst = p_out - TopOffset * p_outpic->p[i_plane].i_pitch;
......@@ -1177,8 +1174,9 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
}
}
}
// end blended zone
}
}
// end blended zone
#endif
// bug for wall filter : fix by CC
// pi_left_skip[i_plane] += i_out_pitch;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment