00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 },
00040 { 1, 2 },
00041 { 1, 3 },
00042 { 1, 1 },
00043 { 1, 6 },
00044 { 1, 5 },
00045 { 2, 5 },
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 },
00060 { 2, 3 },
00061 { 3, 3 },
00062 { 2, 4 },
00063 { 3, 4 },
00064 { 2, 2 },
00065 { 3, 2 },
00066 { 1, 6 },
00067 { 2, 6 },
00068 { 3, 6 },
00069 { 2, 5 },
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
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
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
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