From e5b18cd5367b3986b04af293c07f084c41ce729b Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Wed, 4 Mar 2015 13:33:38 +0200 Subject: [PATCH] Inline cu_info_intra and cu_info_inter into cu_info_t. --- src/cu.h | 42 +++++++++++++++--------------------------- src/search.c | 2 +- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/cu.h b/src/cu.h index 5c8f0e67..21a4d2a5 100644 --- a/src/cu.h +++ b/src/cu.h @@ -42,31 +42,6 @@ typedef struct { int y; } vector2d_t; -/** - * \brief Struct for CU intra info - */ -typedef struct -{ - int8_t mode; - int8_t mode_chroma; - int8_t tr_skip; //!< \brief transform skip flag -} cu_info_intra; - -/** - * \brief Struct for CU inter info - */ -typedef struct -{ - double cost; - uint32_t bitcost; - int16_t mv[2]; - int16_t mvd[2]; - uint8_t mv_cand; // \brief selected MV candidate - uint8_t mv_ref; // \brief Index of the encoder_control.ref array. - uint8_t mv_dir; // \brief Probably describes if mv_ref is forward, backward or both. Might not be needed? - int8_t mode; -} cu_info_inter; - typedef struct { uint8_t y; @@ -89,8 +64,21 @@ typedef struct int8_t merge_idx; //!< \brief merge index cu_cbf_t cbf; - cu_info_intra intra[4]; - cu_info_inter inter; + struct { + int8_t mode; + int8_t mode_chroma; + int8_t tr_skip; //!< \brief transform skip flag + } intra[4]; + struct { + double cost; + uint32_t bitcost; + int16_t mv[2]; + int16_t mvd[2]; + uint8_t mv_cand; // \brief selected MV candidate + uint8_t mv_ref; // \brief Index of the encoder_control.ref array. + uint8_t mv_dir; // \brief Probably describes if mv_ref is forward, backward or both. Might not be needed? + int8_t mode; + } inter; } cu_info_t; #define CHECKPOINT_CU(prefix_str, cu) CHECKPOINT(prefix_str " type=%d depth=%d part_size=%d tr_depth=%d coded=%d " \ diff --git a/src/search.c b/src/search.c index 4fa243e5..ccffa6a4 100644 --- a/src/search.c +++ b/src/search.c @@ -891,7 +891,7 @@ static void lcu_set_inter(lcu_t *lcu, int x_px, int y_px, int depth, cu_info_t * cu->tr_depth = cur_cu->tr_depth; cu->merged = cur_cu->merged; cu->skipped = cur_cu->skipped; - memcpy(&cu->inter, &cur_cu->inter, sizeof(cu_info_inter)); + memcpy(&cu->inter, &cur_cu->inter, sizeof(cur_cu->inter)); } } }