diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-04-10 13:18:38 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-10 13:18:38 +0000 |
commit | 7bc9090a4176de2bc834e2a7df131047b944f3b5 (patch) | |
tree | 1d57ac078ac227d652202cc1077ac565b8e36122 /libavcodec/mpeg12data.h | |
parent | 84876d36774b6633c2950291fbfb3db5922273fb (diff) | |
download | ffmpeg-7bc9090a4176de2bc834e2a7df131047b944f3b5.tar.gz |
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
more direct use of the new mb_type stuff instead of codec specific stuff
runtime mb_type debug output h264/h263 variants/mpeg1/2/4
error concealment /resilience for mpeg1/2
various minor optimizations
Originally committed as revision 1746 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12data.h')
-rw-r--r-- | libavcodec/mpeg12data.h | 85 |
1 files changed, 31 insertions, 54 deletions
diff --git a/libavcodec/mpeg12data.h b/libavcodec/mpeg12data.h index 16d607067f..2e7e58de5a 100644 --- a/libavcodec/mpeg12data.h +++ b/libavcodec/mpeg12data.h @@ -289,80 +289,57 @@ static const uint8_t mbPatTable[63][2] = { {0xc, 6} }; -#define MB_INTRA 0x01 -#define MB_PAT 0x02 -#define MB_BACK 0x04 -#define MB_FOR 0x08 -#define MB_QUANT 0x10 - -static const uint8_t table_mb_ptype[32][2] = { - { 0, 0 }, // 0x00 +#define MB_TYPE_PAT 0x40000000 +#define MB_TYPE_ZERO_MV 0x20000000 +#define IS_ZERO_MV(a) ((a)&MB_TYPE_ZERO_MV) +#define IS_PAT(a) ((a)&MB_TYPE_PAT) + +static const uint8_t table_mb_ptype[7][2] = { { 3, 5 }, // 0x01 MB_INTRA { 1, 2 }, // 0x02 MB_PAT - { 0, 0 }, // 0x03 - { 0, 0 }, // 0x04 - { 0, 0 }, // 0x05 - { 0, 0 }, // 0x06 - { 0, 0 }, // 0x07 { 1, 3 }, // 0x08 MB_FOR - { 0, 0 }, // 0x09 { 1, 1 }, // 0x0A MB_FOR|MB_PAT - { 0, 0 }, // 0x0B - { 0, 0 }, // 0x0C - { 0, 0 }, // 0x0D - { 0, 0 }, // 0x0E - { 0, 0 }, // 0x0F - { 0, 0 }, // 0x10 { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA { 1, 5 }, // 0x12 MB_QUANT|MB_PAT - { 0, 0 }, // 0x13 - { 0, 0 }, // 0x14 - { 0, 0 }, // 0x15 - { 0, 0 }, // 0x16 - { 0, 0 }, // 0x17 - { 0, 0 }, // 0x18 - { 0, 0 }, // 0x19 { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT - { 0, 0 }, // 0x1B - { 0, 0 }, // 0x1C - { 0, 0 }, // 0x1D - { 0, 0 }, // 0x1E - { 0, 0 }, // 0x1F }; -static const uint8_t table_mb_btype[32][2] = { - { 0, 0 }, // 0x00 +static const uint32_t ptype2mb_type[7] = { + MB_TYPE_INTRA, + MB_TYPE_L0 | MB_TYPE_PAT | MB_TYPE_ZERO_MV | MB_TYPE_16x16, + MB_TYPE_L0, + MB_TYPE_L0 | MB_TYPE_PAT, + MB_TYPE_QUANT | MB_TYPE_INTRA, + MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_PAT | MB_TYPE_ZERO_MV | MB_TYPE_16x16, + MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_PAT, +}; + +static const uint8_t table_mb_btype[11][2] = { { 3, 5 }, // 0x01 MB_INTRA - { 0, 0 }, // 0x02 - { 0, 0 }, // 0x03 { 2, 3 }, // 0x04 MB_BACK - { 0, 0 }, // 0x05 { 3, 3 }, // 0x06 MB_BACK|MB_PAT - { 0, 0 }, // 0x07 { 2, 4 }, // 0x08 MB_FOR - { 0, 0 }, // 0x09 { 3, 4 }, // 0x0A MB_FOR|MB_PAT - { 0, 0 }, // 0x0B { 2, 2 }, // 0x0C MB_FOR|MB_BACK - { 0, 0 }, // 0x0D { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT - { 0, 0 }, // 0x0F - { 0, 0 }, // 0x10 { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA - { 0, 0 }, // 0x12 - { 0, 0 }, // 0x13 - { 0, 0 }, // 0x14 - { 0, 0 }, // 0x15 { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT - { 0, 0 }, // 0x17 - { 0, 0 }, // 0x18 - { 0, 0 }, // 0x19 { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT - { 0, 0 }, // 0x1B - { 0, 0 }, // 0x1C - { 0, 0 }, // 0x1D { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT - { 0, 0 }, // 0x1F +}; + +static const uint32_t btype2mb_type[11] = { + MB_TYPE_INTRA, + MB_TYPE_L1, + MB_TYPE_L1 | MB_TYPE_PAT, + MB_TYPE_L0, + MB_TYPE_L0 | MB_TYPE_PAT, + MB_TYPE_L0L1, + MB_TYPE_L0L1 | MB_TYPE_PAT, + MB_TYPE_QUANT | MB_TYPE_INTRA, + MB_TYPE_QUANT | MB_TYPE_L1 | MB_TYPE_PAT, + MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_PAT, + MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_PAT, }; static const uint8_t mbMotionVectorTable[17][2] = { |