📄 umc_dv_decoder_tables.cpp
字号:
/*
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 2003-2007 Intel Corporation. All Rights Reserved.
//
//
*/
#include "umc_defs.h"
#if defined (UMC_ENABLE_DV_VIDEO_DECODER)
#include "umc_dv_decoder.h"
#include <ipps.h>
#include "umc_memory_allocator.h"
namespace UMC
{
enum
{
ALING_VALUE = 16
};
#define SIZE_TABLE_A_DEQUANTIZE (64 * 14 * sizeof(Ipp16u))
#define INIT_A_D_E(num, zone0, zone1, zone2, zone3) \
lpBuffer[(num) * 64 + 0] = 1; \
lpBuffer[(num) * 64 + 1] = zone0;/*zone0;*/ \
lpBuffer[(num) * 64 + 2] = zone0; \
lpBuffer[(num) * 64 + 3] = zone0; \
lpBuffer[(num) * 64 + 4] = zone0; \
lpBuffer[(num) * 64 + 5] = zone0; \
lpBuffer[(num) * 64 + 6] = zone1; \
lpBuffer[(num) * 64 + 7] = zone1;/*zone1;*/ \
lpBuffer[(num) * 64 + 8] = zone1; \
lpBuffer[(num) * 64 + 9] = zone1; \
lpBuffer[(num) * 64 + 10] = zone1; \
lpBuffer[(num) * 64 + 11] = zone1; \
lpBuffer[(num) * 64 + 12] = zone1; \
lpBuffer[(num) * 64 + 13] = zone1; \
lpBuffer[(num) * 64 + 14] = zone1; \
lpBuffer[(num) * 64 + 15] = zone1; \
lpBuffer[(num) * 64 + 16] = zone1; \
lpBuffer[(num) * 64 + 17] = zone1; \
lpBuffer[(num) * 64 + 18] = zone1; \
lpBuffer[(num) * 64 + 19] = zone1; \
lpBuffer[(num) * 64 + 20] = zone1; \
lpBuffer[(num) * 64 + 21] = zone2; \
lpBuffer[(num) * 64 + 22] = zone2; \
lpBuffer[(num) * 64 + 23] = zone2; \
lpBuffer[(num) * 64 + 24] = zone2; \
lpBuffer[(num) * 64 + 25] = zone2; \
lpBuffer[(num) * 64 + 26] = zone2; \
lpBuffer[(num) * 64 + 27] = zone2; \
lpBuffer[(num) * 64 + 28] = zone2; \
lpBuffer[(num) * 64 + 29] = zone2; \
lpBuffer[(num) * 64 + 30] = zone2; \
lpBuffer[(num) * 64 + 31] = zone2; \
lpBuffer[(num) * 64 + 32] = zone2; \
lpBuffer[(num) * 64 + 33] = zone2; \
lpBuffer[(num) * 64 + 34] = zone2; \
lpBuffer[(num) * 64 + 35] = zone2; \
lpBuffer[(num) * 64 + 36] = zone2; \
lpBuffer[(num) * 64 + 37] = zone2; \
lpBuffer[(num) * 64 + 38] = zone2; \
lpBuffer[(num) * 64 + 39] = zone2; \
lpBuffer[(num) * 64 + 40] = zone2; \
lpBuffer[(num) * 64 + 41] = zone2; \
lpBuffer[(num) * 64 + 42] = zone2; \
lpBuffer[(num) * 64 + 43] = zone3; \
lpBuffer[(num) * 64 + 44] = zone3; \
lpBuffer[(num) * 64 + 45] = zone3; \
lpBuffer[(num) * 64 + 46] = zone3; \
lpBuffer[(num) * 64 + 47] = zone3; \
lpBuffer[(num) * 64 + 48] = zone3; \
lpBuffer[(num) * 64 + 49] = zone3; \
lpBuffer[(num) * 64 + 50] = zone3; \
lpBuffer[(num) * 64 + 51] = zone3; \
lpBuffer[(num) * 64 + 52] = zone3; \
lpBuffer[(num) * 64 + 53] = zone3; \
lpBuffer[(num) * 64 + 54] = zone3; \
lpBuffer[(num) * 64 + 55] = zone3; \
lpBuffer[(num) * 64 + 56] = zone3; \
lpBuffer[(num) * 64 + 57] = zone3; \
lpBuffer[(num) * 64 + 58] = zone3; \
lpBuffer[(num) * 64 + 59] = zone3; \
lpBuffer[(num) * 64 + 60] = zone3; \
lpBuffer[(num) * 64 + 61] = zone3; \
lpBuffer[(num) * 64 + 62] = zone3; \
lpBuffer[(num) * 64 + 63] = zone3;
#define _INTERNAL_CS1 0.980785 //cos(1*PI/16)
#define _INTERNAL_CS2 0.923880 //cos(2*PI/16)
#define _INTERNAL_CS3 0.831470 //cos(3*PI/16)
#define _INTERNAL_CS4 0.707107 //cos(4*PI/16)
#define _INTERNAL_CS5 0.555570 //cos(5*PI/16)
#define _INTERNAL_CS6 0.382683 //cos(6*PI/16)
#define _INTERNAL_CS7 0.195090 //cos(7*PI/16)
#define _W0 (1.0000001)
#define _W1 (_INTERNAL_CS4 / (4.0 * _INTERNAL_CS7 * _INTERNAL_CS2))
#define _W2 (_INTERNAL_CS4 / (2.0 * _INTERNAL_CS6))
#define _W3 (1.0 / (2.0 * _INTERNAL_CS5))
#define _W4 (7.0 / 8.0)
#define _W5 (_INTERNAL_CS4 / _INTERNAL_CS3)
#define _W6 (_INTERNAL_CS4 / _INTERNAL_CS2)
#define _W7 (_INTERNAL_CS4 / _INTERNAL_CS1)
Ipp32s DVVideoDecoder::dvTable1[] =
{
9, /* Maximum length of code in this table*/
0, /* Not used */
0, /* Not used */
0, /* Number of 1-bit codes */
0, /* Number of 2-bit codes */
2, /* Number of 3-bit codes */
0x0000, 0, 1, 0x0001, 0, -1,
3, /* Number of 4-bit codes */
0x0004, 0, 2, 0x0005, 0, -2,
0x0006, 100, 100, /* EOB */
6, /* Number of 5-bit codes */
0x000e, 1, 1, 0x000f, 1, -1,
0x0010, 0, 3, 0x0011, 0, -3,
0x0012, 0, 4, 0x0013, 0, -4,
8, /* Number of 6-bit codes */
0x0028, 2, 1, 0x0029, 2, -1,
0x002a, 1, 2, 0x002b, 1, -2,
0x002c, 0, 5, 0x002d, 0, -5,
0x002e, 0, 6, 0x002f, 0, -6,
8, /* Number of 7-bit codes */
0x0060, 3, 1, 0x0061, 3, -1,
0x0062, 4, 1, 0x0063, 4, -1,
0x0064, 0, 7, 0x0065, 0, -7,
0x0066, 0, 8, 0x0067, 0, -8,
16, /* Number of 8-bit codes */
0x00d0, 5, 1, 0x00d1, 5, -1,
0x00d2, 6, 1, 0x00d3, 6, -1,
0x00d4, 2, 2, 0x00d5, 2, -2,
0x00d6, 1, 3, 0x00d7, 1, -3,
0x00d8, 1, 4, 0x00d9, 1, -4,
0x00da, 0, 9, 0x00db, 0, -9,
0x00dc, 0, 10, 0x00dd, 0, -10,
0x00de, 0, 11, 0x00df, 0, -11,
32, /* Number of 9-bit codes */
0x01c0, 7, 1, 0x01c1, 7, -1,
0x01c2, 8, 1, 0x01c3, 8, -1,
0x01c4, 9, 1, 0x01c5, 9, -1,
0x01c6, 10, 1, 0x01c7, 10, -1,
0x01c8, 3, 2, 0x01c9, 3, -2,
0x01ca, 4, 2, 0x01cb, 4, -2,
0x01cc, 2, 3, 0x01cd, 2, -3,
0x01ce, 1, 5, 0x01cf, 1, -5,
0x01d0, 1, 6, 0x01d1, 1, -6,
0x01d2, 1, 7, 0x01d3, 1, -7,
0x01d4, 0, 12, 0x01d5, 0, -12,
0x01d6, 0, 13, 0x01d7, 0, -13,
0x01d8, 0, 14, 0x01d9, 0, -14,
0x01da, 0, 15, 0x01db, 0, -15,
0x01dc, 0, 16, 0x01dd, 0, -16,
0x01de, 0, 17, 0x01df, 0, -17,
-1 /* end of table */
};
Ipp32s DVVideoDecoder::dvTable2[] =
{
9, /* Maximum length of code. Note that 4 is added to
all code lengths in the second table */
0, /* Not used */
0, /* Not used */
0, /* Number of 1(5)-bit codes */
0, /* Number of 2(6)-bit codes */
0, /* Number of 3(7)-bit codes */
0, /* Number of 4(8)-bit codes */
0, /* Number of 5(9)-bit codes */
32, /* Number of 6(10)-bit codes */
0x0000, 11, 1, 0x0001, 11, -1,
0x0002, 12, 1, 0x0003, 12, -1,
0x0004, 13, 1, 0x0005, 13, -1,
0x0006, 14, 1, 0x0007, 14, -1,
0x0008, 5, 2, 0x0009, 5 , -2,
0x000a, 6 , 2, 0x000b, 6 , -2,
0x000c, 3, 3, 0x000d, 3 , -3,
0x000e, 4 , 3, 0x000f, 4 , -3,
0x0010, 2, 4 , 0x0011, 2, -4 ,
0x0012, 2, 5 , 0x0013, 2, -5,
0x0014, 1, 8 , 0x0015, 1, -8 ,
0x0016, 0, 18, 0x0017, 0, -18,
0x0018, 0, 19, 0x0019, 0, -19,
0x001a, 0, 20, 0x001b, 0, -20,
0x001c, 0, 21, 0x001d, 0, -21,
0x001e, 0, 22, 0x001f, 0, -22,
16, /* Number of 7(11)-bit codes */
0x0040, 5, 3, 0x0041, 5, -3,
0x0042, 3, 4, 0x0043, 3, -4,
0x0044, 3, 5, 0x0045, 3, -5,
0x0046, 2, 6, 0x0047, 2, -6,
0x0048, 1, 9, 0x0049, 1, -9,
0x004a, 1,10, 0x004b, 1, -10,
0x004c, 1, 11, 0x004d, 1, -11,
0x004e, 0, 0, 0x004f, 1, 0,
16, /* Number of 8(12)-bit codes */
0x00a0, 6, 3, 0x00a1, 6, -3,
0x00a2, 4, 4, 0x00a3, 4, -4,
0x00a4, 3, 6, 0x00a5, 3, -6,
0x00a6, 1,12, 0x00a7, 1,-12,
0x00a8, 1,13, 0x00a9, 1,-13,
0x00aa, 1,14, 0x00ab, 1,-14,
0x00ac, 2, 0, 0x00ad, 3, 0 ,
0x00ae, 4, 0, 0x00af, 5, 0,
16*2 + 56 + 6 + 2, /* Number of 9(13)-bit codes */
0x0160, 7, 2, 0x0161, 7, -2,
0x0162, 8, 2, 0x0163, 8, -2,
0x0164, 9, 2, 0x0165, 9, -2,
0x0166, 10, 2, 0x0167, 10, -2,
0x0168, 7, 3, 0x0169, 7, -3,
0x016a, 8, 3, 0x016b, 8, -3,
0x016c, 4, 5, 0x016d, 4, -5,
0x016e, 3, 7, 0x016f, 3, -7,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -