aboutsummaryrefslogtreecommitdiff
path: root/encoder/ih264e_me.h
diff options
context:
space:
mode:
authorRam Mohan M <ram.mohan@ittiam.com>2023-09-30 01:19:52 +0530
committerram-mohan <ram-mohan@users.noreply.github.com>2023-10-01 01:37:17 +0530
commit50fd862b8dedcd3dcae211e283115b01215f5171 (patch)
tree718c7b7761d0b971899e52e9cc8958da3b7e89da /encoder/ih264e_me.h
parentf0b559e4dc5c9f1ce0c1e5c6d9ee3e06321dfef7 (diff)
downloadlibavc-50fd862b8dedcd3dcae211e283115b01215f5171.tar.gz
libavcenc: Remove duplicate code and improve readability
This commit does not introduce any new functionality w.r.t previous commit. But it fixes few things. They are listed below: 1. Guard Bands in header files are fixed 2. Header files contains function definition comments. These are same as in source file. Maintaining same comment at two locations is unnecessary. These are removed. 3. Improved consistency and code indentation 4. Removed comments that dont align with implementation 5. Grouped headers of a workspace together
Diffstat (limited to 'encoder/ih264e_me.h')
-rw-r--r--encoder/ih264e_me.h264
1 files changed, 6 insertions, 258 deletions
diff --git a/encoder/ih264e_me.h b/encoder/ih264e_me.h
index 2266e5a..8af8c8a 100644
--- a/encoder/ih264e_me.h
+++ b/encoder/ih264e_me.h
@@ -24,7 +24,7 @@
* ih264e_me.h
*
* @brief
- * Contains declarations of global variables for H264 encoder
+ * Contains declarations of h264 me
*
* @author
* ittiam
@@ -34,8 +34,9 @@
*******************************************************************************
*/
-#ifndef IH264E_ME_H_
-#define IH264E_ME_H_
+#ifndef _IH264E_ME_H_
+#define _IH264E_ME_H_
+
/*****************************************************************************/
/* Constant Macros */
@@ -66,7 +67,6 @@
* in to result. This is used for mv prediction
******************************************************************************
*/
-
#define MEDIAN(a, b, c, result) if (a > b){\
if (b > c)\
result = b;\
@@ -89,284 +89,32 @@
}
/*****************************************************************************/
-/* Extern Function Declarations */
+/* Function Declarations */
/*****************************************************************************/
-/**
- *******************************************************************************
- *
- * @brief
- * This function populates the length of the codewords for motion vectors in the
- * range (-search range, search range) in pixels
- *
- * @param[in] ps_me
- * Pointer to me ctxt
- *
- * @param[out] pu1_mv_bits
- * length of the codeword for all mv's
- *
- * @remarks The length of the code words are derived from signed exponential
- * goloumb codes.
- *
- *******************************************************************************
- */
void ih264e_init_mv_bits(me_ctxt_t *ps_me);
-/**
- *******************************************************************************
- *
- * @brief The function computes the parameters for a P skip MB
- *
- * @par Description:
- * The function computes the parameters for a P skip MB
- *
- * @param[in] ps_proc
- * Process context
- *
- * @param[in] u4_for_me
- * Flag to indicate the purpose of computing skip
- *
- * @param[out] ps_pred_mv
- * Flag to indicate the current active refernce list
- *
- * @returns
- * 1) Updates skip MV in proc
- * 2) Returns if the current MB can be coded as skip or not
- *
- * @remarks The code implements the logic as described in sec 8.4.1.1 in H264
- * specification.
- *
- *******************************************************************************
-*/
ih264e_skip_params_ft ih264e_find_pskip_params;
-/**
- *******************************************************************************
- *
- * @brief The function computes the parameters for a P skip MB
- *
- * @par Description:
- * The function computes the parameters for a P skip MB
- *
- * @param[in] ps_proc
- * Process context
- *
- * @param[in] u4_for_me
- * Flag to indicate the purpose of computing skip
- *
- * @param[out] ps_pred_mv
- * Flag to indicate the current active refernce list
- *
- * @returns
- * 1) Updates skip MV in proc
- * 2) Returns if the current MB can be coded as skip or not
- *
- * @remarks The code implements the logic as described in sec 8.4.1.1 in H264
- * specification.
- *
- *******************************************************************************
-*/
ih264e_skip_params_ft ih264e_find_pskip_params_me;
-/**
- *******************************************************************************
- *
- * @brief The function computes the parameters for a B skip MB
- *
- * @par Description:
- * The function computes the parameters for a B skip MB
- *
- * @param[in] ps_proc
- * Process context
- *
- * @param[in] u4_for_me
- * Flag to indicate the purpose of computing skip
- *
- * @param[out] ps_pred_mv
- * Flag to indicate the current active refernce list
- *
- * @returns
- * 1) Updates skip MV in proc
- * 2) Returns if the current MB can be coded as skip or not
- *
- * @remarks The code implements the logic as described in sec 8.4.1.1 in H264
- * specification.
- *
- *******************************************************************************
-*/
ih264e_skip_params_ft ih264e_find_bskip_params;
-/**
- *******************************************************************************
- *
- * @brief The function computes the parameters for a B skip MB
- *
- * @par Description:
- * The function computes the parameters for a B skip MB
- *
- * @param[in] ps_proc
- * Process context
- *
- * @param[in] u4_for_me
- * Flag to indicate the purpose of computing skip
- *
- * @param[out] ps_pred_mv
- * Flag to indicate the current active refernce list
- *
- * @returns
- * 1) Updates skip MV in proc
- * 2) The type of SKIP [L0/L1/BI]
- *
- * @remarks
- *******************************************************************************
-*/
ih264e_skip_params_ft ih264e_find_bskip_params_me;
-/**
- *******************************************************************************
- *
- * @brief motion vector predictor
- *
- * @par Description:
- * The routine calculates the motion vector predictor for a given block,
- * given the candidate MV predictors.
- *
- * @param[in] ps_left_mb_pu
- * pointer to left mb motion vector info
- *
- * @param[in] ps_top_row_pu
- * pointer to top & top right mb motion vector info
- *
- * @param[out] ps_pred_mv
- * pointer to candidate predictors for the current block
- *
- * @returns The x & y components of the MV predictor.
- *
- * @remarks The code implements the logic as described in sec 8.4.1.3 in H264
- * specification.
- * Assumptions : 1. Assumes Only partition of size 16x16
- *
- *******************************************************************************
- */
void ih264e_get_mv_predictor(enc_pu_t *ps_left_mb_pu, enc_pu_t *ps_top_row_pu,
enc_pu_mv_t *ps_pred_mv, WORD32 i4_ref_list);
-/**
- *******************************************************************************
- *
- * @brief This fucntion evalues ME for 2 reference lists
- *
- * @par Description:
- * It evaluates skip, full-pel an half-pel and assigns the correct MV in proc
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns none
- *
- * @remarks none
- *
- *******************************************************************************
- */
ih264e_compute_me_ft ih264e_compute_me_multi_reflist;
-/**
- *******************************************************************************
- *
- * @brief This fucntion evalues ME for single reflist [Pred L0]
- *
- * @par Description:
- * It evaluates skip, full-pel an half-pel and assigns the correct MV in proc
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns none
- *
- * @remarks none
- *
- *******************************************************************************
- */
ih264e_compute_me_ft ih264e_compute_me_single_reflist;
-/**
- *******************************************************************************
- *
- * @brief This function initializes me ctxt
- *
- * @par Description:
- * Before dispatching the current job to me thread, the me context associated
- * with the job is initialized.
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns none
- *
- * @remarks none
- *
- *******************************************************************************
- */
void ih264e_init_me(process_ctxt_t *ps_proc);
-/**
- *******************************************************************************
- *
- * @brief This function performs motion estimation for the current NMB
- *
- * @par Description:
- * Intializes input and output pointers required by the function ih264e_compute_me
- * and calls the function ih264e_compute_me in a loop to process NMBs.
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns
- *
- * @remarks none
- *
- *******************************************************************************
- */
void ih264e_compute_me_nmb(process_ctxt_t *ps_proc, UWORD32 u4_nmb_count);
-/**
- *******************************************************************************
- *
- * @brief This function performs MV prediction
- *
- * @par Description:
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns none
- *
- * @remarks none
- * This function will update the MB availability since intra inter decision
- * should be done before the call
- *
- *******************************************************************************
- */
void ih264e_mv_pred(process_ctxt_t *ps_proc, WORD32 i4_reflist);
-/**
- *******************************************************************************
- *
- * @brief This function approximates Pred. MV
- *
- * @par Description:
- *
- * @param[in] ps_proc
- * Process context corresponding to the job
- *
- * @returns none
- *
- * @remarks none
- * Motion estimation happens at nmb level. For cost calculations, mv is appro
- * ximated using this function
- *
- *******************************************************************************
- */
void ih264e_mv_pred_me(process_ctxt_t *ps_proc, WORD32 i4_ref_list);
-#endif /* IH264E_ME_H_ */
+#endif /* _IH264E_ME_H_ */