2015-09-08 05:36:52 +00:00
|
|
|
#ifndef INPUT_FRAME_BUFFER_H_
|
|
|
|
#define INPUT_FRAME_BUFFER_H_
|
|
|
|
/*****************************************************************************
|
|
|
|
* This file is part of Kvazaar HEVC encoder.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2015 Tampere University of Technology and others (see
|
|
|
|
* COPYING file).
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-12-17 11:42:57 +00:00
|
|
|
/**
|
|
|
|
* \ingroup Control
|
2015-09-08 05:36:52 +00:00
|
|
|
* \file
|
2015-12-17 11:42:57 +00:00
|
|
|
* Buffering of input for reordering.
|
2015-09-08 05:36:52 +00:00
|
|
|
*/
|
|
|
|
|
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"
|
|
|
|
|
2015-09-08 05:36:52 +00:00
|
|
|
|
|
|
|
// Forward declaration.
|
|
|
|
struct encoder_state_t;
|
|
|
|
|
2015-09-08 05:52:23 +00:00
|
|
|
typedef struct input_frame_buffer_t {
|
|
|
|
/** \brief An array for stroring the input frames. */
|
2015-09-08 08:58:35 +00:00
|
|
|
struct kvz_picture *pic_buffer[3 * KVZ_MAX_GOP_LENGTH];
|
2015-09-08 05:52:23 +00:00
|
|
|
|
2015-09-08 08:58:35 +00:00
|
|
|
/** \brief An array for stroring the timestamps. */
|
|
|
|
int64_t pts_buffer[3 * KVZ_MAX_GOP_LENGTH];
|
2015-09-08 05:52:23 +00:00
|
|
|
|
2015-09-08 08:58:35 +00:00
|
|
|
/** \brief Number of pictures input. */
|
|
|
|
uint64_t num_in;
|
2015-09-08 05:52:23 +00:00
|
|
|
|
2015-09-08 08:58:35 +00:00
|
|
|
/** \brief Number of pictures output. */
|
|
|
|
uint64_t num_out;
|
2015-09-08 05:52:23 +00:00
|
|
|
|
2015-09-08 08:58:35 +00:00
|
|
|
/** \brief Value to subtract from the DTS values of the first frames.
|
|
|
|
*
|
|
|
|
* This will be set to the difference of the PTS values of the first and
|
|
|
|
* (cfg->gop_len)th frames, unless the sequence has less that cfg->gop_len
|
|
|
|
* frames.
|
|
|
|
*/
|
|
|
|
int64_t delay;
|
|
|
|
|
|
|
|
/** \brief Number of GOP pictures skipped.
|
|
|
|
*
|
|
|
|
* This is used when the last GOP of the sequence is not full.
|
|
|
|
*/
|
|
|
|
int gop_skipped;
|
2015-09-08 05:52:23 +00:00
|
|
|
|
|
|
|
} input_frame_buffer_t;
|
|
|
|
|
|
|
|
void kvz_init_input_frame_buffer(input_frame_buffer_t *input_buffer);
|
|
|
|
|
2016-06-20 00:36:21 +00:00
|
|
|
kvz_picture* kvz_encoder_feed_frame(input_frame_buffer_t *buf,
|
|
|
|
struct encoder_state_t *const state,
|
2019-11-18 07:51:37 +00:00
|
|
|
struct kvz_picture *const img_in,
|
|
|
|
int first_done);
|
2015-09-08 05:36:52 +00:00
|
|
|
|
|
|
|
#endif // INPUT_FRAME_BUFFER_H_
|