• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/mpeg12decdata.h

Go to the documentation of this file.
00001 /*
00002  * MPEG1/2 decoder tables
00003  * copyright (c) 2000,2001 Fabrice Bellard
00004  * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
00005  *
00006  * This file is part of FFmpeg.
00007  *
00008  * FFmpeg is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * FFmpeg is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with FFmpeg; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00021  */
00022 
00028 #ifndef AVCODEC_MPEG12DECDATA_H
00029 #define AVCODEC_MPEG12DECDATA_H
00030 
00031 #include <stdint.h>
00032 #include "mpegvideo.h"
00033 
00034 
00035 #define MB_TYPE_ZERO_MV   0x20000000
00036 #define IS_ZERO_MV(a)   ((a)&MB_TYPE_ZERO_MV)
00037 
00038 static const uint8_t table_mb_ptype[7][2] = {
00039     { 3, 5 }, // 0x01 MB_INTRA
00040     { 1, 2 }, // 0x02 MB_PAT
00041     { 1, 3 }, // 0x08 MB_FOR
00042     { 1, 1 }, // 0x0A MB_FOR|MB_PAT
00043     { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
00044     { 1, 5 }, // 0x12 MB_QUANT|MB_PAT
00045     { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
00046 };
00047 
00048 static const uint32_t ptype2mb_type[7] = {
00049                     MB_TYPE_INTRA,
00050                     MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
00051                     MB_TYPE_L0,
00052                     MB_TYPE_L0 | MB_TYPE_CBP,
00053     MB_TYPE_QUANT | MB_TYPE_INTRA,
00054     MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
00055     MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
00056 };
00057 
00058 static const uint8_t table_mb_btype[11][2] = {
00059     { 3, 5 }, // 0x01 MB_INTRA
00060     { 2, 3 }, // 0x04 MB_BACK
00061     { 3, 3 }, // 0x06 MB_BACK|MB_PAT
00062     { 2, 4 }, // 0x08 MB_FOR
00063     { 3, 4 }, // 0x0A MB_FOR|MB_PAT
00064     { 2, 2 }, // 0x0C MB_FOR|MB_BACK
00065     { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT
00066     { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
00067     { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT
00068     { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
00069     { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
00070 };
00071 
00072 static const uint32_t btype2mb_type[11] = {
00073                     MB_TYPE_INTRA,
00074                     MB_TYPE_L1,
00075                     MB_TYPE_L1   | MB_TYPE_CBP,
00076                     MB_TYPE_L0,
00077                     MB_TYPE_L0   | MB_TYPE_CBP,
00078                     MB_TYPE_L0L1,
00079                     MB_TYPE_L0L1 | MB_TYPE_CBP,
00080     MB_TYPE_QUANT | MB_TYPE_INTRA,
00081     MB_TYPE_QUANT | MB_TYPE_L1   | MB_TYPE_CBP,
00082     MB_TYPE_QUANT | MB_TYPE_L0   | MB_TYPE_CBP,
00083     MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP,
00084 };
00085 
00086 static const uint8_t non_linear_qscale[32] = {
00087     0, 1, 2, 3, 4, 5, 6, 7,
00088     8,10,12,14,16,18,20,22,
00089     24,28,32,36,40,44,48,52,
00090     56,64,72,80,88,96,104,112,
00091 };
00092 
00093 static const uint8_t mpeg2_dc_scale_table1[128]={
00094 //  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 30 31
00095     4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
00096     4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
00097     4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
00098     4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
00099 };
00100 
00101 static const uint8_t mpeg2_dc_scale_table2[128]={
00102 //  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 30 31
00103     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00104     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00105     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00106     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00107 };
00108 
00109 static const uint8_t mpeg2_dc_scale_table3[128]={
00110 //  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 30 31
00111     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00112     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00113     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00114     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00115 };
00116 
00117 static const uint8_t * const mpeg2_dc_scale_table[4]={
00118     ff_mpeg1_dc_scale_table,
00119     mpeg2_dc_scale_table1,
00120     mpeg2_dc_scale_table2,
00121     mpeg2_dc_scale_table3,
00122 };
00123 
00124 #endif /* AVCODEC_MPEG12DECDATA_H */

Generated on Tue Nov 4 2014 12:59:22 for ffmpeg by  doxygen 1.7.1