Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions src_base/xevd_itdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ void xevd_itx_pb2b(void *src, void *dst, int shift, int line, int step)
\
if(step == 0)\
{\
*((type_dst *)dst + j * 2 + 0) = ITX_CLIP_32((xevd_tbl_tm2[0][0] * E + add) >> shift); \
*((type_dst *)dst + j * 2 + 1) = ITX_CLIP_32((xevd_tbl_tm2[1][0] * O + add) >> shift); \
/* ETM7.8 Reference Modification */\
*((type_dst *)dst + j * 2 + 0) = (s32)(xevd_tbl_tm2[0][0] * E); \
*((type_dst *)dst + j * 2 + 1) = (s32)(xevd_tbl_tm2[1][0] * O); \
}\
else\
{\
Expand Down Expand Up @@ -96,10 +97,11 @@ void xevd_itx_pb4b(void *src, void *dst, int shift, int line, int step)
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */\
if (step == 0)\
{\
*((type_dst * )dst + j * 4 + 0) = ITX_CLIP_32((E[0] + O[0] + add) >> shift);\
*((type_dst * )dst + j * 4 + 1) = ITX_CLIP_32((E[1] + O[1] + add) >> shift);\
*((type_dst * )dst + j * 4 + 2) = ITX_CLIP_32((E[1] - O[1] + add) >> shift);\
*((type_dst * )dst + j * 4 + 3) = ITX_CLIP_32((E[0] - O[0] + add) >> shift);\
/* ETM7.8 Reference Modification */\
*((type_dst * )dst + j * 4 + 0) = (s32)(E[0] + O[0]);\
*((type_dst * )dst + j * 4 + 1) = (s32)(E[1] + O[1]);\
*((type_dst * )dst + j * 4 + 2) = (s32)(E[1] - O[1]);\
*((type_dst * )dst + j * 4 + 3) = (s32)(E[0] - O[0]);\
}\
else\
{\
Expand Down Expand Up @@ -153,8 +155,9 @@ void xevd_itx_pb8b(void *src, void *dst, int shift, int line, int step)
{\
for (k = 0; k < 4; k++)\
{\
*((type_dst * )dst + j * 8 + k ) = ITX_CLIP_32((E[k] + O[k] + add) >> shift);\
*((type_dst * )dst + j * 8 + k + 4) = ITX_CLIP_32((E[3 - k] - O[3 - k] + add) >> shift);\
/* ETM7.8 Reference Modification */\
*((type_dst * )dst + j * 8 + k ) = (s32)(E[k] + O[k]);\
*((type_dst * )dst + j * 8 + k + 4) = (s32)(E[3 - k] - O[3 - k]);\
}\
}\
else\
Expand Down Expand Up @@ -222,8 +225,9 @@ void xevd_itx_pb16b(void *src, void *dst, int shift, int line, int step)
{\
for (k = 0; k < 8; k++)\
{\
*((type_dst * )dst + j * 16 + k ) = ITX_CLIP_32((E[k] + O[k] + add) >> shift); \
*((type_dst * )dst + j * 16 + k + 8) = ITX_CLIP_32((E[7 - k] - O[7 - k] + add) >> shift); \
/* ETM7.8 Reference Modification */\
*((type_dst * )dst + j * 16 + k ) = (s32)(E[k] + O[k]); \
*((type_dst * )dst + j * 16 + k + 8) = (s32)(E[7 - k] - O[7 - k]); \
}\
}\
else\
Expand Down Expand Up @@ -320,8 +324,9 @@ void xevd_itx_pb32b(void *src, void *dst, int shift, int line, int step)
{\
for (k = 0; k < 16; k++)\
{\
*((type_dst * )dst + j * 32 + k ) = ITX_CLIP_32((E[k] + O[k] + add) >> shift);\
*((type_dst * )dst + j * 32 + k + 16) = ITX_CLIP_32((E[15 - k] - O[15 - k] + add) >> shift);\
/* ETM7.8 Reference Modification */\
*((type_dst * )dst + j * 32 + k ) = (s32)(E[k] + O[k]);\
*((type_dst * )dst + j * 32 + k + 16) = (s32)(E[15 - k] - O[15 - k]);\
}\
}\
else\
Expand Down Expand Up @@ -433,8 +438,9 @@ void xevd_itx_pb64b(void *src, void *dst, int shift, int line, int step)
{\
for (k = 0; k < 32; k++)\
{\
*((type_dst * )dst + k ) = ITX_CLIP_32((E[k] + O[k] + add) >> shift);\
*((type_dst * )dst + k + 32) = ITX_CLIP_32((E[31 - k] - O[31 - k] + add) >> shift);\
/* ETM7.8 Reference Modification */\
*((type_dst * )dst + k ) = (s32)(E[k] + O[k]);\
*((type_dst * )dst + k + 32) = (s32)(E[31 - k] - O[31 - k]);\
}\
}\
else\
Expand Down
10 changes: 6 additions & 4 deletions src_base/xevd_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,9 @@ u16 xevd_get_avail_intra(int x_scu, int y_scu, int w_scu, int h_scu, int scup, i
{
SET_AVAIL(avail, AVAIL_LE);

if (y_scu + scuh + scuw - 1 < h_scu && MCU_GET_COD(map_scu[scup + (w_scu * (scuw + scuh)) - w_scu - 1]) &&
(map_tidx[curr_scup] == map_tidx[scup + (w_scu * (scuw + scuh)) - w_scu - 1]))
//ETM8.0 Reference Modification
if(y_scu + scuh < h_scu && MCU_GET_COD(map_scu[scup + (w_scu * scuh) - 1]) &&
(map_tidx[curr_scup] == map_tidx[scup + (w_scu * scuh) - 1]))
{
SET_AVAIL(avail, AVAIL_LO_LE);
}
Expand Down Expand Up @@ -727,8 +728,9 @@ u16 xevd_get_avail_intra(int x_scu, int y_scu, int w_scu, int h_scu, int scup, i
{
SET_AVAIL(avail, AVAIL_RI);

if (y_scu + scuh + scuw - 1 < h_scu && MCU_GET_COD(map_scu[scup + (w_scu * (scuw + scuh - 1)) + scuw]) &&
(map_tidx[curr_scup] == map_tidx[scup + (w_scu * (scuw + scuh - 1)) + scuw]))
// ETM8.0 Reference Modification
if(y_scu + scuh < h_scu && MCU_GET_COD(map_scu[scup + (w_scu * scuh) + scuw]) &&
(map_tidx[curr_scup] == map_tidx[scup + (w_scu * scuh) + scuw]))
{
SET_AVAIL(avail, AVAIL_LO_RI);
}
Expand Down
8 changes: 6 additions & 2 deletions src_main/xevdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2434,12 +2434,16 @@ int xevd_tile_eco(void * arg)
{
xevd_threadsafe_assign(&ctx->sync_row[core->y_lcu], THREAD_TERMINATED);
xevd_assert_gv(xevd_eco_tile_end_flag(bs, sbac) == 1, ret, XEVD_ERR, ERR);
/*Decode zero bits after processing of last tile in slice*/
if (core->tile_num == ctx->num_tiles_in_slice - 1)
/*Decode zero bits at end of the picture is not required, hence commented out,
ETM 8.0 also doesnot have the support to decode zero bits at end of the frame
If Decode of zero bits need to be added, the below code to be enabled */
#if 0
if (core->tile_num == ctx->tile_cnt - 1)
{
ret = xevd_eco_cabac_zero_word(bs);
xevd_assert_g(XEVD_SUCCEEDED(ret), ERR);
}
#endif
break;
}
core->x_lcu++;
Expand Down
3 changes: 2 additions & 1 deletion src_main/xevdm_df.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ static const u8 compare_mvs(const int mv0[2], const int mv1[2])
return (XEVD_ABS(mv0[0] - mv1[0]) < 4) && (XEVD_ABS(mv0[1] - mv1[1]) < 4);
}

static const u8 get_index(const u8 qp, const u8 offset)
// ETM8.0 Reference Modification
static const u8 get_index(const s8 qp, const s8 offset)
{
return XEVD_CLIP3(0, MAX_QP, qp + offset);
}
Expand Down
12 changes: 8 additions & 4 deletions src_main/xevdm_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,8 +2235,10 @@ void xevdm_affine_mc_l(int x, int y, int pic_w, int pic_h, int cuw, int cuh, s16
{
for (w = 0; w < cuw; w += sub_w)
{
mv_scale_tmp_hor = (mv_scale_hor + dmv_hor_x * half_w + dmv_ver_x * half_h);
mv_scale_tmp_ver = (mv_scale_ver + dmv_hor_y * half_w + dmv_ver_y * half_h);
//ETM8.0 Reference Modification
mv_scale_tmp_hor = (mv_scale_hor + dmv_hor_x * (half_w + w) + dmv_ver_x * (half_h + h));
mv_scale_tmp_ver = (mv_scale_ver + dmv_hor_y * (half_w + w) + dmv_ver_y * (half_h + h));

xevdm_mv_rounding_s32(mv_scale_tmp_hor, mv_scale_tmp_ver, &mv_scale_tmp_hor, &mv_scale_tmp_ver, shift, 0);
mv_scale_tmp_hor = XEVD_CLIP3(-(1 << 17), (1 << 17) - 1, mv_scale_tmp_hor);
mv_scale_tmp_ver = XEVD_CLIP3(-(1 << 17), (1 << 17) - 1, mv_scale_tmp_ver);
Expand Down Expand Up @@ -2356,8 +2358,10 @@ void xevdm_affine_mc_lc(int x, int y, int pic_w, int pic_h, int cuw, int cuh, s1
{
for (w = 0; w < cuw; w += sub_w)
{
mv_scale_tmp_hor = (mv_scale_hor + dmv_hor_x * half_w + dmv_ver_x * half_h);
mv_scale_tmp_ver = (mv_scale_ver + dmv_hor_y * half_w + dmv_ver_y * half_h);
// ETM8.0 Reference Modification
mv_scale_tmp_hor = (mv_scale_hor + dmv_hor_x * (half_w + w) + dmv_ver_x * (half_h + h));
mv_scale_tmp_ver = (mv_scale_ver + dmv_hor_y * (half_w + w) + dmv_ver_y * (half_h + h));

xevdm_mv_rounding_s32(mv_scale_tmp_hor, mv_scale_tmp_ver, &mv_scale_tmp_hor, &mv_scale_tmp_ver, shift, 0);
mv_scale_tmp_hor = XEVD_CLIP3(-(1 << 17), (1 << 17) - 1, mv_scale_tmp_hor);
mv_scale_tmp_ver = XEVD_CLIP3(-(1 << 17), (1 << 17) - 1, mv_scale_tmp_ver);
Expand Down