Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
d1a1f117
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,体验更适合开发者的 AI 搜索 >>
提交
d1a1f117
编写于
11月 06, 2020
作者:
A
Andreas Rheinhardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/intrax8: Avoid code duplication when initializing VLCs
Signed-off-by:
N
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
上级
ba69ee88
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
25 deletion
+21
-25
libavcodec/intrax8.c
libavcodec/intrax8.c
+21
-25
未找到文件。
libavcodec/intrax8.c
浏览文件 @
d1a1f117
...
...
@@ -32,6 +32,8 @@
#include "intrax8dsp.h"
#include "mpegutils.h"
#define VLC_BUFFER_SIZE 28150
#define MAX_TABLE_DEPTH(table_bits, max_bits) \
((max_bits + table_bits - 1) / table_bits)
...
...
@@ -47,21 +49,27 @@ static VLC j_ac_vlc[2][2][8]; // [quant < 13], [intra / inter], [select]
static
VLC
j_dc_vlc
[
2
][
8
];
// [quant], [select]
static
VLC
j_orient_vlc
[
2
][
4
];
// [quant], [select]
static
av_cold
void
x8_init_vlc
(
VLC
*
vlc
,
int
nb_bits
,
int
nb_codes
,
int
*
offset
,
const
uint16_t
table
[][
2
])
{
static
VLC_TYPE
vlc_buf
[
VLC_BUFFER_SIZE
][
2
];
vlc
->
table
=
&
vlc_buf
[
*
offset
];
vlc
->
table_allocated
=
VLC_BUFFER_SIZE
-
*
offset
;
init_vlc
(
vlc
,
nb_bits
,
nb_codes
,
&
table
[
0
][
1
],
4
,
2
,
&
table
[
0
][
0
],
4
,
2
,
INIT_VLC_STATIC_OVERLONG
);
*
offset
+=
vlc
->
table_size
;
}
static
av_cold
void
x8_vlc_init
(
void
)
{
int
i
;
int
offset
=
0
;
static
VLC_TYPE
table
[
28150
][
2
];
// set ac tables
#define init_ac_vlc(dst, src) \
do { \
dst.table = &table[offset]; \
dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \
init_vlc(&dst, AC_VLC_BITS, 77, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_STATIC_OVERLONG); \
offset += dst.table_size; \
x8_init_vlc(&dst, AC_VLC_BITS, 77, &offset, &src); \
} while(0)
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -75,11 +83,7 @@ static av_cold void x8_vlc_init(void)
// set dc tables
#define init_dc_vlc(dst, src) \
do { \
dst.table = &table[offset]; \
dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \
init_vlc(&dst, DC_VLC_BITS, 34, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_STATIC_OVERLONG); \
offset += dst.table_size; \
x8_init_vlc(&dst, DC_VLC_BITS, 34, &offset, &src); \
} while(0)
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -89,22 +93,14 @@ static av_cold void x8_vlc_init(void)
#undef init_dc_vlc
// set orient tables
#define init_or_vlc(dst, src) \
do { \
dst.table = &table[offset]; \
dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \
init_vlc(&dst, OR_VLC_BITS, 12, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_STATIC_OVERLONG); \
offset += dst.table_size; \
} while(0)
for
(
i
=
0
;
i
<
2
;
i
++
)
init_or_vlc
(
j_orient_vlc
[
0
][
i
],
x8_orient_highquant_table
[
i
][
0
]);
x8_init_vlc
(
&
j_orient_vlc
[
0
][
i
],
OR_VLC_BITS
,
12
,
&
offset
,
x8_orient_highquant_table
[
i
]);
for
(
i
=
0
;
i
<
4
;
i
++
)
init_or_vlc
(
j_orient_vlc
[
1
][
i
],
x8_orient_lowquant_table
[
i
][
0
]);
#undef init_or_vlc
x8_init_vlc
(
&
j_orient_vlc
[
1
][
i
],
OR_VLC_BITS
,
12
,
&
offset
,
x8_orient_lowquant_table
[
i
]);
av_assert2
(
offset
==
FF_ARRAY_ELEMS
(
table
)
);
av_assert2
(
offset
==
VLC_BUFFER_SIZE
);
}
static
void
x8_reset_vlc_tables
(
IntraX8Context
*
w
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录