www.pudn.com > jm74.zip > macroblock.h
/*! ************************************************************************ * \file macroblock.h * * \author * Inge Lille-Langøy* Copyright (C) 1999 Telenor Satellite Services, Norway ************************************************************************ */ #ifndef _MACROBLOCK_H_ #define _MACROBLOCK_H_ //! 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} }; //! 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} }; //! gives CBP value from codeword number, both for intra and inter const byte NCBP[48][2]= { {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}, }; //! 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} }; //! 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}} }; 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 }; #endif