Skip to content
Merged

444 #63

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
2 changes: 2 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ cc_library_static {
"common/ihevc_chroma_iquant_itrans_recon.c",
"common/ihevc_chroma_iquant_recon.c",
"common/ihevc_chroma_itrans_recon.c",
"common/ihevc_chroma_itrans_recon_32x32.c",
"common/ihevc_chroma_itrans_recon_16x16.c",
"common/ihevc_chroma_itrans_recon_8x8.c",
"common/ihevc_chroma_recon.c",
Expand Down Expand Up @@ -461,6 +462,7 @@ cc_library_static {
"common/ihevc_cabac_tables.c",
"common/ihevc_chroma_intra_pred_filters.c",
"common/ihevc_chroma_itrans_recon.c",
"common/ihevc_chroma_itrans_recon_32x32.c",
"common/ihevc_chroma_itrans_recon_16x16.c",
"common/ihevc_chroma_itrans_recon_8x8.c",
"common/ihevc_common_tables.c",
Expand Down
1 change: 1 addition & 0 deletions common/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ list(
"${HEVC_ROOT}/common/ihevc_chroma_iquant_itrans_recon.c"
"${HEVC_ROOT}/common/ihevc_chroma_recon.c"
"${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_16x16.c"
"${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_32x32.c"
"${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_8x8.c"
"${HEVC_ROOT}/common/ihevc_buf_mgr.c"
"${HEVC_ROOT}/common/ihevc_disp_mgr.c"
Expand Down
1,250 changes: 626 additions & 624 deletions common/ihevc_cabac_tables.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/ihevc_cabac_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef enum
IHEVC_CAB_COEFFY_PREFIX = IHEVC_CAB_COEFFX_PREFIX + 18,
IHEVC_CAB_CODED_SUBLK_IDX = IHEVC_CAB_COEFFY_PREFIX + 18,
IHEVC_CAB_COEFF_FLAG = IHEVC_CAB_CODED_SUBLK_IDX + 4,
IHEVC_CAB_COEFABS_GRTR1_FLAG = IHEVC_CAB_COEFF_FLAG + 42,
IHEVC_CAB_COEFABS_GRTR1_FLAG = IHEVC_CAB_COEFF_FLAG + 44,
IHEVC_CAB_COEFABS_GRTR2_FLAG = IHEVC_CAB_COEFABS_GRTR1_FLAG + 24,
IHEVC_CAB_CTXT_END = IHEVC_CAB_COEFABS_GRTR2_FLAG + 6
}IHEVC_CABAC_CTXT_OFFSETS;
Expand Down
7 changes: 7 additions & 0 deletions common/ihevc_chroma_intra_pred.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ typedef void ihevc_intra_pred_chroma_ref_substitution_ft(UWORD8 *pu1_top_left,
UWORD8 *pu1_dst,
WORD32 dst_strd);

typedef void ihevc_intra_pred_chroma_ref_filtering_ft(UWORD8 *pu1_src,
WORD32 nt,
UWORD8 *pu1_dst,
WORD32 mode,
WORD32 intra_smoothing_flags);

typedef void ihevc_hbd_intra_pred_chroma_planar_ft(
UWORD16 *pu2_ref,
WORD32 src_strd,
Expand Down Expand Up @@ -240,6 +246,7 @@ ihevc_intra_pred_chroma_mode_11_to_17_ft ihevc_intra_pred_chroma_mode_11_to_17;
ihevc_intra_pred_chroma_mode_19_to_25_ft ihevc_intra_pred_chroma_mode_19_to_25;
ihevc_intra_pred_chroma_mode_27_to_33_ft ihevc_intra_pred_chroma_mode_27_to_33;
ihevc_intra_pred_chroma_ref_substitution_ft ihevc_intra_pred_chroma_ref_substitution;
ihevc_intra_pred_chroma_ref_filtering_ft ihevc_intra_pred_chroma_ref_filtering;

ihevc_hbd_intra_pred_chroma_planar_ft ihevc_hbd_intra_pred_chroma_planar;
ihevc_hbd_intra_pred_chroma_dc_ft ihevc_hbd_intra_pred_chroma_dc;
Expand Down
93 changes: 93 additions & 0 deletions common/ihevc_chroma_intra_pred_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,99 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left,
}


/**
*******************************************************************************
*
* @brief
* Intra prediction interpolation filter for chroma ref_filtering (4:4:4)
*
*
* @par Description:
* Reference DC filtering for neighboring chroma samples dependent on TU size and
* mode Refer to section 8.4.4.2.3 in the standard
*
* @param[in] pu1_src
* UWORD8 pointer to the source
*
* @param[out] pu1_dst
* UWORD8 pointer to the destination
*
* @param[in] nt
* integer Transform Block size
*
* @param[in] mode
* integer intraprediction mode
*
* @param[in] strong_intra_smoothing_enable_flag
* integer containing intra_smoothing_disabled_flag and strong_smoothing_enable_flag
*
* @returns
*
* @remarks
* None
*
*******************************************************************************
*/

void ihevc_intra_pred_chroma_ref_filtering(UWORD8 *pu1_src,
WORD32 nt,
UWORD8 *pu1_dst,
WORD32 mode,
WORD32 intra_smoothing_flag)
{
WORD32 filter_flag;
WORD32 i; /* Generic indexing variable */
WORD32 four_nt = 4 * nt;
UWORD8 au1_flt[((4 * MAX_CU_SIZE) + 1) * 2];
WORD32 intra_smoothing_disabled_flag = (intra_smoothing_flag >> 3) & 0x1;
WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flag & 0x1;
UNUSED(strong_intra_smoothing_enable_flag);

if(intra_smoothing_disabled_flag)
{
if(pu1_src == pu1_dst) return;
for(i = 0; i < (2 * (four_nt + 1)); i += 2)
{
pu1_dst[i] = pu1_src[i];
pu1_dst[i + 1] = pu1_src[i + 1];
}
return;
}

filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2));
if(0 == filter_flag)
{
if(pu1_src == pu1_dst) return;
for(i = 0; i < (2 * (four_nt + 1)); i += 2)
{
pu1_dst[i] = pu1_src[i];
pu1_dst[i + 1] = pu1_src[i + 1];
}
}
else
{
/* Extremities Untouched*/
au1_flt[0] = pu1_src[0];
au1_flt[1] = pu1_src[1];
au1_flt[four_nt * 2] = pu1_src[four_nt * 2];
au1_flt[(four_nt * 2) + 1] = pu1_src[(four_nt * 2) + 1];

for(i = 2; i < four_nt * 2; i += 2)
{
au1_flt[i] = (pu1_src[i - 2] + 2 * pu1_src[i] + pu1_src[i + 2] + 2) >> 2;
au1_flt[i + 1] = (pu1_src[i - 1] + 2 * pu1_src[i + 1] + pu1_src[i + 3] + 2) >> 2;
}

for(i = 0; i < (2 * (four_nt + 1)); i += 2)
{
pu1_dst[i] = au1_flt[i];
pu1_dst[i + 1] = au1_flt[i + 1];
}
}
}



