Extract encoding code from encoderstate.c

Moves functions kvz_encode_coding_tree and kvz_encode_coeff_nxn from
encoderstate.c to encode_coding_tree.c.
This commit is contained in:
Arttu Ylä-Outinen 2016-08-09 22:01:51 +09:00
parent 3434559b8c
commit aabf6ca3ee
8 changed files with 1140 additions and 1060 deletions

View file

@ -139,6 +139,7 @@
<ClCompile Include="..\..\src\encoder_state-bitstream.c" />
<ClCompile Include="..\..\src\encoder_state-ctors_dtors.c" />
<ClCompile Include="..\..\src\encoder_state-geometry.c" />
<ClCompile Include="..\..\src\encode_coding_tree.c" />
<ClCompile Include="..\..\src\extras\getopt.c" />
<ClCompile Include="..\..\src\filter.c" />
<ClCompile Include="..\..\src\image.c" />
@ -217,6 +218,7 @@
<ClInclude Include="..\..\src\encoder_state-bitstream.h" />
<ClInclude Include="..\..\src\encoder_state-ctors_dtors.h" />
<ClInclude Include="..\..\src\encoder_state-geometry.h" />
<ClInclude Include="..\..\src\encode_coding_tree.h" />
<ClCompile Include="..\..\src\strategyselector.c" />
<ClCompile Include="..\..\src\tables.c" />
<ClCompile Include="..\..\src\threadqueue.c" />
@ -294,4 +296,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\yasm\vsyasm.targets" />
</ImportGroup>
</Project>
</Project>

View file

@ -207,6 +207,9 @@
<ClCompile Include="..\..\src\encoder_state-bitstream.c">
<Filter>Bitstream</Filter>
</ClCompile>
<ClCompile Include="..\..\src\encode_coding_tree.c">
<Filter>Bitstream</Filter>
</ClCompile>
<ClCompile Include="..\..\src\strategies\strategies-sao.c">
<Filter>Optimization\strategies</Filter>
</ClCompile>
@ -393,6 +396,9 @@
<ClInclude Include="..\..\src\encoder_state-bitstream.h">
<Filter>Bitstream</Filter>
</ClInclude>
<ClInclude Include="..\..\src\encode_coding_tree.h">
<Filter>Bitstream</Filter>
</ClInclude>
<ClInclude Include="..\..\src\kvz_math.h" />
<ClInclude Include="..\..\src\strategies\strategies-sao.h">
<Filter>Optimization\strategies</Filter>
@ -417,4 +423,4 @@
<Filter>Optimization\strategies\x86_asm</Filter>
</YASM>
</ItemGroup>
</Project>
</Project>

View file

@ -56,6 +56,8 @@ libkvazaar_la_SOURCES = \
encoder_state-ctors_dtors.h \
encoder_state-geometry.c \
encoder_state-geometry.h \
encode_coding_tree.c \
encode_coding_tree.h \
filter.c \
filter.h \
global.h \

1082
src/encode_coding_tree.c Normal file

File diff suppressed because it is too large Load diff

44
src/encode_coding_tree.h Normal file
View file

@ -0,0 +1,44 @@
#ifndef ENCODE_CODING_TREE_H_
#define ENCODE_CODING_TREE_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/>.
****************************************************************************/
/**
* \file
* Functions for writing the coding quadtree and related syntax.
*/
#include "encoderstate.h"
#include "global.h"
void kvz_encode_coding_tree(encoder_state_t *state,
uint16_t x_ctb,
uint16_t y_ctb,
uint8_t depth);
void kvz_encode_coeff_nxn(encoder_state_t *state,
coeff_t *coeff,
uint8_t width,
uint8_t type,
int8_t scan_mode,
int8_t tr_skip);
#endif // ENCODE_CODING_TREE_H_

File diff suppressed because it is too large Load diff

View file

@ -206,20 +206,6 @@ void kvz_encode_one_frame(encoder_state_t * const state, kvz_picture* frame);
void kvz_encoder_prepare(encoder_state_t *state);
void kvz_encode_coding_tree(encoder_state_t *state, uint16_t x_ctb,
uint16_t y_ctb, uint8_t depth);
void kvz_encode_last_significant_xy(encoder_state_t *state,
uint8_t lastpos_x, uint8_t lastpos_y,
uint8_t width, uint8_t height,
uint8_t type, uint8_t scan);
void kvz_encode_coeff_nxn(encoder_state_t *state, coeff_t *coeff, uint8_t width,
uint8_t type, int8_t scan_mode, int8_t tr_skip);
void kvz_encode_transform_coeff(encoder_state_t *state, int32_t x_cu, int32_t y_cu,
int8_t depth, int8_t tr_depth, uint8_t parent_coeff_u, uint8_t parent_coeff_v);
void encode_block_residual(const encoder_control_t * const encoder,
uint16_t x_ctb, uint16_t y_ctb, uint8_t depth);
int kvz_encoder_state_match_children_of_previous_frame(encoder_state_t * const state);
coeff_scan_order_t kvz_get_scan_order(int8_t cu_type, int intra_mode, int depth);

View file

@ -25,6 +25,7 @@
#include "cabac.h"
#include "context.h"
#include "encode_coding_tree.h"
#include "encoder.h"
#include "imagelist.h"
#include "inter.h"