From ff976e2afc0191a13b2ec622417a136cd89480d6 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Mon, 5 Oct 2015 06:18:20 +0300 Subject: [PATCH] Arrange parameters in intra fancily --- src/intra.c | 39 ++++++++++++++++++++++++++------------- src/intra.h | 43 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 65 insertions(+), 17 deletions(-) diff --git a/src/intra.c b/src/intra.c index df7541c0..18c3667d 100644 --- a/src/intra.c +++ b/src/intra.c @@ -33,16 +33,13 @@ #include "transform.h" -/** - * \brief Function for deriving intra luma predictions - * \param pic picture to use - * \param x_cu x CU position (smallest CU) - * \param y_cu y CU position (smallest CU) - * \param preds output buffer for 3 predictions - * \returns (predictions are found)?1:0 - */ -int8_t kvz_intra_get_dir_luma_predictor(const uint32_t x, const uint32_t y, int8_t* preds, - const cu_info_t * const cur_cu, const cu_info_t * const left_cu, const cu_info_t * const above_cu) +int8_t kvz_intra_get_dir_luma_predictor( + const uint32_t x, + const uint32_t y, + int8_t *preds, + const cu_info_t *const cur_cu, + const cu_info_t *const left_cu, + const cu_info_t *const above_cu) { int y_cu = y>>3; @@ -97,7 +94,9 @@ int8_t kvz_intra_get_dir_luma_predictor(const uint32_t x, const uint32_t y, int8 } -static void intra_filter_reference(int_fast8_t log2_width, kvz_intra_references *refs) +static void intra_filter_reference( + int_fast8_t log2_width, + kvz_intra_references *refs) { if (refs->filtered_initialized) { return; @@ -589,7 +588,14 @@ void kvz_intra_build_reference( } -void kvz_intra_recon_lcu_luma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu) +void kvz_intra_recon_lcu_luma( + encoder_state_t *const state, + int x, + int y, + int depth, + int8_t intra_mode, + cu_info_t *cur_cu, + lcu_t *lcu) { const vector2d_t lcu_px = { x & 0x3f, y & 0x3f }; if (cur_cu == NULL) { @@ -634,7 +640,14 @@ void kvz_intra_recon_lcu_luma(encoder_state_t * const state, int x, int y, int d } -void kvz_intra_recon_lcu_chroma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu) +void kvz_intra_recon_lcu_chroma( + encoder_state_t *const state, + int x, + int y, + int depth, + int8_t intra_mode, + cu_info_t *cur_cu, + lcu_t *lcu) { const vector2d_t lcu_px = { x & 0x3f, y & 0x3f }; const int8_t width = LCU_WIDTH >> depth; diff --git a/src/intra.h b/src/intra.h index fc1410ad..02750619 100644 --- a/src/intra.h +++ b/src/intra.h @@ -40,8 +40,22 @@ typedef struct bool filtered_initialized; } kvz_intra_references; -int8_t kvz_intra_get_dir_luma_predictor(uint32_t x, uint32_t y, int8_t* preds, - const cu_info_t* cur_cu, const cu_info_t* left_cu, const cu_info_t* above_cu); + +/** +* \brief Function for deriving intra luma predictions +* \param pic picture to use +* \param x_cu x CU position (smallest CU) +* \param y_cu y CU position (smallest CU) +* \param preds output buffer for 3 predictions +* \returns (predictions are found)?1:0 +*/ +int8_t kvz_intra_get_dir_luma_predictor( + const uint32_t x, + const uint32_t y, + int8_t *preds, + const cu_info_t *const cur_cu, + const cu_info_t *const left_cu, + const cu_info_t *const above_cu); /** * \brief Generage angular predictions. @@ -76,7 +90,28 @@ void kvz_intra_predict( color_t color, kvz_pixel *dst); -void kvz_intra_recon_lcu_luma(encoder_state_t *state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu); -void kvz_intra_recon_lcu_chroma(encoder_state_t *state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu); +/** + * \brief Do a full intra prediction cycle on a CU in lcu for luma. + */ +void kvz_intra_recon_lcu_luma( + encoder_state_t *const state, + int x, + int y, + int depth, + int8_t intra_mode, + cu_info_t *cur_cu, + lcu_t *lcu); + +/** +* \brief Do a full intra prediction cycle on a CU in lcu for chroma. +*/ +void kvz_intra_recon_lcu_chroma( + encoder_state_t *const state, + int x, + int y, + int depth, + int8_t intra_mode, + cu_info_t *cur_cu, + lcu_t *lcu); #endif