blob: 845811f1d8791d344252b6bb74c43c6ecad54bce [file]
From 88ff844f9ecb6a86f05e3372968278ee32efd730 Mon Sep 17 00:00:00 2001
From: Derek Schuff <dschuff@chromium.org>
Date: Wed, 4 Feb 2026 01:00:50 +0000
Subject: [PATCH 11/30] ldecod: remove use of C common symbols
---
MultiSource/Applications/JM/ldecod/erc_api.c | 4 +-
MultiSource/Applications/JM/ldecod/erc_api.h | 4 +-
MultiSource/Applications/JM/ldecod/erc_do_p.c | 2 +-
MultiSource/Applications/JM/ldecod/global.c | 352 ++++++++++++++++++
MultiSource/Applications/JM/ldecod/global.h | 60 +--
MultiSource/Applications/JM/ldecod/image.c | 6 +-
MultiSource/Applications/JM/ldecod/ldecod.c | 6 +-
.../Applications/JM/ldecod/loopFilter.c | 2 +-
.../Applications/JM/ldecod/macroblock.h | 289 +-------------
.../Applications/JM/ldecod/mb_access.h | 4 +-
MultiSource/Applications/JM/ldecod/mbuffer.c | 8 +-
MultiSource/Applications/JM/ldecod/nal_part.c | 2 +-
MultiSource/Applications/JM/ldecod/output.c | 2 +-
MultiSource/Applications/JM/ldecod/parset.c | 4 +-
MultiSource/Applications/JM/ldecod/rtp.c | 2 +-
.../Applications/JM/ldecod/transform8x8.c | 86 +----
.../Applications/JM/ldecod/transform8x8.h | 2 +-
MultiSource/Applications/JM/ldecod/vlc.c | 2 +-
18 files changed, 424 insertions(+), 413 deletions(-)
create mode 100644 MultiSource/Applications/JM/ldecod/global.c
diff --git a/MultiSource/Applications/JM/ldecod/erc_api.c b/MultiSource/Applications/JM/ldecod/erc_api.c
index 89c05bced..81dbe9862 100644
--- a/MultiSource/Applications/JM/ldecod/erc_api.c
+++ b/MultiSource/Applications/JM/ldecod/erc_api.c
@@ -23,8 +23,8 @@
objectBuffer_t *erc_object_list = NULL;
ercVariables_t *erc_errorVar = NULL;
-frame erc_recfr;
-int erc_mvperMB;
+frame erc_recfr = {0};
+int erc_mvperMB = 0;
/*!
************************************************************************
diff --git a/MultiSource/Applications/JM/ldecod/erc_api.h b/MultiSource/Applications/JM/ldecod/erc_api.h
index 0141a10c7..78c205090 100644
--- a/MultiSource/Applications/JM/ldecod/erc_api.h
+++ b/MultiSource/Applications/JM/ldecod/erc_api.h
@@ -157,8 +157,8 @@ void sliding_window_poc_management(StorablePicture *p);
void write_lost_non_ref_pic(int poc, int p_out);
void write_lost_ref_after_idr(int pos);
-FrameStore *last_out_fs;
-int pocs_in_dpb[100];
+extern FrameStore *last_out_fs;
+extern int pocs_in_dpb[100];
int comp(const void *, const void *);
diff --git a/MultiSource/Applications/JM/ldecod/erc_do_p.c b/MultiSource/Applications/JM/ldecod/erc_do_p.c
index a1796474d..57653ddba 100644
--- a/MultiSource/Applications/JM/ldecod/erc_do_p.c
+++ b/MultiSource/Applications/JM/ldecod/erc_do_p.c
@@ -27,7 +27,7 @@
#include "image.h"
extern int erc_mvperMB;
-struct img_par *erc_img;
+struct img_par *erc_img = NULL;
// picture error concealment
// concealment_head points to first node in list, concealment_end points to
diff --git a/MultiSource/Applications/JM/ldecod/global.c b/MultiSource/Applications/JM/ldecod/global.c
new file mode 100644
index 000000000..5e5cf4d33
--- /dev/null
+++ b/MultiSource/Applications/JM/ldecod/global.c
@@ -0,0 +1,352 @@
+
+#include "global.h"
+#include "erc_api.h"
+#include "mb_access.h"
+#include "transform8x8.h"
+
+pic_parameter_set_rbsp_t *active_pps = NULL;
+seq_parameter_set_rbsp_t *active_sps = NULL;
+
+imgpel **imgY_ref = NULL;
+imgpel ***imgUV_ref = NULL;
+
+int **PicPos = NULL;
+int ReMapRef[20] = {0};
+int Bframe_ctr = 0;
+int frame_no = 0;
+
+int g_nFrame = 0;
+
+int TopFieldForSkip_Y[16][16] = {{0}};
+int TopFieldForSkip_UV[2][16][16] = {{{0}}};
+
+int InvLevelScale4x4Luma_Intra[6][4][4] = {{{0}}};
+int InvLevelScale4x4Chroma_Intra[2][6][4][4] = {{{{0}}}};
+
+int InvLevelScale4x4Luma_Inter[6][4][4] = {{{0}}};
+int InvLevelScale4x4Chroma_Inter[2][6][4][4] = {{{{0}}}};
+
+int InvLevelScale8x8Luma_Intra[6][8][8] = {{{0}}};
+
+int InvLevelScale8x8Luma_Inter[6][8][8] = {{{0}}};
+
+int *qmatrix[8] = {NULL};
+
+char errortext[ET_SIZE] = {0};
+
+time_t tot_time = 0;
+
+int p_out = -1;
+int p_ref = -1;
+
+FILE *p_log = NULL;
+
+#if TRACE
+FILE *p_trace = NULL;
+#endif
+
+unsigned int previous_frame_num = 0;
+int ref_flag[17] = {0};
+int Is_primary_correct = 0;
+int Is_redundant_correct = 0;
+int redundant_slice_ref_idx = 0;
+
+int (*nal_startcode_follows) (struct img_par*, int ) = NULL;
+
+FrameStore *last_out_fs = NULL;
+int pocs_in_dpb[100] = {0};
+
+void (*getNeighbour)(unsigned int curr_mb_nr, int xN, int yN, int is_chroma, PixelPos *pix) = NULL;
+void (*get_mb_block_pos) (int mb_addr, int *x, int*y) = NULL;
+
+int **cofAC8x8_intra = NULL;
+int ****cofAC8x8_iintra = NULL;
+
+OldSliceParams old_slice = {0};
+
+const byte SNGL_SCAN[16][2] =
+{
+ {0,0},{1,0},{0,1},{0,2},
+ {1,1},{2,0},{3,0},{2,1},
+ {1,2},{0,3},{1,3},{2,2},
+ {3,1},{3,2},{2,3},{3,3}
+};
+
+const byte FIELD_SCAN[16][2] =
+{
+ {0,0},{0,1},{1,0},{0,2},
+ {0,3},{1,1},{1,2},{1,3},
+ {2,0},{2,1},{2,2},{2,3},
+ {3,0},{3,1},{3,2},{3,3}
+};
+
+const unsigned char NCBP[2][48][2]=
+{
+ { // 0 1 2 3 4 5 6 7 8 9 10 11
+ {15, 0},{ 0, 1},{ 7, 2},{11, 4},{13, 8},{14, 3},{ 3, 5},{ 5,10},{10,12},{12,15},{ 1, 7},{ 2,11},
+ { 4,13},{ 8,14},{ 6, 6},{ 9, 9},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
+ { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
+ { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0}
+ },
+ {
+ {47, 0},{31,16},{15, 1},{ 0, 2},{23, 4},{27, 8},{29,32},{30, 3},{ 7, 5},{11,10},{13,12},{14,15},
+ {39,47},{43, 7},{45,11},{46,13},{16,14},{ 3, 6},{ 5, 9},{10,31},{12,35},{19,37},{21,42},{26,44},
+ {28,33},{35,34},{37,36},{42,40},{44,39},{ 1,43},{ 2,45},{ 4,46},{ 8,17},{17,18},{18,20},{20,24},
+ {24,19},{ 6,21},{ 9,26},{22,28},{25,23},{32,27},{33,29},{34,30},{36,22},{40,25},{38,38},{41,41}
+ }
+};
+
+const int BLOCK_STEP[8][2]=
+{
+ {0,0},{4,4},{4,2},{2,4},{2,2},{2,1},{1,2},{1,1}
+};
+
+const int dequant_coef[6][4][4] = {
+ {{10, 13, 10, 13},{ 13, 16, 13, 16},{10, 13, 10, 13},{ 13, 16, 13, 16}},
+ {{11, 14, 11, 14},{ 14, 18, 14, 18},{11, 14, 11, 14},{ 14, 18, 14, 18}},
+ {{13, 16, 13, 16},{ 16, 20, 16, 20},{13, 16, 13, 16},{ 16, 20, 16, 20}},
+ {{14, 18, 14, 18},{ 18, 23, 18, 23},{14, 18, 14, 18},{ 18, 23, 18, 23}},
+ {{16, 20, 16, 20},{ 20, 25, 20, 25},{16, 20, 16, 20},{ 20, 25, 20, 25}},
+ {{18, 23, 18, 23},{ 23, 29, 23, 29},{18, 23, 18, 23},{ 23, 29, 23, 29}}
+};
+
+const byte QP_SCALE_CR[52]=
+{
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
+ 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
+ 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
+ 37,38,38,38,39,39,39,39
+
+};
+
+const byte SCAN_YUV422[8][2] =
+{
+ {0,0},{0,1},
+ {1,0},{0,2},
+ {0,3},{1,1},
+ {1,2},{1,3}
+};
+
+const unsigned char subblk_offset_x[3][8][4] =
+{
+ { {0, 4, 0, 4},
+ {0, 4, 0, 4},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0}, },
+
+ { {0, 4, 0, 4},
+ {0, 4, 0, 4},
+ {0, 4, 0, 4},
+ {0, 4, 0, 4},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0}, },
+
+ { {0, 4, 0, 4},
+ {8,12, 8,12},
+ {0, 4, 0, 4},
+ {8,12, 8,12},
+ {0, 4, 0, 4},
+ {8,12, 8,12},
+ {0, 4, 0, 4},
+ {8,12, 8,12} }
+};
+
+const unsigned char subblk_offset_y[3][8][4] =
+{ { {0, 0, 4, 4},
+ {0, 0, 4, 4},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0}, },
+
+ { {0, 0, 4, 4},
+ {8, 8,12,12},
+ {0, 0, 4, 4},
+ {8, 8,12,12},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0} },
+
+ { {0, 0, 4, 4},
+ {0, 0, 4, 4},
+ {8, 8,12,12},
+ {8, 8,12,12},
+ {0, 0, 4, 4},
+ {0, 0, 4, 4},
+ {8, 8,12,12},
+ {8, 8,12,12} }
+};
+
+const int block8x8_idx[3][4][4] =
+{ { {0, 1, 2, 3},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0}, },
+
+ { {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0} },
+
+ { {0, 0, 0, 0},
+ {1, 1, 1, 1},
+ {2, 2, 2, 2},
+ {3, 3, 3, 3} }
+};
+
+const byte SNGL_SCAN8x8[64][2] = {
+ {0,0}, {1,0}, {0,1}, {0,2}, {1,1}, {2,0}, {3,0}, {2,1}, {1,2}, {0,3}, {0,4}, {1,3}, {2,2}, {3,1}, {4,0}, {5,0},
+ {4,1}, {3,2}, {2,3}, {1,4}, {0,5}, {0,6}, {1,5}, {2,4}, {3,3}, {4,2}, {5,1}, {6,0}, {7,0}, {6,1}, {5,2}, {4,3},
+ {3,4}, {2,5}, {1,6}, {0,7}, {1,7}, {2,6}, {3,5}, {4,4}, {5,3}, {6,2}, {7,1}, {7,2}, {6,3}, {5,4}, {4,5}, {3,6},
+ {2,7}, {3,7}, {4,6}, {5,5}, {6,4}, {7,3}, {7,4}, {6,5}, {5,6}, {4,7}, {5,7}, {6,6}, {7,5}, {7,6}, {6,7}, {7,7}
+};
+
+const byte FIELD_SCAN8x8[64][2] = {
+ {0,0}, {0,1}, {0,2}, {1,0}, {1,1}, {0,3}, {0,4}, {1,2}, {2,0}, {2,1}, {1,3}, {0,5}, {0,6}, {1,4}, {2,2}, {3,0},
+ {3,1}, {2,3}, {1,5}, {0,7}, {1,6}, {2,4}, {3,2}, {4,0}, {4,1}, {3,3}, {2,5}, {1,7}, {2,6}, {3,4}, {4,2}, {5,0},
+ {5,1}, {4,3}, {3,5}, {2,7}, {3,6}, {4,4}, {5,2}, {6,0}, {6,1}, {5,3}, {4,5}, {3,7}, {4,6}, {5,4}, {6,2}, {7,0},
+ {7,1}, {6,3}, {5,5}, {4,7}, {5,6}, {6,4}, {7,2}, {7,3}, {6,5}, {5,7}, {6,6}, {7,4}, {7,5}, {6,7}, {7,6}, {7,7}
+};
+
+const int dequant_coef8[6][8][8] =
+{
+ {
+ {20, 19, 25, 19, 20, 19, 25, 19},
+ {19, 18, 24, 18, 19, 18, 24, 18},
+ {25, 24, 32, 24, 25, 24, 32, 24},
+ {19, 18, 24, 18, 19, 18, 24, 18},
+ {20, 19, 25, 19, 20, 19, 25, 19},
+ {19, 18, 24, 18, 19, 18, 24, 18},
+ {25, 24, 32, 24, 25, 24, 32, 24},
+ {19, 18, 24, 18, 19, 18, 24, 18}
+ },
+ {
+ {22, 21, 28, 21, 22, 21, 28, 21},
+ {21, 19, 26, 19, 21, 19, 26, 19},
+ {28, 26, 35, 26, 28, 26, 35, 26},
+ {21, 19, 26, 19, 21, 19, 26, 19},
+ {22, 21, 28, 21, 22, 21, 28, 21},
+ {21, 19, 26, 19, 21, 19, 26, 19},
+ {28, 26, 35, 26, 28, 26, 35, 26},
+ {21, 19, 26, 19, 21, 19, 26, 19}
+ },
+ {
+ {26, 24, 33, 24, 26, 24, 33, 24},
+ {24, 23, 31, 23, 24, 23, 31, 23},
+ {33, 31, 42, 31, 33, 31, 42, 31},
+ {24, 23, 31, 23, 24, 23, 31, 23},
+ {26, 24, 33, 24, 26, 24, 33, 24},
+ {24, 23, 31, 23, 24, 23, 31, 23},
+ {33, 31, 42, 31, 33, 31, 42, 31},
+ {24, 23, 31, 23, 24, 23, 31, 23}
+ },
+ {
+ {28, 26, 35, 26, 28, 26, 35, 26},
+ {26, 25, 33, 25, 26, 25, 33, 25},
+ {35, 33, 45, 33, 35, 33, 45, 33},
+ {26, 25, 33, 25, 26, 25, 33, 25},
+ {28, 26, 35, 26, 28, 26, 35, 26},
+ {26, 25, 33, 25, 26, 25, 33, 25},
+ {35, 33, 45, 33, 35, 33, 45, 33},
+ {26, 25, 33, 25, 26, 25, 33, 25}
+ },
+ {
+ {32, 30, 40, 30, 32, 30, 40, 30},
+ {30, 28, 38, 28, 30, 28, 38, 28},
+ {40, 38, 51, 38, 40, 38, 51, 38},
+ {30, 28, 38, 28, 30, 28, 38, 28},
+ {32, 30, 40, 30, 32, 30, 40, 30},
+ {30, 28, 38, 28, 30, 28, 38, 28},
+ {40, 38, 51, 38, 40, 38, 51, 38},
+ {30, 28, 38, 28, 30, 28, 38, 28}
+ },
+ {
+ {36, 34, 46, 34, 36, 34, 46, 34},
+ {34, 32, 43, 32, 34, 32, 43, 32},
+ {46, 43, 58, 43, 46, 43, 58, 43},
+ {34, 32, 43, 32, 34, 32, 43, 32},
+ {36, 34, 46, 34, 36, 34, 46, 34},
+ {34, 32, 43, 32, 34, 32, 43, 32},
+ {46, 43, 58, 43, 46, 43, 58, 43},
+ {34, 32, 43, 32, 34, 32, 43, 32}
+ }
+
+};
+
+unsigned char cofuv_blk_x[3][8][4] =
+{ { {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0} },
+
+ { {0, 1, 0, 1},
+ {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {2, 3, 2, 3},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0} },
+
+ { {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {0, 1, 0, 1},
+ {2, 3, 2, 3},
+ {0, 1, 0, 1},
+ {2, 3, 2, 3} }
+};
+
+unsigned char cofuv_blk_y[3][8][4] =
+{
+ { { 4, 4, 5, 5},
+ { 4, 4, 5, 5},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0} },
+
+ { { 4, 4, 5, 5},
+ { 6, 6, 7, 7},
+ { 4, 4, 5, 5},
+ { 6, 6, 7, 7},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0},
+ { 0, 0, 0, 0} },
+
+ { { 4, 4, 5, 5},
+ { 4, 4, 5, 5},
+ { 6, 6, 7, 7},
+ { 6, 6, 7, 7},
+ { 8, 8, 9, 9},
+ { 8, 8, 9, 9},
+ {10,10,11,11},
+ {10,10,11,11} }
+};
+
+unsigned char cbp_blk_chroma[8][4] =
+{ {16, 17, 18, 19},
+ {20, 21, 22, 23},
+ {24, 25, 26, 27},
+ {28, 29, 30, 31},
+ {32, 33, 34, 35},
+ {36, 37, 38, 39},
+ {40, 41, 42, 43},
+ {44, 45, 46, 47} };
diff --git a/MultiSource/Applications/JM/ldecod/global.h b/MultiSource/Applications/JM/ldecod/global.h
index aea95c384..c8b791906 100644
--- a/MultiSource/Applications/JM/ldecod/global.h
+++ b/MultiSource/Applications/JM/ldecod/global.h
@@ -41,39 +41,39 @@ typedef unsigned char byte; //!< 8 bit unsigned
typedef unsigned short imgpel; //!< Pixel type definition (16 bit for FRExt)
//typedef unsigned char imgpel; //!< Pixel type definition (8 bit without FRExt)
-pic_parameter_set_rbsp_t *active_pps;
-seq_parameter_set_rbsp_t *active_sps;
+extern pic_parameter_set_rbsp_t *active_pps;
+extern seq_parameter_set_rbsp_t *active_sps;
// global picture format dependent buffers, memory allocation in decod.c
-imgpel **imgY_ref; //!< reference frame find snr
-imgpel ***imgUV_ref;
+extern imgpel **imgY_ref; //!< reference frame find snr
+extern imgpel ***imgUV_ref;
-int **PicPos;
-int ReMapRef[20];
+extern int **PicPos;
+extern int ReMapRef[20];
// B pictures
-int Bframe_ctr;
-int frame_no;
+extern int Bframe_ctr;
+extern int frame_no;
-int g_nFrame;
+extern int g_nFrame;
// For MB level frame/field coding
-int TopFieldForSkip_Y[16][16];
-int TopFieldForSkip_UV[2][16][16];
+extern int TopFieldForSkip_Y[16][16];
+extern int TopFieldForSkip_UV[2][16][16];
-int InvLevelScale4x4Luma_Intra[6][4][4];
-int InvLevelScale4x4Chroma_Intra[2][6][4][4];
+extern int InvLevelScale4x4Luma_Intra[6][4][4];
+extern int InvLevelScale4x4Chroma_Intra[2][6][4][4];
-int InvLevelScale4x4Luma_Inter[6][4][4];
-int InvLevelScale4x4Chroma_Inter[2][6][4][4];
+extern int InvLevelScale4x4Luma_Inter[6][4][4];
+extern int InvLevelScale4x4Chroma_Inter[2][6][4][4];
-int InvLevelScale8x8Luma_Intra[6][8][8];
+extern int InvLevelScale8x8Luma_Intra[6][8][8];
-int InvLevelScale8x8Luma_Inter[6][8][8];
+extern int InvLevelScale8x8Luma_Inter[6][8][8];
-int *qmatrix[8];
+extern int *qmatrix[8];
#define ET_SIZE 300 //!< size of error text buffer
-char errortext[ET_SIZE]; //!< buffer for error message for exit with error()
+extern char errortext[ET_SIZE]; //!< buffer for error message for exit with error()
/***********************************************************************
* T y p e d e f i n i t i o n s f o r T M L
@@ -629,7 +629,7 @@ struct snr_par
float msse_v; //!< Average SSE V
};
-time_t tot_time;
+extern time_t tot_time;
// input parameters from configuration file
struct inp_par
@@ -686,23 +686,23 @@ typedef struct old_slice_par
extern OldSliceParams old_slice;
// files
-int p_out; //!< file descriptor to output YUV file
+extern int p_out; //!< file descriptor to output YUV file
//FILE *p_out2; //!< pointer to debug output YUV file
-int p_ref; //!< pointer to input original reference YUV file file
+extern int p_ref; //!< pointer to input original reference YUV file file
-FILE *p_log; //!< SNR file
+extern FILE *p_log; //!< SNR file
#if TRACE
-FILE *p_trace;
+extern FILE *p_trace;
#endif
// Redundant slices
-unsigned int previous_frame_num; //!< frame number of previous slice
-int ref_flag[17]; //!< 0: i-th previous frame is incorrect
+extern unsigned int previous_frame_num; //!< frame number of previous slice
+extern int ref_flag[17]; //!< 0: i-th previous frame is incorrect
//!< non-zero: i-th previous frame is correct
-int Is_primary_correct; //!< if primary frame is correct, 0: incorrect
-int Is_redundant_correct; //!< if redundant frame is correct, 0:incorrect
-int redundant_slice_ref_idx; //!< reference index of redundant slice
+extern int Is_primary_correct; //!< if primary frame is correct, 0: incorrect
+extern int Is_redundant_correct; //!< if redundant frame is correct, 0:incorrect
+extern int redundant_slice_ref_idx; //!< reference index of redundant slice
void Error_tracking(void);
// prototypes
@@ -745,7 +745,7 @@ int intrapred_luma_16x16(struct img_par *img,int predmode);
void intrapred_chroma(struct img_par *img, int uv);
// SLICE function pointers
-int (*nal_startcode_follows) (struct img_par*, int );
+extern int (*nal_startcode_follows) (struct img_par*, int );
// NAL functions TML/CABAC bitstream
int uvlc_startcode_follows(struct img_par *img, int dummy);
diff --git a/MultiSource/Applications/JM/ldecod/image.c b/MultiSource/Applications/JM/ldecod/image.c
index dac7c449c..9cdc611c2 100644
--- a/MultiSource/Applications/JM/ldecod/image.c
+++ b/MultiSource/Applications/JM/ldecod/image.c
@@ -90,11 +90,9 @@ extern StorablePicture **listX[6];
extern ColocatedParams *Co_located;
extern StorablePicture *no_reference_picture;
-int non_conforming_stream;
+int non_conforming_stream = 0;
-StorablePicture *dec_picture;
-
-OldSliceParams old_slice;
+StorablePicture *dec_picture = NULL;
void MbAffPostProc()
{
diff --git a/MultiSource/Applications/JM/ldecod/ldecod.c b/MultiSource/Applications/JM/ldecod/ldecod.c
index fa5dc6cd6..572ecd26c 100644
--- a/MultiSource/Applications/JM/ldecod/ldecod.c
+++ b/MultiSource/Applications/JM/ldecod/ldecod.c
@@ -95,9 +95,9 @@ extern ColocatedParams *Co_located;
extern FILE* bits;
extern StorablePicture* dec_picture;
-struct inp_par *input; //!< input parameters from input configuration file
-struct snr_par *snr; //!< statistics
-struct img_par *img; //!< image parameters
+struct inp_par *input = NULL; //!< input parameters from input configuration file
+struct snr_par *snr = NULL; //!< statistics
+struct img_par *img = NULL; //!< image parameters
int global_init_done = 0;
diff --git a/MultiSource/Applications/JM/ldecod/loopFilter.c b/MultiSource/Applications/JM/ldecod/loopFilter.c
index 21cc31e9b..bd8423267 100644
--- a/MultiSource/Applications/JM/ldecod/loopFilter.c
+++ b/MultiSource/Applications/JM/ldecod/loopFilter.c
@@ -26,7 +26,7 @@
#include "mb_access.h"
#include "loopfilter.h"
-byte mixedModeEdgeFlag, fieldModeFilteringFlag;
+byte mixedModeEdgeFlag = 0, fieldModeFilteringFlag = 0;
/*********************************************************************************************************/
diff --git a/MultiSource/Applications/JM/ldecod/macroblock.h b/MultiSource/Applications/JM/ldecod/macroblock.h
index 46ba5cdcc..89197a6b3 100644
--- a/MultiSource/Applications/JM/ldecod/macroblock.h
+++ b/MultiSource/Applications/JM/ldecod/macroblock.h
@@ -1,4 +1,3 @@
-
/*!
************************************************************************
* \file macroblock.h
@@ -17,74 +16,26 @@
//! single scan pattern
-const byte SNGL_SCAN[16][2] =
-{
- {0,0},{1,0},{0,1},{0,2},
- {1,1},{2,0},{3,0},{2,1},
- {1,2},{0,3},{1,3},{2,2},
- {3,1},{3,2},{2,3},{3,3}
-};
+extern const byte SNGL_SCAN[16][2];
//! field scan pattern
-const byte FIELD_SCAN[16][2] =
-{
- {0,0},{0,1},{1,0},{0,2},
- {0,3},{1,1},{1,2},{1,3},
- {2,0},{2,1},{2,2},{2,3},
- {3,0},{3,1},{3,2},{3,3}
-};
+extern const byte FIELD_SCAN[16][2];
//! gives CBP value from codeword number, both for intra and inter
-const unsigned char NCBP[2][48][2]=
-{
- { // 0 1 2 3 4 5 6 7 8 9 10 11
- {15, 0},{ 0, 1},{ 7, 2},{11, 4},{13, 8},{14, 3},{ 3, 5},{ 5,10},{10,12},{12,15},{ 1, 7},{ 2,11},
- { 4,13},{ 8,14},{ 6, 6},{ 9, 9},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
- { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
- { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0}
- },
- {
- {47, 0},{31,16},{15, 1},{ 0, 2},{23, 4},{27, 8},{29,32},{30, 3},{ 7, 5},{11,10},{13,12},{14,15},
- {39,47},{43, 7},{45,11},{46,13},{16,14},{ 3, 6},{ 5, 9},{10,31},{12,35},{19,37},{21,42},{26,44},
- {28,33},{35,34},{37,36},{42,40},{44,39},{ 1,43},{ 2,45},{ 4,46},{ 8,17},{17,18},{18,20},{20,24},
- {24,19},{ 6,21},{ 9,26},{22,28},{25,23},{32,27},{33,29},{34,30},{36,22},{40,25},{38,38},{41,41}
- }
-};
+extern const unsigned char NCBP[2][48][2];
//! used to control block sizes : Not used/16x16/16x8/8x16/8x8/8x4/4x8/4x4
-const int BLOCK_STEP[8][2]=
-{
- {0,0},{4,4},{4,2},{2,4},{2,2},{2,1},{1,2},{1,1}
-};
+extern const int BLOCK_STEP[8][2];
//! Dequantization coefficients
-const int dequant_coef[6][4][4] = {
- {{10, 13, 10, 13},{ 13, 16, 13, 16},{10, 13, 10, 13},{ 13, 16, 13, 16}},
- {{11, 14, 11, 14},{ 14, 18, 14, 18},{11, 14, 11, 14},{ 14, 18, 14, 18}},
- {{13, 16, 13, 16},{ 16, 20, 16, 20},{13, 16, 13, 16},{ 16, 20, 16, 20}},
- {{14, 18, 14, 18},{ 18, 23, 18, 23},{14, 18, 14, 18},{ 18, 23, 18, 23}},
- {{16, 20, 16, 20},{ 20, 25, 20, 25},{16, 20, 16, 20},{ 20, 25, 20, 25}},
- {{18, 23, 18, 23},{ 23, 29, 23, 29},{18, 23, 18, 23},{ 23, 29, 23, 29}}
-};
+extern const int dequant_coef[6][4][4];
-const byte QP_SCALE_CR[52]=
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
- 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
- 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
- 37,38,38,38,39,39,39,39
-
-};
+extern const byte QP_SCALE_CR[52];
//! single scan pattern
-const byte SNGL_SCAN8x8[64][2] = {
- {0,0}, {1,0}, {0,1}, {0,2}, {1,1}, {2,0}, {3,0}, {2,1}, {1,2}, {0,3}, {0,4}, {1,3}, {2,2}, {3,1}, {4,0}, {5,0},
- {4,1}, {3,2}, {2,3}, {1,4}, {0,5}, {0,6}, {1,5}, {2,4}, {3,3}, {4,2}, {5,1}, {6,0}, {7,0}, {6,1}, {5,2}, {4,3},
- {3,4}, {2,5}, {1,6}, {0,7}, {1,7}, {2,6}, {3,5}, {4,4}, {5,3}, {6,2}, {7,1}, {7,2}, {6,3}, {5,4}, {4,5}, {3,6},
- {2,7}, {3,7}, {4,6}, {5,5}, {6,4}, {7,3}, {7,4}, {6,5}, {5,6}, {4,7}, {5,7}, {6,6}, {7,5}, {7,6}, {6,7}, {7,7}
-};
+extern const byte SNGL_SCAN8x8[64][2];
/*
//! field scan pattern
@@ -98,238 +49,30 @@ const byte FIELD_SCAN8x8[64][2] = {
//! field scan pattern
//original from ABT
-const byte FIELD_SCAN8x8[64][2] = { // 8x8
- {0,0}, {0,1}, {0,2}, {1,0}, {1,1}, {0,3}, {0,4}, {1,2}, {2,0}, {1,3}, {0,5}, {0,6}, {0,7}, {1,4}, {2,1}, {3,0},
- {2,2}, {1,5}, {1,6}, {1,7}, {2,3}, {3,1}, {4,0}, {3,2}, {2,4}, {2,5}, {2,6}, {2,7}, {3,3}, {4,1}, {5,0}, {4,2},
- {3,4}, {3,5}, {3,6}, {3,7}, {4,3}, {5,1}, {6,0}, {5,2}, {4,4}, {4,5}, {4,6}, {4,7}, {5,3}, {6,1}, {6,2}, {5,4},
- {5,5}, {5,6}, {5,7}, {6,3}, {7,0}, {7,1}, {6,4}, {6,5}, {6,6}, {6,7}, {7,2}, {7,3}, {7,4}, {7,5}, {7,6}, {7,7}
-};
+extern const byte FIELD_SCAN8x8[64][2];
-static const int dequant_coef8[6][8][8] =
-{
- {
- {20, 19, 25, 19, 20, 19, 25, 19},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {25, 24, 32, 24, 25, 24, 32, 24},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {20, 19, 25, 19, 20, 19, 25, 19},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {25, 24, 32, 24, 25, 24, 32, 24},
- {19, 18, 24, 18, 19, 18, 24, 18}
- },
- {
- {22, 21, 28, 21, 22, 21, 28, 21},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {22, 21, 28, 21, 22, 21, 28, 21},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {21, 19, 26, 19, 21, 19, 26, 19}
- },
- {
- {26, 24, 33, 24, 26, 24, 33, 24},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {33, 31, 42, 31, 33, 31, 42, 31},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {26, 24, 33, 24, 26, 24, 33, 24},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {33, 31, 42, 31, 33, 31, 42, 31},
- {24, 23, 31, 23, 24, 23, 31, 23}
- },
- {
- {28, 26, 35, 26, 28, 26, 35, 26},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {35, 33, 45, 33, 35, 33, 45, 33},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {35, 33, 45, 33, 35, 33, 45, 33},
- {26, 25, 33, 25, 26, 25, 33, 25}
- },
- {
- {32, 30, 40, 30, 32, 30, 40, 30},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {40, 38, 51, 38, 40, 38, 51, 38},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {32, 30, 40, 30, 32, 30, 40, 30},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {40, 38, 51, 38, 40, 38, 51, 38},
- {30, 28, 38, 28, 30, 28, 38, 28}
- },
- {
- {36, 34, 46, 34, 36, 34, 46, 34},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {46, 43, 58, 43, 46, 43, 58, 43},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {36, 34, 46, 34, 36, 34, 46, 34},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {46, 43, 58, 43, 46, 43, 58, 43},
- {34, 32, 43, 32, 34, 32, 43, 32}
- }
-
-};
+extern const int dequant_coef8[6][8][8];
//! single scan pattern
-const byte SCAN_YUV422[8][2] =
-{
- {0,0},{0,1},
- {1,0},{0,2},
- {0,3},{1,1},
- {1,2},{1,3}
-};
+extern const byte SCAN_YUV422[8][2];
//! look up tables for FRExt_chroma support
-const unsigned char subblk_offset_x[3][8][4] =
-{
- { {0, 4, 0, 4},
- {0, 4, 0, 4},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0}, },
-
- { {0, 4, 0, 4},
- {0, 4, 0, 4},
- {0, 4, 0, 4},
- {0, 4, 0, 4},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0}, },
+extern const unsigned char subblk_offset_x[3][8][4];
- { {0, 4, 0, 4},
- {8,12, 8,12},
- {0, 4, 0, 4},
- {8,12, 8,12},
- {0, 4, 0, 4},
- {8,12, 8,12},
- {0, 4, 0, 4},
- {8,12, 8,12} }
-};
+extern const unsigned char subblk_offset_y[3][8][4];
-const unsigned char subblk_offset_y[3][8][4] =
-{ { {0, 0, 4, 4},
- {0, 0, 4, 4},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0}, },
- { {0, 0, 4, 4},
- {8, 8,12,12},
- {0, 0, 4, 4},
- {8, 8,12,12},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0} },
-
- { {0, 0, 4, 4},
- {0, 0, 4, 4},
- {8, 8,12,12},
- {8, 8,12,12},
- {0, 0, 4, 4},
- {0, 0, 4, 4},
- {8, 8,12,12},
- {8, 8,12,12} }
-};
-
-
-static unsigned char cofuv_blk_x[3][8][4] =
-{ { {0, 1, 0, 1},
- {2, 3, 2, 3},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0} },
-
- { {0, 1, 0, 1},
- {0, 1, 0, 1},
- {2, 3, 2, 3},
- {2, 3, 2, 3},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0} },
-
- { {0, 1, 0, 1},
- {2, 3, 2, 3},
- {0, 1, 0, 1},
- {2, 3, 2, 3},
- {0, 1, 0, 1},
- {2, 3, 2, 3},
- {0, 1, 0, 1},
- {2, 3, 2, 3} }
-};
+extern unsigned char cofuv_blk_x[3][8][4];
-static unsigned char cofuv_blk_y[3][8][4] =
-{
- { { 4, 4, 5, 5},
- { 4, 4, 5, 5},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0} },
+extern unsigned char cofuv_blk_y[3][8][4];
- { { 4, 4, 5, 5},
- { 6, 6, 7, 7},
- { 4, 4, 5, 5},
- { 6, 6, 7, 7},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0} },
+extern unsigned char cbp_blk_chroma[8][4];
- { { 4, 4, 5, 5},
- { 4, 4, 5, 5},
- { 6, 6, 7, 7},
- { 6, 6, 7, 7},
- { 8, 8, 9, 9},
- { 8, 8, 9, 9},
- {10,10,11,11},
- {10,10,11,11} }
-};
-
-static unsigned char cbp_blk_chroma[8][4] =
-{ {16, 17, 18, 19},
- {20, 21, 22, 23},
- {24, 25, 26, 27},
- {28, 29, 30, 31},
- {32, 33, 34, 35},
- {36, 37, 38, 39},
- {40, 41, 42, 43},
- {44, 45, 46, 47} };
-
-
-int block8x8_idx[3][4][4] =
-{ { {0, 1, 2, 3},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0}, },
- { {0, 1, 0, 1},
- {2, 3, 2, 3},
- {0, 0, 0, 0},
- {0, 0, 0, 0} },
-
- { {0, 0, 0, 0},
- {1, 1, 1, 1},
- {2, 2, 2, 2},
- {3, 3, 3, 3} }
-};
+extern const int block8x8_idx[3][4][4];
#define _NEW_8x8_ARRAYS_INCLUDED_
#endif
-
diff --git a/MultiSource/Applications/JM/ldecod/mb_access.h b/MultiSource/Applications/JM/ldecod/mb_access.h
index 37b6c5295..059198ab9 100644
--- a/MultiSource/Applications/JM/ldecod/mb_access.h
+++ b/MultiSource/Applications/JM/ldecod/mb_access.h
@@ -18,7 +18,7 @@
void CheckAvailabilityOfNeighbors(void);
//void getNeighbour(int curr_mb_nr, int xN, int yN, int luma, PixelPos *pix);
-void (*getNeighbour)(unsigned int curr_mb_nr, int xN, int yN, int is_chroma, PixelPos *pix);
+extern void (*getNeighbour)(unsigned int curr_mb_nr, int xN, int yN, int is_chroma, PixelPos *pix);
void getAffNeighbour(unsigned int curr_mb_nr, int xN, int yN, int is_chroma, PixelPos *pix);
void getNonAffNeighbour(unsigned int curr_mb_nr, int xN, int yN, int is_chroma, PixelPos *pix);
@@ -27,7 +27,7 @@ void getChroma4x4Neighbour (int curr_mb_nr, int block_x, int block_y, PixelPos *
int mb_is_available(int mbAddr, int currMbAddr);
void get_mb_pos (int mb_addr, int *x, int*y, int is_chroma);
-void (*get_mb_block_pos) (int mb_addr, int *x, int*y);
+extern void (*get_mb_block_pos) (int mb_addr, int *x, int*y);
void get_mb_block_pos_normal (int mb_addr, int *x, int*y);
void get_mb_block_pos_mbaff (int mb_addr, int *x, int*y);
diff --git a/MultiSource/Applications/JM/ldecod/mbuffer.c b/MultiSource/Applications/JM/ldecod/mbuffer.c
index 9d02844d2..a92804c76 100644
--- a/MultiSource/Applications/JM/ldecod/mbuffer.c
+++ b/MultiSource/Applications/JM/ldecod/mbuffer.c
@@ -43,17 +43,17 @@ static int is_short_term_reference(FrameStore* fs);
static int is_long_term_reference(FrameStore* fs);
void gen_field_ref_ids(StorablePicture *p);
-DecodedPictureBuffer dpb;
+DecodedPictureBuffer dpb = {0};
-StorablePicture **listX[6];
+StorablePicture **listX[6] = {NULL};
-StorablePicture *no_reference_picture; //!< dummy storable picture for recovery point
+StorablePicture *no_reference_picture = NULL; //!< dummy storable picture for recovery point
ColocatedParams *Co_located = NULL;
extern StorablePicture *dec_picture;
-int listXsize[6];
+int listXsize[6] = {0};
#define MAX_LIST_SIZE 33
diff --git a/MultiSource/Applications/JM/ldecod/nal_part.c b/MultiSource/Applications/JM/ldecod/nal_part.c
index ae8dba4b5..676db3aa6 100644
--- a/MultiSource/Applications/JM/ldecod/nal_part.c
+++ b/MultiSource/Applications/JM/ldecod/nal_part.c
@@ -25,7 +25,7 @@ int assignSE2partition[][SE_MAX_ELEMENTS] =
{ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 2, 2, 2, 2, 0, 0, 0, 0 } //!< three partitions per slice
};
-int PartitionMode;
+int PartitionMode = 0;
/*!
************************************************************************
diff --git a/MultiSource/Applications/JM/ldecod/output.c b/MultiSource/Applications/JM/ldecod/output.c
index cb5c04bb3..0d5e7c223 100644
--- a/MultiSource/Applications/JM/ldecod/output.c
+++ b/MultiSource/Applications/JM/ldecod/output.c
@@ -29,7 +29,7 @@
#include "image.h"
#include "memalloc.h"
-FrameStore* out_buffer;
+FrameStore* out_buffer = NULL;
StorablePicture *pending_output = NULL;
int pending_output_state = FRAME;
diff --git a/MultiSource/Applications/JM/ldecod/parset.c b/MultiSource/Applications/JM/ldecod/parset.c
index 1b662a171..4f1b3139e 100644
--- a/MultiSource/Applications/JM/ldecod/parset.c
+++ b/MultiSource/Applications/JM/ldecod/parset.c
@@ -52,8 +52,8 @@ extern int quant_inter_default[16];
extern int quant8_intra_default[64];
extern int quant8_inter_default[64];
-seq_parameter_set_rbsp_t SeqParSet[MAXSPS];
-pic_parameter_set_rbsp_t PicParSet[MAXPPS];
+seq_parameter_set_rbsp_t SeqParSet[MAXSPS] = {{{0}}};
+pic_parameter_set_rbsp_t PicParSet[MAXPPS] = {{{0}}};
extern StorablePicture* dec_picture;
diff --git a/MultiSource/Applications/JM/ldecod/rtp.c b/MultiSource/Applications/JM/ldecod/rtp.c
index a61698196..0792a67e3 100644
--- a/MultiSource/Applications/JM/ldecod/rtp.c
+++ b/MultiSource/Applications/JM/ldecod/rtp.c
@@ -107,7 +107,7 @@
#include <netinet/in.h>
#endif
-FILE *bits;
+extern FILE *bits;
int RTPReadPacket (RTPpacket_t *p, FILE *bits);
diff --git a/MultiSource/Applications/JM/ldecod/transform8x8.c b/MultiSource/Applications/JM/ldecod/transform8x8.c
index caf58f276..333df2dec 100644
--- a/MultiSource/Applications/JM/ldecod/transform8x8.c
+++ b/MultiSource/Applications/JM/ldecod/transform8x8.c
@@ -23,7 +23,7 @@
#define Q_BITS_8 16
#define DQ_BITS_8 6
-const int quant_coef8[6][8][8] =
+static const int quant_coef8[6][8][8] =
{
{
{13107, 12222, 16777, 12222, 13107, 12222, 16777, 12222},
@@ -89,93 +89,11 @@ const int quant_coef8[6][8][8] =
-const int dequant_coef8[6][8][8] =
-{
- {
- {20, 19, 25, 19, 20, 19, 25, 19},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {25, 24, 32, 24, 25, 24, 32, 24},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {20, 19, 25, 19, 20, 19, 25, 19},
- {19, 18, 24, 18, 19, 18, 24, 18},
- {25, 24, 32, 24, 25, 24, 32, 24},
- {19, 18, 24, 18, 19, 18, 24, 18}
- },
- {
- {22, 21, 28, 21, 22, 21, 28, 21},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {22, 21, 28, 21, 22, 21, 28, 21},
- {21, 19, 26, 19, 21, 19, 26, 19},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {21, 19, 26, 19, 21, 19, 26, 19}
- },
- {
- {26, 24, 33, 24, 26, 24, 33, 24},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {33, 31, 42, 31, 33, 31, 42, 31},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {26, 24, 33, 24, 26, 24, 33, 24},
- {24, 23, 31, 23, 24, 23, 31, 23},
- {33, 31, 42, 31, 33, 31, 42, 31},
- {24, 23, 31, 23, 24, 23, 31, 23}
- },
- {
- {28, 26, 35, 26, 28, 26, 35, 26},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {35, 33, 45, 33, 35, 33, 45, 33},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {28, 26, 35, 26, 28, 26, 35, 26},
- {26, 25, 33, 25, 26, 25, 33, 25},
- {35, 33, 45, 33, 35, 33, 45, 33},
- {26, 25, 33, 25, 26, 25, 33, 25}
- },
- {
- {32, 30, 40, 30, 32, 30, 40, 30},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {40, 38, 51, 38, 40, 38, 51, 38},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {32, 30, 40, 30, 32, 30, 40, 30},
- {30, 28, 38, 28, 30, 28, 38, 28},
- {40, 38, 51, 38, 40, 38, 51, 38},
- {30, 28, 38, 28, 30, 28, 38, 28}
- },
- {
- {36, 34, 46, 34, 36, 34, 46, 34},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {46, 43, 58, 43, 46, 43, 58, 43},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {36, 34, 46, 34, 36, 34, 46, 34},
- {34, 32, 43, 32, 34, 32, 43, 32},
- {46, 43, 58, 43, 46, 43, 58, 43},
- {34, 32, 43, 32, 34, 32, 43, 32}
- }
-
-};
-
-
-
#ifdef _NEW_8x8_ARRAYS_INCLUDED_
-//! single scan pattern
-const byte SNGL_SCAN8x8[64][2] = {
- {0,0}, {1,0}, {0,1}, {0,2}, {1,1}, {2,0}, {3,0}, {2,1}, {1,2}, {0,3}, {0,4}, {1,3}, {2,2}, {3,1}, {4,0}, {5,0},
- {4,1}, {3,2}, {2,3}, {1,4}, {0,5}, {0,6}, {1,5}, {2,4}, {3,3}, {4,2}, {5,1}, {6,0}, {7,0}, {6,1}, {5,2}, {4,3},
- {3,4}, {2,5}, {1,6}, {0,7}, {1,7}, {2,6}, {3,5}, {4,4}, {5,3}, {6,2}, {7,1}, {7,2}, {6,3}, {5,4}, {4,5}, {3,6},
- {2,7}, {3,7}, {4,6}, {5,5}, {6,4}, {7,3}, {7,4}, {6,5}, {5,6}, {4,7}, {5,7}, {6,6}, {7,5}, {7,6}, {6,7}, {7,7}
-};
-
-//! field scan pattern
-const byte FIELD_SCAN8x8[64][2] = {
- {0,0}, {0,1}, {0,2}, {1,0}, {1,1}, {0,3}, {0,4}, {1,2}, {2,0}, {2,1}, {1,3}, {0,5}, {0,6}, {1,4}, {2,2}, {3,0},
- {3,1}, {2,3}, {1,5}, {0,7}, {1,6}, {2,4}, {3,2}, {4,0}, {4,1}, {3,3}, {2,5}, {1,7}, {2,6}, {3,4}, {4,2}, {5,0},
- {5,1}, {4,3}, {3,5}, {2,7}, {3,6}, {4,4}, {5,2}, {6,0}, {6,1}, {5,3}, {4,5}, {3,7}, {4,6}, {5,4}, {6,2}, {7,0},
- {7,1}, {6,3}, {5,5}, {4,7}, {5,6}, {6,4}, {7,2}, {7,3}, {6,5}, {5,7}, {6,6}, {7,4}, {7,5}, {6,7}, {7,6}, {7,7}
-};
//! array used to find expencive coefficients
-const byte COEFF_COST8x8[64] =
+static const byte COEFF_COST8x8[64] =
{
3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
diff --git a/MultiSource/Applications/JM/ldecod/transform8x8.h b/MultiSource/Applications/JM/ldecod/transform8x8.h
index e328ab86e..ced42ebc0 100644
--- a/MultiSource/Applications/JM/ldecod/transform8x8.h
+++ b/MultiSource/Applications/JM/ldecod/transform8x8.h
@@ -24,7 +24,7 @@
#include <math.h>
-int **cofAC8x8_intra, ****cofAC8x8_iintra; // [level/run][scan_pos]
+extern int **cofAC8x8_intra, ****cofAC8x8_iintra; // [level/run][scan_pos]
void intrapred_luma8x8(int img_x,int img_y, int *left_available, int *up_available, int *all_available);
diff --git a/MultiSource/Applications/JM/ldecod/vlc.c b/MultiSource/Applications/JM/ldecod/vlc.c
index 291d2a5a9..91705c3f1 100644
--- a/MultiSource/Applications/JM/ldecod/vlc.c
+++ b/MultiSource/Applications/JM/ldecod/vlc.c
@@ -35,7 +35,7 @@
extern void tracebits(const char *trace_str, int len, int info,int value1);
-int UsedBits; // for internal statistics, is adjusted by se_v, ue_v, u_1
+int UsedBits = 0; // for internal statistics, is adjusted by se_v, ue_v, u_1
// Note that all NA values are filled with 0
--
2.53.0.1213.gd9a14994de-goog