Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
c9d779a3
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,发现更多精彩内容 >>
提交
c9d779a3
编写于
10月 29, 2020
作者:
A
Andreas Rheinhardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/mpc8: Apply offsets when initializing VLCs
Signed-off-by:
N
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
上级
906911f5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
12 deletion
+9
-12
libavcodec/mpc8.c
libavcodec/mpc8.c
+9
-12
未找到文件。
libavcodec/mpc8.c
浏览文件 @
c9d779a3
...
...
@@ -39,9 +39,6 @@
static
VLC
band_vlc
,
scfi_vlc
[
2
],
dscf_vlc
[
2
],
res_vlc
[
2
];
static
VLC
q1_vlc
,
q2_vlc
[
2
],
q3_vlc
[
2
],
quant_vlc
[
4
][
2
],
q9up_vlc
;
static
const
int
q3_offsets
[
2
]
=
{
MPC8_Q3_OFFSET
,
MPC8_Q4_OFFSET
};
static
const
int
quant_offsets
[
6
]
=
{
MPC8_Q5_OFFSET
,
MPC8_Q6_OFFSET
,
MPC8_Q7_OFFSET
,
MPC8_Q8_OFFSET
};
static
inline
int
mpc8_dec_base
(
GetBitContext
*
gb
,
int
k
,
int
n
)
{
int
len
=
mpc8_cnk_len
[
k
-
1
][
n
-
1
]
-
1
;
...
...
@@ -161,10 +158,10 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
INIT_VLC_STATIC_FROM_LENGTHS
(
&
q3_vlc
[
0
],
MPC8_Q3_BITS
,
MPC8_Q3_SIZE
,
mpc8_q3_bits
,
1
,
mpc8_q3_syms
,
1
,
1
,
0
,
0
,
512
);
mpc8_q3_syms
,
1
,
1
,
MPC8_Q3_OFFSET
,
0
,
512
);
INIT_VLC_STATIC_FROM_LENGTHS
(
&
q3_vlc
[
1
],
MPC8_Q4_BITS
,
MPC8_Q4_SIZE
,
mpc8_q4_bits
,
1
,
mpc8_q4_syms
,
1
,
1
,
0
,
0
,
516
);
mpc8_q4_syms
,
1
,
1
,
MPC8_Q4_OFFSET
,
0
,
516
);
for
(
i
=
0
;
i
<
2
;
i
++
){
res_vlc
[
i
].
table
=
&
codes_table
[
vlc_offsets
[
0
+
i
]];
...
...
@@ -186,25 +183,25 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
ff_init_vlc_from_lengths
(
&
quant_vlc
[
0
][
i
],
MPC8_Q5_BITS
,
MPC8_Q5_SIZE
,
mpc8_q5_bits
[
i
],
1
,
mpc8_q5_syms
[
i
],
1
,
1
,
0
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
MPC8_Q5_OFFSET
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
quant_vlc
[
1
][
i
].
table
=
&
codes_table
[
vlc_offsets
[
6
+
i
]];
quant_vlc
[
1
][
i
].
table_allocated
=
vlc_offsets
[
7
+
i
]
-
vlc_offsets
[
6
+
i
];
ff_init_vlc_from_lengths
(
&
quant_vlc
[
1
][
i
],
MPC8_Q6_BITS
,
MPC8_Q6_SIZE
,
mpc8_q6_bits
[
i
],
1
,
mpc8_q6_syms
[
i
],
1
,
1
,
0
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
MPC8_Q6_OFFSET
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
quant_vlc
[
2
][
i
].
table
=
&
codes_table
[
vlc_offsets
[
8
+
i
]];
quant_vlc
[
2
][
i
].
table_allocated
=
vlc_offsets
[
9
+
i
]
-
vlc_offsets
[
8
+
i
];
ff_init_vlc_from_lengths
(
&
quant_vlc
[
2
][
i
],
MPC8_Q7_BITS
,
MPC8_Q7_SIZE
,
mpc8_q7_bits
[
i
],
1
,
mpc8_q7_syms
[
i
],
1
,
1
,
0
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
MPC8_Q7_OFFSET
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
quant_vlc
[
3
][
i
].
table
=
&
codes_table
[
vlc_offsets
[
10
+
i
]];
quant_vlc
[
3
][
i
].
table_allocated
=
vlc_offsets
[
11
+
i
]
-
vlc_offsets
[
10
+
i
];
ff_init_vlc_from_lengths
(
&
quant_vlc
[
3
][
i
],
MPC8_Q8_BITS
,
MPC8_Q8_SIZE
,
mpc8_q8_bits
[
i
],
1
,
mpc8_q8_syms
[
i
],
1
,
1
,
0
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
MPC8_Q8_OFFSET
,
INIT_VLC_USE_NEW_STATIC
,
NULL
);
}
vlc_initialized
=
1
;
ff_mpa_synth_init_fixed
();
...
...
@@ -358,7 +355,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
case
3
:
case
4
:
for
(
j
=
0
;
j
<
SAMPLES_PER_BAND
;
j
+=
2
){
t
=
get_vlc2
(
gb
,
q3_vlc
[
res
-
3
].
table
,
MPC8_Q3_BITS
,
2
)
+
q3_offsets
[
res
-
3
]
;
t
=
get_vlc2
(
gb
,
q3_vlc
[
res
-
3
].
table
,
MPC8_Q3_BITS
,
2
);
c
->
Q
[
ch
][
off
+
j
+
1
]
=
t
>>
4
;
c
->
Q
[
ch
][
off
+
j
+
0
]
=
sign_extend
(
t
,
4
);
}
...
...
@@ -369,8 +366,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
case
8
:
cnt
=
2
*
mpc8_thres
[
res
];
for
(
j
=
0
;
j
<
SAMPLES_PER_BAND
;
j
++
){
t
=
get_vlc2
(
gb
,
quant_vlc
[
res
-
5
][
cnt
>
mpc8_thres
[
res
]].
table
,
quant_vlc
[
res
-
5
][
cnt
>
mpc8_thres
[
res
]].
bits
,
2
)
+
quant_offsets
[
res
-
5
];
c
->
Q
[
ch
][
off
+
j
]
=
t
;
const
VLC
*
vlc
=
&
quant_vlc
[
res
-
5
][
cnt
>
mpc8_thres
[
res
]
];
c
->
Q
[
ch
][
off
+
j
]
=
get_vlc2
(
gb
,
vlc
->
table
,
vlc
->
bits
,
2
)
;
cnt
=
(
cnt
>>
1
)
+
FFABS
(
c
->
Q
[
ch
][
off
+
j
]);
}
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录