Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include-what-you-use and removed (some few) unnecessary includes. #146

Open
wants to merge 3 commits into
base: frame-parallel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set noparent
filter=-,+build/include_what_you_use,+build/forward_decl,+build/printf_format,+legal/copyright,+build/include,-build/include_alpha,-build/include_order
linelength=120
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ EXTRA_DIST = .travis.yml \
m4/m4_ax_check_compile_flag.m4 \
Makefile.vc7 \
CMakeLists.txt \
CPPLINT.cfg \
README.md \
libde265.png \
*/COPYING
Expand Down
2 changes: 2 additions & 0 deletions libde265/CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude_files=md5\..*

1 change: 1 addition & 0 deletions libde265/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ endif

EXTRA_DIST = Makefile.vc7 \
CMakeLists.txt \
CPPLINT.cfg \
../extra/stdbool.h \
../extra/stdint.h

Expand Down
2 changes: 1 addition & 1 deletion libde265/alloc_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define ALLOC_POOL_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h" // NOLINT(build/include)
#endif

#include <vector>
Expand Down
6 changes: 3 additions & 3 deletions libde265/arm/arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h" // NOLINT(build/include)
#endif

#include "arm.h"

#include <stdio.h>

#include "libde265/arm/arm.h"

// TODO: on linux, use getauxval(AT_HWCAP);
static bool detect_neon()
{
Expand Down
2 changes: 1 addition & 1 deletion libde265/arm/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef LIBDE265_ARM_H
#define LIBDE265_ARM_H

#include "acceleration.h"
#include "libde265/acceleration.h"

void init_acceleration_functions_neon(struct acceleration_functions* accel);
void init_acceleration_functions_aarch64(struct acceleration_functions* accel);
Expand Down
5 changes: 2 additions & 3 deletions libde265/bitstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "bitstream.h"
#include "de265.h"

#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include "libde265/bitstream.h"
#include "libde265/de265.h"


void bitreader_init(bitreader* br, unsigned char* buffer, int len)
Expand Down
6 changes: 3 additions & 3 deletions libde265/cabac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cabac.h"
#include "util.h"

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include "libde265/cabac.h"
#include "libde265/util.h"

#define INITIAL_CABAC_BUFFER_CAPACITY 4096


Expand Down
2 changes: 1 addition & 1 deletion libde265/cabac.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#define DE265_CABAC_H

#include <stdint.h>
#include "contextmodel.h"

#include "libde265/contextmodel.h"

typedef struct {
uint8_t* bitstream_start;
Expand Down
6 changes: 3 additions & 3 deletions libde265/codingdata-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

#include <stdint.h>

#include "codingdata.h"
#include "image.h"
#include "encoder/encoder-context.h"
#include "libde265/codingdata.h"
#include "libde265/image.h"
#include "libde265/encoder/encoder-context.h"


template <> class CodingDataAccess<image>
Expand Down
4 changes: 2 additions & 2 deletions libde265/configparam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "configparam.h"

#include <string.h>
#include <ctype.h>
#include <sstream>
Expand All @@ -30,6 +28,8 @@
#include <algorithm>
#include <typeinfo>

#include "libde265/configparam.h"

#ifndef RTTI_ENABLED
#error "Need to compile with RTTI enabled."
#endif
Expand Down
7 changes: 4 additions & 3 deletions libde265/configparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
#ifndef CONFIG_PARAM_H
#define CONFIG_PARAM_H

#include "en265.h"
#include "util.h"

#include <climits>
#include <utility>
#include <vector>
#include <string>
#include <stddef.h>
#include <assert.h>

#include "libde265/en265.h"
#include "libde265/util.h"


/* Notes: probably best to keep cmd-line-options here. So it will be:
- automatically consistent even when having different combinations of algorithms
Expand Down
4 changes: 3 additions & 1 deletion libde265/contextmodel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "slice.h"
#include <assert.h>
#include <iomanip>
#include <sstream>

#include "libde265/contextmodel.h"
#include "libde265/slice.h"

bool D = false;

context_model_table::context_model_table()
Expand Down
1 change: 0 additions & 1 deletion libde265/contextmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#ifndef DE265_CONTEXTMODEL_H
#define DE265_CONTEXTMODEL_H

#include "libde265/cabac.h"
#include "libde265/de265.h"

#include <string.h>
Expand Down
14 changes: 6 additions & 8 deletions libde265/de265.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@

#define DEBUG_INSERT_STREAM_ERRORS 0


#include "de265.h"
#include "decctx.h"
#include "util.h"
#include "scan.h"
#include "image.h"
#include "sei.h"

#include <assert.h>
#include <string.h>
#include <stdlib.h>

#include "libde265/de265.h"
#include "libde265/decctx.h"
#include "libde265/util.h"
#include "libde265/scan.h"
#include "libde265/image.h"
#include "libde265/sei.h"

// TODO: should be in some vps.c related header
de265_error read_vps(decoder_context* ctx, bitreader* reader, video_parameter_set* vps);
Expand Down
14 changes: 8 additions & 6 deletions libde265/deblock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "deblock.h"
#include "util.h"
#include "transform.h"
#include "de265.h"
#include "image-unit.h"

#include <assert.h>

#include <algorithm>
#include <memory>
#include <string>

#include "libde265/de265.h"
#include "libde265/deblock.h"
#include "libde265/image-unit.h"
#include "libde265/transform.h"
#include "libde265/util.h"

// 8.7.2.1 for both EDGE_HOR and EDGE_VER at the same time
void markTransformBlockBoundary(image* img, int x0,int y0,
Expand Down
31 changes: 16 additions & 15 deletions libde265/decctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,42 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "decctx.h"
#include "util.h"
#include "sao.h"
#include "sei.h"
#include "deblock.h"
#include "image-unit.h"
#ifdef HAVE_CONFIG_H
#include "config.h" // NOLINT(build/include)
#endif

#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

#include "fallback.h"
#include <algorithm>
#include <string>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "libde265/decctx.h"
#include "libde265/util.h"
#include "libde265/sao.h"
#include "libde265/sei.h"
#include "libde265/deblock.h"
#include "libde265/image-unit.h"

#include "libde265/fallback.h"

#ifdef HAVE_SSE4_1
#include "x86/sse.h"
#include "libde265/x86/sse.h"
#endif

#ifdef HAVE_NEON
#include "arm/arm.h"
#include "libde265/arm/arm.h"
#endif

#define SAVE_INTERMEDIATE_IMAGES 0

#if SAVE_INTERMEDIATE_IMAGES
#include "visualize.h"
#include "libde265/visualize.h"
#endif

#include <iostream> // TODO TMP

extern void thread_decode_CTB_row(void* d);
extern void thread_decode_slice_segment(void* d);

Expand Down
2 changes: 2 additions & 0 deletions libde265/decctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
#include "libde265/frame-dropper.h"
#include "libde265/frontend-syntax-decoder.h"

#include <deque>
#include <memory>
#include <vector>

#define DE265_MAX_VPS_SETS 16 // this is the maximum as defined in the standard
#define DE265_MAX_SPS_SETS 16 // this is the maximum as defined in the standard
Expand Down
4 changes: 2 additions & 2 deletions libde265/dpb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include "dpb.h"
#include "decctx.h"
#include <string.h>
#include <assert.h>

#include "libde265/dpb.h"
#include "libde265/decctx.h"

#define DPB_DEFAULT_MAX_IMAGES 30

Expand Down
1 change: 1 addition & 0 deletions libde265/dpb.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "libde265/sps.h"

#include <deque>
#include <memory>
#include <vector>

class decoder_context;
Expand Down
1 change: 0 additions & 1 deletion libde265/encoder/algo/cb-intrapartmode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <assert.h>
#include <limits>
#include <math.h>
#include <iostream>


#define ENCODER_DEVELOPMENT 1
Expand Down
2 changes: 1 addition & 1 deletion libde265/encoder/algo/cb-mergeindex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <assert.h>
#include <limits>
#include <math.h>

#include <memory>



Expand Down
1 change: 0 additions & 1 deletion libde265/encoder/algo/cb-split.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <assert.h>
#include <limits>
#include <math.h>
#include <iostream>


// Utility function to encode all four children in a splitted CB.
Expand Down
2 changes: 2 additions & 0 deletions libde265/encoder/algo/coding-options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/

#include <utility>

#include "libde265/encoder/algo/coding-options.h"
#include "libde265/encoder/encoder-context.h"

Expand Down
2 changes: 2 additions & 0 deletions libde265/encoder/algo/coding-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef CODING_OPTIONS_H
#define CODING_OPTIONS_H

#include <vector>

#include "libde265/encoder/encoder-types.h"


Expand Down
1 change: 1 addition & 0 deletions libde265/encoder/algo/pb-mv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <assert.h>
#include <limits>
#include <math.h>
#include <memory>



Expand Down
11 changes: 6 additions & 5 deletions libde265/encoder/algo/tb-intrapredmode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
* along with libde265. If not, see <http://www.gnu.org/licenses/>.
*/


#include "libde265/encoder/encoder-context.h"
#include "libde265/encoder/algo/tb-split.h"
#include "libde265/encoder/algo/coding-options.h"
#include <assert.h>
#include <limits>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>

#include "libde265/encoder/encoder-context.h"
#include "libde265/encoder/algo/tb-split.h"
#include "libde265/encoder/algo/coding-options.h"
#include "libde265/encoder/algo/tb-intrapredmode.h"

float get_intra_pred_mode_bits(const enum IntraPredMode candidates[3],
enum IntraPredMode intraMode,
Expand Down
2 changes: 2 additions & 0 deletions libde265/encoder/algo/tb-intrapredmode.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef TB_INTRAPREDMODE_H
#define TB_INTRAPREDMODE_H

#include <memory>

#include "libde265/nal-parser.h"
#include "libde265/decctx.h"
#include "libde265/encoder/encoder-types.h"
Expand Down
Loading