uvg266/src/videoframe.h

101 lines
5 KiB
C
Raw Normal View History

#ifndef VIDEOFRAME_H_
#define VIDEOFRAME_H_
/*****************************************************************************
2021-11-23 06:46:06 +00:00
* This file is part of uvg266 VVC encoder.
*
* 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
****************************************************************************/
/**
* \ingroup DataStructures
* \file
* \brief Container for the frame currently being encoded.
*/
#include "cu.h"
#include "global.h" // IWYU pragma: keep
#include "uvg266.h"
/**
* \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
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
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.
2022-06-07 12:32:55 +00:00
int32_t chroma_width; //!< \brief Luma pixel array width.
int32_t chroma_height; //!< \brief Luma pixel array height.
int32_t chroma_height_in_lcu; //!< \brief Picture width in number of LCU's.
int32_t chroma_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.
cu_array_t* chroma_cu_array; //!< \brief Info for each CU at each depth.
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.
struct alf_info_t *alf_info; //!< \brief Array of alf parameters for both luma and chroma.
struct param_set_map* alf_param_set_map;
int32_t poc; //!< \brief Picture order count
2022-06-29 05:59:20 +00:00
uvg_pixel **ibc_buffer_y; //!< \brief Intra Block Copy buffer for each LCU row
uvg_pixel **ibc_buffer_u; //!< \brief Intra Block Copy buffer for each LCU row
uvg_pixel **ibc_buffer_v; //!< \brief Intra Block Copy buffer for each LCU row
cu_info_t* hmvp_lut_ibc; //!< \brief Look-up table for HMVP in IBC, one for each LCU row
uint8_t* hmvp_size_ibc; //!< \brief HMVP IBC LUT size
cu_info_t* hmvp_lut; //!< \brief Look-up table for HMVP, one for each LCU row
2020-12-28 20:58:54 +00:00
uint8_t* hmvp_size; //!< \brief HMVP LUT size
bool source_lmcs_mapped; //!< \brief Indicate if source_lmcs is available and mapped to LMCS
bool lmcs_top_level; //!< \brief Indicate that in this level the LMCS images are allocated
bool rec_lmcs_mapped; //!< \brief Indicate if rec_lmcs is available and mapped to LMCS
} videoframe_t;
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);
2022-04-28 11:18:09 +00:00
void uvg_videoframe_set_poc(videoframe_t * frame, int32_t poc);
#endif