From 4ab9aa3e2fe45a538fa3b9af047c8805e626e7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Tue, 30 Jun 2015 13:14:24 +0300 Subject: [PATCH] Move kvz_encoder definition to kvazaar_internal.h. --- build/kvazaar_lib/kvazaar_lib.vcxproj | 1 + build/kvazaar_lib/kvazaar_lib.vcxproj.filters | 3 ++ src/encmain.c | 2 +- src/kvazaar.c | 2 +- src/kvazaar.h | 22 +++------- src/kvazaar_internal.h | 40 +++++++++++++++++++ 6 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 src/kvazaar_internal.h diff --git a/build/kvazaar_lib/kvazaar_lib.vcxproj b/build/kvazaar_lib/kvazaar_lib.vcxproj index d3b59b61..9fc91d96 100644 --- a/build/kvazaar_lib/kvazaar_lib.vcxproj +++ b/build/kvazaar_lib/kvazaar_lib.vcxproj @@ -194,6 +194,7 @@ + diff --git a/build/kvazaar_lib/kvazaar_lib.vcxproj.filters b/build/kvazaar_lib/kvazaar_lib.vcxproj.filters index cbc3466f..4e221baa 100644 --- a/build/kvazaar_lib/kvazaar_lib.vcxproj.filters +++ b/build/kvazaar_lib/kvazaar_lib.vcxproj.filters @@ -353,6 +353,9 @@ Header Files + + Header Files + diff --git a/src/encmain.c b/src/encmain.c index d522251f..2f9d7396 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -23,7 +23,7 @@ * */ -#include "kvazaar.h" +#include "kvazaar_internal.h" #ifdef _WIN32 /* The following two defines must be located before the inclusion of any system header files. */ diff --git a/src/kvazaar.c b/src/kvazaar.c index a4422225..e1f1fd05 100644 --- a/src/kvazaar.c +++ b/src/kvazaar.c @@ -18,7 +18,7 @@ * with Kvazaar. If not, see . ****************************************************************************/ -#include "kvazaar.h" +#include "kvazaar_internal.h" #include diff --git a/src/kvazaar.h b/src/kvazaar.h index 92f86704..25488f19 100644 --- a/src/kvazaar.h +++ b/src/kvazaar.h @@ -51,6 +51,11 @@ typedef uint8_t kvz_pixel; typedef uint16_t kvz_pixel; #endif +/** + * Opaque data structure representing one instance of the encoder. + */ +typedef struct kvz_encoder kvz_encoder; + /** * \brief GoP picture configuration. */ @@ -137,9 +142,6 @@ typedef struct kvz_config int32_t target_bitrate; } kvz_config; -typedef struct encoder_state_t encoder_state_t; -typedef struct encoder_control_t encoder_control_t; - /** * \brief Struct which contains all picture data */ @@ -176,20 +178,6 @@ typedef struct kvz_data_chunk { struct kvz_data_chunk *next; } kvz_data_chunk; -/** - * Main datastructure representing one instance of the encoder. - */ -typedef struct kvz_encoder { - encoder_control_t* control; - encoder_state_t* states; - unsigned num_encoder_states; - unsigned cur_state_num; - unsigned frames_started; - unsigned frames_done; - - size_t bitstream_length; -} kvz_encoder; - typedef struct kvz_api { kvz_config * (*config_alloc)(void); int (*config_destroy)(kvz_config *); diff --git a/src/kvazaar_internal.h b/src/kvazaar_internal.h new file mode 100644 index 00000000..5128daab --- /dev/null +++ b/src/kvazaar_internal.h @@ -0,0 +1,40 @@ +#ifndef KVAZAAR_INTERNAL_H_ +#define KVAZAAR_INTERNAL_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 . +****************************************************************************/ + +#include "kvazaar.h" + +// Forward declarations. +typedef struct encoder_state_t encoder_state_t; +typedef struct encoder_control_t encoder_control_t; + +typedef struct kvz_encoder { + encoder_control_t* control; + encoder_state_t* states; + unsigned num_encoder_states; + unsigned cur_state_num; + unsigned frames_started; + unsigned frames_done; + + size_t bitstream_length; +} kvz_encoder; + +#endif // KVAZAAR_INTERNAL_H_