Commit a75462ea authored by Loren Merritt's avatar Loren Merritt

cosmetics: merge some duplicate tables



git-svn-id: svn://svn.videolan.org/x264/trunk@322 df754926-b1dd-0310-bc7b-ec298dee348c
parent 1c6ccbf5
......@@ -509,5 +509,8 @@ struct x264_t
#endif
};
// included at the end because it needs x264_t
#include "macroblock.h"
#endif
......@@ -26,7 +26,6 @@
#include <string.h>
#include "common.h"
#include "macroblock.h"
x264_frame_t *x264_frame_new( x264_t *h )
{
......@@ -224,25 +223,8 @@ void x264_frame_expand_border_lowres( x264_frame_t *frame )
}
/* FIXME theses tables are duplicated with the ones in macroblock.c */
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10},
{ 1, 3, 9, 11},
{ 4, 6, 12, 14},
{ 5, 7, 13, 15}
};
static const int i_chroma_qp_table[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
};
/* Deblocking filter */
/* Deblocking filter (p153) */
static const int i_alpha_table[52] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......
......@@ -26,23 +26,6 @@
#include <string.h>
#include "common.h"
#include "macroblock.h"
static const uint8_t block_idx_x[16] =
{
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] =
{
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10},
{ 1, 3, 9, 11},
{ 4, 6, 12, 14},
{ 5, 7, 13, 15}
};
static const int dequant_mf[6][4][4] =
{
......@@ -54,65 +37,6 @@ static const int dequant_mf[6][4][4] =
{ {18, 23, 18, 23}, {23, 29, 23, 29}, {18, 23, 18, 23}, {23, 29, 23, 29} }
};
static const int dequant8_mf[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}
}
};
int x264_mb_predict_intra4x4_mode( x264_t *h, int idx )
{
const int ma = h->mb.cache.intra4x4_pred_mode[x264_scan8[idx] - 1];
......
......@@ -173,6 +173,32 @@ static const int x264_zigzag_scan8[64] =
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63
};
static const uint8_t block_idx_x[16] =
{
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] =
{
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10 },
{ 1, 3, 9, 11 },
{ 4, 6, 12, 14 },
{ 5, 7, 13, 15 }
};
static const int i_chroma_qp_table[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
};
void x264_macroblock_cache_init( x264_t *h );
void x264_macroblock_slice_init( x264_t *h );
......
......@@ -33,7 +33,6 @@
#include <stdarg.h>
#include "common.h"
#include "macroblock.h"
#ifdef _MSC_VER
#undef HAVE_MMXEXT /* not finished now */
......
......@@ -49,7 +49,6 @@
#include "common.h"
#include "visualize.h"
#include "macroblock.h"
#include "display.h"
typedef struct {
......
......@@ -29,7 +29,6 @@
#include <limits.h>
#include "common/common.h"
#include "common/macroblock.h"
#include "macroblock.h"
#include "me.h"
#include "ratecontrol.h"
......@@ -143,13 +142,6 @@ static const int i_qp0_cost2_table[52] = {
3686,4645,5852,7373
};
static const uint8_t block_idx_x[16] = {
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] = {
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
/* TODO: calculate CABAC costs */
static const int i_mb_b_cost_table[19] = {
9, 9, 9, 9, 0, 0, 0, 1, 3, 7, 7, 7, 3, 7, 7, 7, 5, 9, 0
......
......@@ -28,22 +28,6 @@
#include "common/common.h"
#include "macroblock.h"
static const uint8_t block_idx_x[16] =
{
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] =
{
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10},
{ 1, 3, 9, 11},
{ 4, 6, 12, 14},
{ 5, 7, 13, 15}
};
static inline void x264_cabac_encode_ue_bypass( x264_cabac_t *cb, int exp_bits, int val )
{
int k;
......
......@@ -56,22 +56,6 @@ static const uint8_t sub_mb_type_b_to_golomb[13]=
10, 4, 5, 1, 11, 6, 7, 2, 12, 8, 9, 3, 0
};
static const uint8_t block_idx_x[16] =
{
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] =
{
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10},
{ 1, 3, 9, 11},
{ 4, 6, 12, 14},
{ 5, 7, 13, 15}
};
#define BLOCK_INDEX_CHROMA_DC (-1)
#define BLOCK_INDEX_LUMA_DC (-2)
......
......@@ -29,22 +29,6 @@
#include "macroblock.h"
static const uint8_t block_idx_x[16] =
{
0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
};
static const uint8_t block_idx_y[16] =
{
0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
};
static const uint8_t block_idx_xy[4][4] =
{
{ 0, 2, 8, 10 },
{ 1, 3, 9, 11 },
{ 4, 6, 12, 14 },
{ 5, 7, 13, 15 }
};
/* def_quant4_mf only for probe_skip; actual encoding uses matrices from set.c */
/* FIXME this seems to make better decisions with cqm=jvt, but could screw up
* with general custom matrices. */
......@@ -64,16 +48,6 @@ static const int def_quant4_mf[6][4][4] =
{ 7282, 4559, 7282, 4559 }, { 4559, 2893, 4559, 2893 } }
};
static const int i_chroma_qp_table[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
};
/****************************************************************************
* Scan and Quant functions
****************************************************************************/
......
......@@ -34,7 +34,6 @@
#include "common/common.h"
#include "common/cpu.h"
#include "common/macroblock.h"
#include "ratecontrol.h"
#if defined(SYS_FREEBSD) || defined(SYS_BEOS) || defined(SYS_NETBSD)
......
......@@ -34,7 +34,6 @@
#include "x264.h"
#include "common/common.h"
#include "common/macroblock.h"
#ifndef _MSC_VER
#include "config.h"
#endif
......
......@@ -26,7 +26,6 @@
#include <limits.h>
#include "common/common.h"
#include "common/macroblock.h"
#include "common/cpu.h"
#include "macroblock.h"
#include "me.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment