From 05afc5f57d19ab403f4c798b5a479ae016a2307c Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 4 Apr 2012 17:13:13 +0200 Subject: [PATCH] dv: Move static tables only used in one place to where they are used. --- libavcodec/dv.c | 31 +++++++++++++++++++++++++++++++ libavcodec/dvdec.c | 2 ++ libavcodec/dvquant.h | 32 -------------------------------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 1a0075b..86ff211 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -167,6 +167,15 @@ static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq, } } +/* quantization quanta by QNO for DV100 */ +static const uint8_t dv100_qstep[16] = { + 1, /* QNO = 0 and 1 both have no quantization */ + 1, + 2, 3, 4, 5, 6, 7, 8, 16, 18, 20, 22, 24, 28, 52 +}; + +static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 }; + int ff_dv_init_dynamic_tables(const DVprofile *d) { int j,i,c,s,p; @@ -467,6 +476,28 @@ static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data, return 0; } +static const int dv_weight_bits = 18; +static const int dv_weight_88[64] = { + 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536, + 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935, + 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916, + 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433, + 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704, + 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568, + 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627, + 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258, +}; +static const int dv_weight_248[64] = { + 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754, + 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536, + 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568, + 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965, + 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627, + 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965, + 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364, + 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651, +}; + static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, int linesize, DVVideoContext *s, int bias) { const int *weight; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 8f52959..582574b 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -54,6 +54,8 @@ typedef struct BlockInfo { int shift_offset; } BlockInfo; +static const int dv_iweight_bits = 14; + /* decode AC coefficients */ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block) { diff --git a/libavcodec/dvquant.h b/libavcodec/dvquant.h index 7bd0cdc..feb778a 100644 --- a/libavcodec/dvquant.h +++ b/libavcodec/dvquant.h @@ -56,39 +56,7 @@ static const uint8_t dv_quant_shifts[22][4] = { }; static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 }; -static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 }; -/* quantization quanta by QNO for DV100 */ -static const uint8_t dv100_qstep[16] = { - 1, /* QNO = 0 and 1 both have no quantization */ - 1, - 2, 3, 4, 5, 6, 7, 8, 16, 18, 20, 22, 24, 28, 52 -}; - -/* DV25/50 DCT coefficient weights and inverse weights */ -/* created by dvtables.py */ -static const int dv_weight_bits = 18; -static const int dv_weight_88[64] = { - 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536, - 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935, - 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916, - 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433, - 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704, - 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568, - 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627, - 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258, -}; -static const int dv_weight_248[64] = { - 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754, - 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536, - 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568, - 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965, - 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627, - 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965, - 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364, - 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651, -}; -static const int dv_iweight_bits = 14; static const int dv_iweight_88[64] = { 32768, 16710, 16710, 17735, 17015, 17735, 18197, 18079, 18079, 18197, 18725, 18559, 19196, 18559, 18725, 19284, -- 2.7.4