/**
*******************************************************************************
*
Expand Down
10 changes: 10 additions & 0 deletions common/ihevc_chroma_itrans_recon.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,23 @@ typedef void ihevc_hbd_chroma_itrans_recon_16x16_ft(WORD16 *pi2_src,
WORD32 zero_cols,
WORD32 zero_rows,
UWORD8 bit_depth);
typedef void ihevc_chroma_itrans_recon_32x32_ft(WORD16 *pi2_src,
WORD16 *pi2_tmp,
UWORD8 *pu1_pred,
UWORD8 *pu1_dst,
WORD32 src_strd,
WORD32 pred_strd,
WORD32 dst_strd,
WORD32 zero_cols,
WORD32 zero_rows);

ihevc_chroma_itrans_recon_4x4_ft ihevc_chroma_itrans_recon_4x4;
ihevc_hbd_chroma_itrans_recon_4x4_ft ihevc_hbd_chroma_itrans_recon_4x4;
ihevc_chroma_itrans_recon_8x8_ft ihevc_chroma_itrans_recon_8x8;
ihevc_hbd_chroma_itrans_recon_8x8_ft ihevc_hbd_chroma_itrans_recon_8x8;
ihevc_chroma_itrans_recon_16x16_ft ihevc_chroma_itrans_recon_16x16;
ihevc_hbd_chroma_itrans_recon_16x16_ft ihevc_hbd_chroma_itrans_recon_16x16;
ihevc_chroma_itrans_recon_32x32_ft ihevc_chroma_itrans_recon_32x32;

/* A9 Q Function Declarations */
ihevc_chroma_itrans_recon_4x4_ft ihevc_chroma_itrans_recon_4x4_a9q;
Expand Down
Loading