• 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 #endif /* AVCODEC_MPEG12DECDATA_H */

Generated on Fri Sep 16 2011 17:17:39 for FFmpeg by  doxygen 1.7.1