Skip to content

Commit

Permalink
svcenc: Redundant code removed
Browse files Browse the repository at this point in the history
The following lines of code have been removed to improve coverage -
  [x] Functions -
      - isvc_interleaved_copy
      - isvc_16bit_interleaved_copy
      - isvc_16bit_interleaved_memset
      - isvc_iquant_itrans_recon_chroma_4x4_neon
      - isvc_iquant_itrans_recon_chroma_4x4_sse42
      - isvc_iquant_itrans_recon_4x4_dc_with_res_output_neon
      - isvc_iquant_itrans_recon_res_dc_4x4_sse42
      - isvc_iquant_itrans_recon_4x4_dc_with_res_accumulate_neon
      - isvc_iquant_itrans_recon_res_dc_with_res_acc_4x4_sse42
      - isvce_wait_for_thread
  [x] Function pointer initialisations for the functions above

Test: svc_enc_fuzzer
  • Loading branch information
AshwinNatesan-ittiam authored and harishdm committed Oct 27, 2023
1 parent 196f0db commit 51268b3
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 1,737 deletions.
452 changes: 0 additions & 452 deletions common/arm/svc/isvc_iquant_itrans_recon_neon.c

Large diffs are not rendered by default.

158 changes: 0 additions & 158 deletions common/svc/isvc_mem_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,164 +120,6 @@ void isvc_memset_2d(UWORD8 *pu1_dst, WORD32 i4_dst_stride, UWORD8 u1_val, WORD32
}
}

/**
*******************************************************************************
*
* @brief
* Function for copying to an interleaved destination
*
* @par Description:
* Copies the array of width 'wd' and height 'ht' from the location pointed
* by 'src' to the location pointed by 'dst'
*
* @param[in] pu1_src
* UWORD8 pointer to the source
*
* @param[out] pu1_dst
* UWORD8 pointer to the destination
*
* @param[in] src_strd
* integer source stride
*
* @param[in] dst_strd
* integer destination stride
*
* @param[in] ht
* integer height of the array
*
* @param[in] wd
* integer width of the array
*
* @returns
*
* @remarks
* The alternate elements of src will be copied to alternate locations in dsr
* Other locations are not touched
*
*******************************************************************************
*/
void isvc_interleaved_copy(UWORD8 *pu1_src, UWORD8 *pu1_dst, WORD32 src_strd, WORD32 dst_strd,
WORD32 ht, WORD32 wd)
{
WORD32 row, col;
wd *= 2;

for(row = 0; row < ht; row++)
{
for(col = 0; col < wd; col += 2)
{
pu1_dst[col] = pu1_src[col];
}

pu1_src += src_strd;
pu1_dst += dst_strd;
}
}

/**
*******************************************************************************
*
* @brief
* Function for copying to an interleaved destination
*
* @par Description:
* Copies the array of width 'wd' and height 'ht' from the location pointed
* by 'src' to the location pointed by 'dst'
*
* @param[in] pu1_src
* UWORD8 pointer to the source
*
* @param[out] pu1_dst
* UWORD8 pointer to the destination
*
* @param[in] src_strd
* integer source stride
*
* @param[in] dst_strd
* integer destination stride
*
* @param[in] ht
* integer height of the array
*
* @param[in] wd
* integer width of the array
*
* @returns
*
* @remarks
* The alternate elements of src will be copied to alternate locations in dsr
* Other locations are not touched
*
*******************************************************************************
*/
void isvc_16bit_interleaved_copy(WORD16 *pi2_src, WORD16 *pi2_dst, WORD32 src_strd, WORD32 dst_strd,
WORD32 ht, WORD32 wd)
{
WORD32 row, col;
wd *= 2;

for(row = 0; row < ht; row++)
{
for(col = 0; col < wd; col += 2)
{
pi2_dst[col] = pi2_src[col];
}

pi2_src += src_strd;
pi2_dst += dst_strd;
}
}

