2014-06-05 12:08:31 +00:00
|
|
|
#ifndef VIDEOFRAME_H_
|
|
|
|
#define VIDEOFRAME_H_
|
|
|
|
/*****************************************************************************
|
2021-11-23 06:46:06 +00:00
|
|
|
* This file is part of uvg266 VVC encoder.
|
2014-06-05 12:08:31 +00:00
|
|
|
*
|
2021-10-07 08:32:59 +00:00
|
|
|
* Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
* are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
* other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
|
|
|
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
* INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
2014-06-05 12:08:31 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-12-17 11:42:57 +00:00
|
|
|
/**
|
|
|
|
* \ingroup DataStructures
|
2014-06-05 12:08:31 +00:00
|
|
|
* \file
|
2015-12-17 11:42:57 +00:00
|
|
|
* \brief Container for the frame currently being encoded.
|
2014-06-05 12:08:31 +00:00
|
|
|
*/
|
|
|
|
|
2014-06-05 12:54:58 +00:00
|
|
|
#include "cu.h"
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "global.h" // IWYU pragma: keep
|
2022-04-28 11:26:05 +00:00
|
|
|
#include "uvg266.h"
|
2014-06-05 12:08:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Struct which contains all picture data
|
|
|
|
*/
|
|
|
|
typedef struct videoframe
|
|
|
|
{
|
2022-04-28 11:18:09 +00:00
|
|
|
uvg_picture *source; //!< \brief Source image.
|
|
|
|
uvg_picture *source_lmcs; //!< \brief LMCS mapped source image if available, otherwise points to source.
|
|
|
|
uvg_picture *rec; //!< \brief Reconstructed image.
|
|
|
|
uvg_picture *rec_lmcs; //!< \brief LMCS mapped reconstructed image, if available, otherwise points to source.
|
2015-06-30 07:56:29 +00:00
|
|
|
|
2022-04-28 11:18:09 +00:00
|
|
|
uvg_pixel *cclm_luma_rec; //!< \brief buffer for the downsampled luma reconstruction for cclm
|
|
|
|
uvg_pixel *cclm_luma_rec_top_line; //!< \brief buffer for the downsampled luma reconstruction for cclm
|
2021-11-19 09:54:51 +00:00
|
|
|
|
2021-06-02 05:46:46 +00:00
|
|
|
uint8_t* lmcs_avg_processed; //!< \brief For each LCU, indicates if already calculated average of border pixels is available
|
|
|
|
int32_t* lmcs_avg; //!< \brief Average of LCU border pixels
|
|
|
|
|
2014-06-05 12:08:31 +00:00
|
|
|
int32_t width; //!< \brief Luma pixel array width.
|
|
|
|
int32_t height; //!< \brief Luma pixel array height.
|
|
|
|
int32_t height_in_lcu; //!< \brief Picture width in number of LCU's.
|
|
|
|
int32_t width_in_lcu; //!< \brief Picture height in number of LCU's.
|
|
|
|
|
2015-03-04 10:52:49 +00:00
|
|
|
cu_array_t* cu_array; //!< \brief Info for each CU at each depth.
|
2022-06-06 11:49:52 +00:00
|
|
|
cu_array_t* chroma_cu_array; //!< \brief Info for each CU at each depth.
|
2021-05-12 08:42:34 +00:00
|
|
|
struct lmcs_aps* lmcs_aps; //!< \brief LMCS parameters for both the current frame.
|
2015-03-04 14:32:38 +00:00
|
|
|
struct sao_info_t *sao_luma; //!< \brief Array of sao parameters for every LCU.
|
|
|
|
struct sao_info_t *sao_chroma; //!< \brief Array of sao parameters for every LCU.
|
2019-08-15 08:01:38 +00:00
|
|
|
struct alf_info_t *alf_info; //!< \brief Array of alf parameters for both luma and chroma.
|
2021-07-22 20:18:56 +00:00
|
|
|
struct param_set_map* alf_param_set_map;
|
|
|
|
|
2014-06-05 12:08:31 +00:00
|
|
|
int32_t poc; //!< \brief Picture order count
|
2020-12-28 20:58:54 +00:00
|
|
|
cu_info_t* hmvp_lut; //!< \brief Look-up table for HMVP, one for each LCU row
|
2021-05-05 10:28:39 +00:00
|
|
|
|
2020-12-28 20:58:54 +00:00
|
|
|
uint8_t* hmvp_size; //!< \brief HMVP LUT size
|
2021-05-05 10:28:39 +00:00
|
|
|
bool source_lmcs_mapped; //!< \brief Indicate if source_lmcs is available and mapped to LMCS
|
2021-05-25 08:00:46 +00:00
|
|
|
bool lmcs_top_level; //!< \brief Indicate that in this level the LMCS images are allocated
|
2021-05-05 10:28:39 +00:00
|
|
|
bool rec_lmcs_mapped; //!< \brief Indicate if rec_lmcs is available and mapped to LMCS
|
2015-03-04 11:17:33 +00:00
|
|
|
} videoframe_t;
|
2014-06-05 12:08:31 +00:00
|
|
|
|
|
|
|
|
2022-04-28 11:18:09 +00:00
|
|
|
videoframe_t *uvg_videoframe_alloc(int32_t width, int32_t height, enum uvg_chroma_format chroma_format, enum uvg_alf alf_type, bool cclm);
|
|
|
|
int uvg_videoframe_free(videoframe_t * const frame);
|
2014-06-05 12:54:58 +00:00
|
|
|
|
2022-04-28 11:18:09 +00:00
|
|
|
void uvg_videoframe_set_poc(videoframe_t * frame, int32_t poc);
|
2014-06-05 12:54:58 +00:00
|
|
|
|
2014-06-05 12:08:31 +00:00
|
|
|
#endif
|