2013-09-19 07:35:34 +00:00
|
|
|
#ifndef INTRA_H_
|
|
|
|
#define INTRA_H_
|
2014-01-24 10:37:15 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
* This file is part of Kvazaar HEVC encoder.
|
2014-02-21 13:00:20 +00:00
|
|
|
*
|
2015-02-23 11:18:48 +00:00
|
|
|
* Copyright (C) 2013-2015 Tampere University of Technology and others (see
|
2014-01-24 10:37:15 +00:00
|
|
|
* COPYING file).
|
|
|
|
*
|
2015-02-23 11:18:48 +00:00
|
|
|
* Kvazaar is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License, or (at your
|
|
|
|
* option) any later version.
|
2014-01-24 10:37:15 +00:00
|
|
|
*
|
2015-02-23 11:18:48 +00:00
|
|
|
* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
|
* more details.
|
2014-01-24 10:37:15 +00:00
|
|
|
*
|
2015-02-23 11:18:48 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
|
2014-01-24 10:37:15 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-12-17 11:42:57 +00:00
|
|
|
/**
|
|
|
|
* \ingroup Reconstruction
|
|
|
|
* \file
|
|
|
|
* Intra prediction.
|
|
|
|
*/
|
2012-06-11 15:43:29 +00:00
|
|
|
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "cu.h"
|
|
|
|
#include "encoderstate.h"
|
2016-03-30 09:41:37 +00:00
|
|
|
#include "global.h" // IWYU pragma: keep
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "kvazaar.h"
|
2013-09-18 09:16:03 +00:00
|
|
|
|
|
|
|
|
2015-10-03 00:36:58 +00:00
|
|
|
typedef struct {
|
|
|
|
kvz_pixel left[2 * 32 + 1];
|
|
|
|
kvz_pixel top[2 * 32 + 1];
|
|
|
|
} kvz_intra_ref;
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
kvz_intra_ref ref;
|
|
|
|
kvz_intra_ref filtered_ref;
|
|
|
|
bool filtered_initialized;
|
|
|
|
} kvz_intra_references;
|
|
|
|
|
2015-10-05 03:18:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Function for deriving intra luma predictions
|
2016-01-15 08:51:40 +00:00
|
|
|
* \param x x-coordinate of the PU in pixels
|
|
|
|
* \param y y-coordinate of the PU in pixels
|
|
|
|
* \param preds output buffer for 3 predictions
|
|
|
|
* \param cur_pu PU to check
|
|
|
|
* \param left_pu PU to the left of cur_pu
|
|
|
|
* \param above_pu PU above cur_pu
|
|
|
|
* \returns 1 if predictions are found, otherwise 0
|
2015-10-05 03:18:20 +00:00
|
|
|
*/
|
|
|
|
int8_t kvz_intra_get_dir_luma_predictor(
|
|
|
|
const uint32_t x,
|
|
|
|
const uint32_t y,
|
|
|
|
int8_t *preds,
|
2016-01-15 08:51:40 +00:00
|
|
|
const cu_info_t *const cur_pu,
|
|
|
|
const cu_info_t *const left_pu,
|
|
|
|
const cu_info_t *const above_pu);
|
2013-03-13 13:56:43 +00:00
|
|
|
|
2017-03-06 16:27:39 +00:00
|
|
|
#if KVZ_SEL_ENCRYPTION
|
|
|
|
/**
|
|
|
|
* \brief Function for deriving intra luma predictions with encryption
|
|
|
|
* \param x x-coordinate of the PU in pixels
|
|
|
|
* \param y y-coordinate of the PU in pixels
|
|
|
|
* \param preds output buffer for 3 predictions
|
|
|
|
* \param cur_pu PU to check
|
|
|
|
* \param left_pu PU to the left of cur_pu
|
|
|
|
* \param above_pu PU above cur_pu
|
|
|
|
* \returns 1 if predictions are found, otherwise 0
|
|
|
|
*/
|
|
|
|
int8_t kvz_intra_get_dir_luma_predictor_encry(
|
|
|
|
const uint32_t x,
|
|
|
|
const uint32_t y,
|
|
|
|
int8_t *preds,
|
|
|
|
const cu_info_t *const cur_pu,
|
|
|
|
const cu_info_t *const left_pu,
|
|
|
|
const cu_info_t *const above_pu);
|
|
|
|
#endif
|
|
|
|
|
2015-10-03 00:36:58 +00:00
|
|
|
/**
|
|
|
|
* \brief Generage angular predictions.
|
|
|
|
* \param width Width in pixels, range 4..32.
|
|
|
|
* \param color What color pixels to use.
|
|
|
|
* \param luma_px Luma coordinates of the prediction block.
|
|
|
|
* \param pic_px Picture dimensions in luma pixels.
|
|
|
|
* \param lcu LCU struct.
|
|
|
|
* \param out_left_ref Left reference pixels, index 0 is the top-left.
|
|
|
|
* \param out_top_ref Top reference pixels, index 0 is the top-left.
|
|
|
|
*/
|
|
|
|
void kvz_intra_build_reference(
|
|
|
|
const int_fast8_t log2_width,
|
|
|
|
const color_t color,
|
|
|
|
const vector2d_t *const luma_px,
|
|
|
|
const vector2d_t *const pic_px,
|
|
|
|
const lcu_t *const lcu,
|
|
|
|
kvz_intra_references *const refs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Generate intra predictions.
|
2016-07-23 12:04:45 +00:00
|
|
|
* \param refs Reference pixels used for the prediction.
|
|
|
|
* \param log2_width Width of the predicted block.
|
|
|
|
* \param mode Intra mode used for the prediction.
|
|
|
|
* \param color Color of the prediction.
|
|
|
|
* \param dst Buffer for the predicted pixels.
|
|
|
|
* \param filter_boundary Whether to filter the boundary on modes 10 and 26.
|
2015-10-03 00:36:58 +00:00
|
|
|
*/
|
2015-10-05 02:42:59 +00:00
|
|
|
void kvz_intra_predict(
|
2015-10-03 00:36:58 +00:00
|
|
|
kvz_intra_references *refs,
|
|
|
|
int_fast8_t log2_width,
|
|
|
|
int_fast8_t mode,
|
|
|
|
color_t color,
|
2016-07-23 12:04:45 +00:00
|
|
|
kvz_pixel *dst,
|
|
|
|
bool filter_boundary);
|
2015-10-03 00:36:58 +00:00
|
|
|
|
2017-05-24 07:33:13 +00:00
|
|
|
void kvz_intra_recon_cu(
|
2015-10-05 03:18:20 +00:00
|
|
|
encoder_state_t *const state,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int depth,
|
2017-05-24 07:33:13 +00:00
|
|
|
int8_t mode_luma,
|
|
|
|
int8_t mode_chroma,
|
2015-10-05 03:18:20 +00:00
|
|
|
cu_info_t *cur_cu,
|
|
|
|
lcu_t *lcu);
|
2013-02-24 14:03:40 +00:00
|
|
|
|
2012-06-11 15:43:29 +00:00
|
|
|
#endif
|