Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
9bf71516
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9bf71516
编写于
10月 03, 2002
作者:
F
Fabrice Bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first version of IDCT248 for DV decoding support
Originally committed as revision 994 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
3a3d3a42
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
82 addition
and
1 deletion
+82
-1
libavcodec/simple_idct.c
libavcodec/simple_idct.c
+80
-1
libavcodec/simple_idct.h
libavcodec/simple_idct.h
+2
-0
未找到文件。
libavcodec/simple_idct.c
浏览文件 @
9bf71516
...
...
@@ -659,4 +659,83 @@ void simple_idct(INT16 *block)
#endif
#undef COL_SHIFT
/* 2x4x8 idct */
#define CN_SHIFT 12
#define C_FIX(x) ((int)((x) * (1 << CN_SHIFT) + 0.5))
#define C0 C_FIX(0.7071067811)
#define C1 C_FIX(0.9238795324)
#define C2 C_FIX(0.3826834324)
/* row idct is multiple by 16 * sqrt(2.0), col idct4 is multiplied by
sqrt(2). An extra division by two is needed for the first butterfly
stage */
#define C_SHIFT (4+1+12+1)
static
inline
void
idct4col
(
UINT8
*
dest
,
int
line_size
,
const
INT16
*
col
)
{
int
c0
,
c1
,
c2
,
c3
,
a0
,
a1
,
a2
,
a3
;
const
UINT8
*
cm
=
cropTbl
+
MAX_NEG_CROP
;
a0
=
col
[
8
*
0
];
a1
=
col
[
8
*
2
];
a2
=
col
[
8
*
4
];
a3
=
col
[
8
*
6
];
c0
=
(
a0
+
a2
)
*
C0
+
(
1
<<
(
C_SHIFT
-
1
))
+
(
128
<<
C_SHIFT
);
c2
=
(
a0
-
a2
)
*
C0
+
(
1
<<
(
C_SHIFT
-
1
))
+
(
128
<<
C_SHIFT
);
c1
=
a1
*
C1
+
a3
*
C2
;
c3
=
a1
*
C2
-
a3
*
C1
;
dest
[
0
]
=
cm
[(
c0
+
c1
)
>>
C_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
c2
+
c3
)
>>
C_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
c2
-
c3
)
>>
C_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
c0
-
c1
)
>>
C_SHIFT
];
}
#define BF(k) \
{\
int a0, a1;\
a0 = ptr[k];\
a1 = ptr[8 + k];\
ptr[k] = a0 + a1;\
ptr[8 + k] = a0 - a1;\
}
/* only used by DV codec. The input must be interlaced. 128 is added
to the pixels before clamping to avoid systematic error
(1024*sqrt(2)) offset would be needed otherwise. */
/* XXX: I think a 1.0/sqrt(2) normalization should be needed to
compensate the extra butterfly stage - I don't have the full DV
specification */
void
simple_idct248_put
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
)
{
int
i
;
INT16
*
ptr
;
/* butterfly */
ptr
=
block
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
BF
(
0
);
BF
(
1
);
BF
(
2
);
BF
(
3
);
BF
(
4
);
BF
(
5
);
BF
(
6
);
BF
(
7
);
ptr
+=
2
*
8
;
}
/* IDCT8 on each line */
for
(
i
=
0
;
i
<
8
;
i
++
)
{
idctRowCondDC
(
block
+
i
*
8
);
}
/* IDCT4 and store */
for
(
i
=
0
;
i
<
8
;
i
++
)
{
idct4col
(
dest
+
i
,
2
*
line_size
,
block
+
i
);
idct4col
(
dest
+
line_size
+
i
,
2
*
line_size
,
block
+
8
+
i
);
}
}
libavcodec/simple_idct.h
浏览文件 @
9bf71516
...
...
@@ -24,3 +24,5 @@ void ff_simple_idct_mmx(short *block);
void
ff_simple_idct_add_mmx
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
);
void
ff_simple_idct_put_mmx
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
);
void
simple_idct
(
short
*
block
);
void
simple_idct248_put
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录