/**
*******************************************************************************
*
* @brief
* Function for memsetting to an interleaved destination
*
* @par Description:
* Memsets the array of width 'wd' and height 'ht' pointed by 'src'
*
* @param[in] pu1_src
* UWORD8 pointer to the source
*
* @param[in] src_strd
* integer source stride
*
* @param[in] value
* Value to set
*
* @param[in] ht
* integer height of the array
*
* @param[in] wd
* integer width of the array
*
* @returns
*
* @remarks
* The alternate elements of src will be copied to alternate locations in dsr
* Other locations are not touched
*
*******************************************************************************
*/
void isvc_16bit_interleaved_memset(WORD16 *pi2_src, WORD32 i4_src_strd, WORD16 i2_value,
WORD32 i4_wd, WORD32 i4_ht)
{
WORD32 row, col;

i4_wd *= 2;

for(row = 0; row < i4_ht; row++)
{
for(col = 0; col < i4_wd; col += 2)
{
pi2_src[col] = i2_value;
}

pi2_src += i4_src_strd;
}
}

/**
*******************************************************************************
*
Expand Down
8 changes: 0 additions & 8 deletions common/svc/isvc_mem_fns.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,24 @@ typedef UWORD8 FT_NONZERO_CHECKER(UWORD8 *pu1_data, WORD32 i4_data_strd, UWORD32
UWORD32 u4_ht);

/* C function declarations */
extern FT_MEMCPY ih264_memcpy;
extern FT_MEMCPY ih264_memcpy_mul_8;
extern FT_MEMSET ih264_memset;
extern FT_MEMSET ih264_memset_mul_8;
extern FT_MEMSET_16BIT ih264_memset_16bit;
extern FT_MEMSET_16BIT ih264_memset_16bit_mul_8;
extern FT_COPY_2D isvc_copy_2d;
extern FT_MEMSET_2D isvc_memset_2d;
extern FT_16BIT_INTERLEAVED_COPY isvc_16bit_interleaved_copy;
extern FT_16BIT_INTERLEAVED_MEMSET isvc_16bit_interleaved_memset;
extern FT_NONZERO_CHECKER isvc_is_nonzero_blk;
extern FT_MEM_ALLOC isvc_memory_alloc;
extern FT_MEM_FREE isvc_memory_free;

/* A9 Q function declarations */
extern FT_MEMCPY isvc_memcpy_a9q;
extern FT_MEMCPY ih264_memcpy_mul_8_a9q;
extern FT_MEMSET ih264_memset_a9q;
extern FT_MEMSET ih264_memset_mul_8_a9q;
extern FT_MEMSET_16BIT ih264_memset_16bit_a9q;
extern FT_MEMSET_16BIT ih264_memset_16bit_mul_8_a9q;

/* AV8 function declarations */
extern FT_MEMCPY ih264_memcpy_av8;
extern FT_MEMCPY ih264_memcpy_mul_8_av8;
extern FT_MEMSET ih264_memset_av8;
extern FT_MEMSET ih264_memset_mul_8_av8;
extern FT_MEMSET_16BIT ih264_memset_16bit_av8;
extern FT_MEMSET_16BIT ih264_memset_16bit_mul_8_av8;
Expand Down
8 changes: 0 additions & 8 deletions common/svc/isvc_trans_quant_itrans_iquant.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,11 @@ extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_4x4_with_res_acc_sse42;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_chroma_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_chroma_4x4_with_res_acc_sse42;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_dc_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_dc_4x4_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_dc_with_res_acc_4x4_sse42;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_dc_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_chroma_4x4_dc_sse42;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_res_chroma_4x4_dc_with_res_acc_sse42;

Expand All @@ -217,15 +213,11 @@ extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_with_res_output_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_with_res_accumulate_neon;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_with_res_output_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_with_res_accumulate_neon;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_dc_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_dc_with_res_output_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_4x4_dc_with_res_accumulate_neon;

extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_dc_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_dc_with_res_output_neon;
extern FT_IQ_IT_RECON isvc_iquant_itrans_recon_chroma_4x4_dc_with_res_accumulate_neon;

Expand Down
Loading

0 comments on commit 51268b3

Please sign in to comment.