Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
d4b3d040
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,发现更多精彩内容 >>
提交
d4b3d040
编写于
3月 15, 2009
作者:
B
Benjamin Larsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save avctx in cook decoder context and use it for av_log
Originally committed as revision 17988 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
7c119ced
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
13 deletion
+15
-13
libavcodec/cook.c
libavcodec/cook.c
+15
-13
未找到文件。
libavcodec/cook.c
浏览文件 @
d4b3d040
...
...
@@ -91,6 +91,7 @@ typedef struct cook {
void
(
*
saturate_output
)
(
struct
cook
*
q
,
int
chan
,
int16_t
*
out
);
AVCodecContext
*
avctx
;
GetBitContext
gb
;
/* stream data */
int
nb_channels
;
...
...
@@ -211,7 +212,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) {
envelope_quant_index_huffbits
[
i
],
1
,
1
,
envelope_quant_index_huffcodes
[
i
],
2
,
2
,
0
);
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"sqvh VLC init
\n
"
);
av_log
(
q
->
avctx
,
AV_LOG_DEBUG
,
"sqvh VLC init
\n
"
);
for
(
i
=
0
;
i
<
7
;
i
++
)
{
result
|=
init_vlc
(
&
q
->
sqvh
[
i
],
vhvlcsize_tab
[
i
],
vhsize_tab
[
i
],
cvh_huffbits
[
i
],
1
,
1
,
...
...
@@ -222,10 +223,10 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) {
result
|=
init_vlc
(
&
q
->
ccpl
,
6
,
(
1
<<
q
->
js_vlc_bits
)
-
1
,
ccpl_huffbits
[
q
->
js_vlc_bits
-
2
],
1
,
1
,
ccpl_huffcodes
[
q
->
js_vlc_bits
-
2
],
2
,
2
,
0
);
av_log
(
NULL
,
AV_LOG_DEBUG
,
"Joint-stereo VLC used.
\n
"
);
av_log
(
q
->
avctx
,
AV_LOG_DEBUG
,
"Joint-stereo VLC used.
\n
"
);
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"VLC tables initialized.
\n
"
);
av_log
(
q
->
avctx
,
AV_LOG_DEBUG
,
"VLC tables initialized.
\n
"
);
return
result
;
}
...
...
@@ -246,7 +247,7 @@ static av_cold int init_cook_mlt(COOKContext *q) {
av_free
(
q
->
mlt_window
);
return
-
1
;
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"MDCT initialized, order = %d.
\n
"
,
av_log
(
q
->
avctx
,
AV_LOG_DEBUG
,
"MDCT initialized, order = %d.
\n
"
,
av_log2
(
mlt_size
)
+
1
);
return
0
;
...
...
@@ -338,7 +339,7 @@ static av_cold int cook_decode_close(AVCodecContext *avctx)
free_vlc
(
&
q
->
ccpl
);
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"Memory deallocated.
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Memory deallocated.
\n
"
);
return
0
;
}
...
...
@@ -419,7 +420,7 @@ static void categorize(COOKContext *q, int* quant_index_table,
if
(
bits_left
>
q
->
samples_per_channel
)
{
bits_left
=
q
->
samples_per_channel
+
((
bits_left
-
q
->
samples_per_channel
)
*
5
)
/
8
;
//av_log(
NULL
, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
//av_log(
q->avctx
, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
}
memset
(
&
exp_index1
,
0
,
102
*
sizeof
(
int
));
...
...
@@ -935,9 +936,9 @@ static int decode_subpacket(COOKContext *q, const uint8_t *inbuffer,
int
sub_packet_size
,
int16_t
*
outbuffer
)
{
/* packet dump */
// for (i=0 ; i<sub_packet_size ; i++) {
// av_log(
NULL
, AV_LOG_ERROR, "%02x", inbuffer[i]);
// av_log(
q->avctx
, AV_LOG_ERROR, "%02x", inbuffer[i]);
// }
// av_log(
NULL
, AV_LOG_ERROR, "\n");
// av_log(
q->avctx
, AV_LOG_ERROR, "\n");
decode_bytes_and_gain
(
q
,
inbuffer
,
&
q
->
gains1
);
...
...
@@ -994,14 +995,14 @@ static int cook_decode_frame(AVCodecContext *avctx,
static
void
dump_cook_context
(
COOKContext
*
q
)
{
//int i=0;
#define PRINT(a,b) av_log(
NULL
,AV_LOG_ERROR," %s = %d\n", a, b);
av_log
(
NULL
,
AV_LOG_ERROR
,
"COOKextradata
\n
"
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"cookversion=%x
\n
"
,
q
->
cookversion
);
#define PRINT(a,b) av_log(
q->avctx
,AV_LOG_ERROR," %s = %d\n", a, b);
av_log
(
q
->
avctx
,
AV_LOG_ERROR
,
"COOKextradata
\n
"
);
av_log
(
q
->
avctx
,
AV_LOG_ERROR
,
"cookversion=%x
\n
"
,
q
->
cookversion
);
if
(
q
->
cookversion
>
STEREO
)
{
PRINT
(
"js_subband_start"
,
q
->
js_subband_start
);
PRINT
(
"js_vlc_bits"
,
q
->
js_vlc_bits
);
}
av_log
(
NULL
,
AV_LOG_ERROR
,
"COOKContext
\n
"
);
av_log
(
q
->
avctx
,
AV_LOG_ERROR
,
"COOKContext
\n
"
);
PRINT
(
"nb_channels"
,
q
->
nb_channels
);
PRINT
(
"bit_rate"
,
q
->
bit_rate
);
PRINT
(
"sample_rate"
,
q
->
sample_rate
);
...
...
@@ -1026,6 +1027,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
{
COOKContext
*
q
=
avctx
->
priv_data
;
const
uint8_t
*
edata_ptr
=
avctx
->
extradata
;
q
->
avctx
=
avctx
;
/* Take care of the codec specific extradata. */
if
(
avctx
->
extradata_size
<=
0
)
{
...
...
@@ -1064,7 +1066,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q
->
total_subbands
=
q
->
subbands
;
/* Initialize version-dependent variables */
av_log
(
NULL
,
AV_LOG_DEBUG
,
"q->cookversion=%x
\n
"
,
q
->
cookversion
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"q->cookversion=%x
\n
"
,
q
->
cookversion
);
q
->
joint_stereo
=
0
;
switch
(
q
->
cookversion
)
{
case
MONO
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录