Set the luma/chroma strides depending on source buffer
If the data is read directly from the input buffer, set the stride values to those of the input buffer. If the data is copied, set the stride to the value of the local buffer instead. This fixes handling of cases where the input buffer stride is (significantly) larger than the maxwidth of the video. This also effectively makes the parameter ive_ctl_set_dimensions_ip_t.u4_strd useless - nothing needs to know the stride until you actually encode a frame, and at that point, we can either use the stride of the input buffer, or of the local pu1_y_csc_buf_base where the copied content is stored. Change-Id: Icde400b4a0867d25855e621e143454e608748aa3
This commit is contained in:
parent
53c6878c15
commit
90a3904fd3
2 changed files with 12 additions and 2 deletions
|
|
@ -841,6 +841,8 @@ void ih264e_init_me(process_ctxt_t *ps_proc)
|
|||
|
||||
/* src ptr */
|
||||
ps_me_ctxt->pu1_src_buf_luma = ps_proc->pu1_src_buf_luma;
|
||||
/* src stride */
|
||||
ps_me_ctxt->i4_src_strd = ps_proc->i4_src_strd;
|
||||
|
||||
/* ref ptrs and corresponding lagrange params */
|
||||
ps_me_ctxt->apu1_ref_buf_luma[0] = ps_proc->apu1_ref_buf_luma[0];
|
||||
|
|
|
|||
|
|
@ -1187,15 +1187,21 @@ IH264E_ERROR_T ih264e_init_proc_ctxt(process_ctxt_t *ps_proc)
|
|||
|
||||
/* init buffer pointers */
|
||||
convert_uv_only = 1;
|
||||
if (u4_pad_bottom_sz && (ps_proc->i4_mb_y == ps_proc->i4_ht_mbs - 1))
|
||||
if ((u4_pad_bottom_sz && (ps_proc->i4_mb_y == ps_proc->i4_ht_mbs - 1)) ||
|
||||
ps_codec->s_cfg.e_inp_color_fmt == IV_YUV_422ILE)
|
||||
{
|
||||
u2_num_rows = (UWORD16) MB_SIZE - u4_pad_bottom_sz;
|
||||
if (ps_proc->i4_mb_y == ps_proc->i4_ht_mbs - 1)
|
||||
u2_num_rows = (UWORD16) MB_SIZE - u4_pad_bottom_sz;
|
||||
ps_proc->pu1_src_buf_luma_base = ps_codec->pu1_y_csc_buf_base;
|
||||
i4_src_strd = ps_proc->i4_src_strd = ps_codec->s_cfg.u4_max_wd;
|
||||
ps_proc->pu1_src_buf_luma = ps_proc->pu1_src_buf_luma_base + (i4_mb_x * MB_SIZE) + ps_codec->s_cfg.u4_max_wd * (i4_mb_y * MB_SIZE);
|
||||
convert_uv_only = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
i4_src_strd = ps_proc->i4_src_strd = ps_proc->s_inp_buf.s_raw_buf.au4_strd[0];
|
||||
ps_proc->pu1_src_buf_luma = ps_proc->pu1_src_buf_luma_base + (i4_mb_x * MB_SIZE) + i4_src_strd * (i4_mb_y * MB_SIZE);
|
||||
}
|
||||
|
||||
|
||||
if (ps_codec->s_cfg.e_inp_color_fmt == IV_YUV_422ILE ||
|
||||
|
|
@ -1207,9 +1213,11 @@ IH264E_ERROR_T ih264e_init_proc_ctxt(process_ctxt_t *ps_proc)
|
|||
ps_proc->pu1_src_buf_chroma_base = ps_codec->pu1_uv_csc_buf_base;
|
||||
|
||||
ps_proc->pu1_src_buf_chroma = ps_proc->pu1_src_buf_chroma_base + (i4_mb_x * MB_SIZE) + ps_codec->s_cfg.u4_max_wd * (i4_mb_y * BLK8x8SIZE);
|
||||
i4_src_chroma_strd = ps_proc->i4_src_chroma_strd = ps_codec->s_cfg.u4_max_wd;
|
||||
}
|
||||
else
|
||||
{
|
||||
i4_src_chroma_strd = ps_proc->i4_src_chroma_strd = ps_proc->s_inp_buf.s_raw_buf.au4_strd[1];
|
||||
ps_proc->pu1_src_buf_chroma = ps_proc->pu1_src_buf_chroma_base + (i4_mb_x * MB_SIZE) + i4_src_chroma_strd * (i4_mb_y * BLK8x8SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue