diff options
author | Maxim Poliakovski <max_pole@gmx.de> | 2010-05-26 13:25:16 +0000 |
---|---|---|
committer | Maxim Poliakovski <max_pole@gmx.de> | 2010-05-26 13:25:16 +0000 |
commit | 220f2bd9c595c7934753694854d4a778358d5c4d (patch) | |
tree | 6218914df31beafa59d300680db6423f0ab50c4f | |
parent | 93ebfeea90be8cc270226ac4d282efffed7ca0c7 (diff) | |
download | ffmpeg-220f2bd9c595c7934753694854d4a778358d5c4d.tar.gz |
move indeo5 scan patterns into ivi_common.c
so those can be shared by indeo4.
Originally committed as revision 23335 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/indeo5.c | 8 | ||||
-rw-r--r-- | libavcodec/indeo5data.h | 23 | ||||
-rw-r--r-- | libavcodec/ivi_common.c | 30 | ||||
-rw-r--r-- | libavcodec/ivi_common.h | 8 |
4 files changed, 42 insertions, 27 deletions
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 2593e55272..3dd976f7f9 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -185,25 +185,25 @@ static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx) case 1: band->inv_transform = ff_ivi_row_slant8; band->dc_transform = ff_ivi_dc_row_slant; - band->scan = ivi5_scans8x8[0]; + band->scan = ivi_vertical_scan_8x8; break; case 2: band->inv_transform = ff_ivi_col_slant8; band->dc_transform = ff_ivi_dc_col_slant; - band->scan = ivi5_scans8x8[1]; + band->scan = ivi_horizontal_scan_8x8; break; case 3: band->inv_transform = ff_ivi_put_pixels_8x8; band->dc_transform = ff_ivi_put_dc_pixel_8x8; - band->scan = ivi5_scans8x8[1]; + band->scan = ivi_horizontal_scan_8x8; break; case 4: band->inv_transform = ff_ivi_inverse_slant_4x4; band->dc_transform = ff_ivi_dc_slant_2d; - band->scan = ivi5_scan4x4; + band->scan = ivi_direct_scan_4x4; break; } diff --git a/libavcodec/indeo5data.h b/libavcodec/indeo5data.h index 972e59886b..87a0a6060c 100644 --- a/libavcodec/indeo5data.h +++ b/libavcodec/indeo5data.h @@ -37,29 +37,6 @@ static const uint8_t ivi5_common_pic_sizes[30] = { 176, 60, 20, 15, 22, 18, 0, 0, 0, 0, 0, 0 }; -/** - * Indeo5 8x8 scan (zigzag) patterns - */ -static const uint8_t ivi5_scans8x8[2][64] = { - {0, 8, 16, 24, 32, 40, 48, 56, 1, 9, 17, 25, 33, 41, 49, 57, - 2, 10, 18, 26, 34, 42, 50, 58, 3, 11, 19, 27, 35, 43, 51, 59, - 4, 12, 20, 28, 36, 44, 52, 60, 5, 13, 21, 29, 37, 45, 53, 61, - 6, 14, 22, 30, 38, 46, 54, 62, 7, 15, 23, 31, 39, 47, 55, 63 - }, - {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, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 - } -}; - -/** - * Indeo5 4x4 scan (zigzag) pattern - */ -static const uint8_t ivi5_scan4x4[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; - /** * Indeo5 dequantization matrixes consist of two tables: base table diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index a0596f67af..c37ad66f06 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -643,6 +643,36 @@ const IVIHuffDesc ff_ivi_blk_huff_desc[8] = { /** + * Scan patterns shared between indeo4 and indeo5 + */ +const uint8_t ivi_vertical_scan_8x8[64] = { + 0, 8, 16, 24, 32, 40, 48, 56, + 1, 9, 17, 25, 33, 41, 49, 57, + 2, 10, 18, 26, 34, 42, 50, 58, + 3, 11, 19, 27, 35, 43, 51, 59, + 4, 12, 20, 28, 36, 44, 52, 60, + 5, 13, 21, 29, 37, 45, 53, 61, + 6, 14, 22, 30, 38, 46, 54, 62, + 7, 15, 23, 31, 39, 47, 55, 63 +}; + +const uint8_t ivi_horizontal_scan_8x8[64] = { + 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, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63 +}; + +const uint8_t ivi_direct_scan_4x4[16] = { + 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 +}; + + +/** * Run-value (RLE) tables. */ const RVMapDesc ff_ivi_rvmap_tabs[9] = { diff --git a/libavcodec/ivi_common.h b/libavcodec/ivi_common.h index 64793e479e..a96b4b9a36 100644 --- a/libavcodec/ivi_common.h +++ b/libavcodec/ivi_common.h @@ -68,6 +68,14 @@ extern VLC ff_ivi_blk_vlc_tabs[8]; ///< static block Huffman tables /** + * Common scan patterns (defined in ivi_common.c) + */ +extern const uint8_t ivi_vertical_scan_8x8[64]; +extern const uint8_t ivi_horizontal_scan_8x8[64]; +extern const uint8_t ivi_direct_scan_4x4[16]; + + +/** * run-value (RLE) table descriptor */ typedef struct { |