Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
310bf283
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,发现更多精彩内容 >>
提交
310bf283
编写于
4月 11, 2013
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mss4: make code independent of sizeof(AVFrame)
Also fixes #2455. Signed-off-by:
N
Paul B Mahol
<
onemda@gmail.com
>
上级
b6d5a948
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
17 deletion
+22
-17
libavcodec/mss4.c
libavcodec/mss4.c
+22
-17
未找到文件。
libavcodec/mss4.c
浏览文件 @
310bf283
...
...
@@ -126,7 +126,7 @@ static const uint8_t mss4_vec_entry_vlc_syms[2][9] = {
#define MAX_ENTRIES 162
typedef
struct
MSS4Context
{
AVFrame
pic
;
AVFrame
*
pic
;
VLC
dc_vlc
[
2
],
ac_vlc
[
2
];
VLC
vec_entry_vlc
[
2
];
...
...
@@ -297,10 +297,10 @@ static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb,
return
ret
;
c
->
prev_dc
[
0
][
mb_x
*
2
+
i
]
=
c
->
dc_cache
[
j
][
LEFT
];
ff_mss34_dct_put
(
out
+
xpos
*
8
,
c
->
pic
.
linesize
[
0
],
ff_mss34_dct_put
(
out
+
xpos
*
8
,
c
->
pic
->
linesize
[
0
],
c
->
block
);
}
out
+=
8
*
c
->
pic
.
linesize
[
0
];
out
+=
8
*
c
->
pic
->
linesize
[
0
];
}
for
(
i
=
1
;
i
<
3
;
i
++
)
{
...
...
@@ -320,7 +320,7 @@ static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb,
for
(
j
=
0
;
j
<
16
;
j
++
)
{
for
(
k
=
0
;
k
<
8
;
k
++
)
AV_WN16A
(
out
+
k
*
2
,
c
->
imgbuf
[
i
][
k
+
(
j
&
~
1
)
*
4
]
*
0x101
);
out
+=
c
->
pic
.
linesize
[
i
];
out
+=
c
->
pic
->
linesize
[
i
];
}
}
...
...
@@ -481,7 +481,7 @@ static int mss4_decode_image_block(MSS4Context *ctx, GetBitContext *gb,
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
j
=
0
;
j
<
16
;
j
++
)
memcpy
(
picdst
[
i
]
+
mb_x
*
16
+
j
*
ctx
->
pic
.
linesize
[
i
],
memcpy
(
picdst
[
i
]
+
mb_x
*
16
+
j
*
ctx
->
pic
->
linesize
[
i
],
ctx
->
imgbuf
[
i
]
+
j
*
16
,
16
);
return
0
;
...
...
@@ -554,14 +554,14 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
AVERROR_INVALIDDATA
;
}
if
((
ret
=
ff_reget_buffer
(
avctx
,
&
c
->
pic
))
<
0
)
if
((
ret
=
ff_reget_buffer
(
avctx
,
c
->
pic
))
<
0
)
return
ret
;
c
->
pic
.
key_frame
=
(
frame_type
==
INTRA_FRAME
);
c
->
pic
.
pict_type
=
(
frame_type
==
INTRA_FRAME
)
?
AV_PICTURE_TYPE_I
c
->
pic
->
key_frame
=
(
frame_type
==
INTRA_FRAME
);
c
->
pic
->
pict_type
=
(
frame_type
==
INTRA_FRAME
)
?
AV_PICTURE_TYPE_I
:
AV_PICTURE_TYPE_P
;
if
(
frame_type
==
SKIP_FRAME
)
{
*
got_frame
=
1
;
if
((
ret
=
av_frame_ref
(
data
,
&
c
->
pic
))
<
0
)
if
((
ret
=
av_frame_ref
(
data
,
c
->
pic
))
<
0
)
return
ret
;
return
buf_size
;
...
...
@@ -577,9 +577,9 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
mb_width
=
FFALIGN
(
width
,
16
)
>>
4
;
mb_height
=
FFALIGN
(
height
,
16
)
>>
4
;
dst
[
0
]
=
c
->
pic
.
data
[
0
];
dst
[
1
]
=
c
->
pic
.
data
[
1
];
dst
[
2
]
=
c
->
pic
.
data
[
2
];
dst
[
0
]
=
c
->
pic
->
data
[
0
];
dst
[
1
]
=
c
->
pic
->
data
[
1
];
dst
[
2
]
=
c
->
pic
->
data
[
2
];
memset
(
c
->
prev_vec
,
0
,
sizeof
(
c
->
prev_vec
));
for
(
y
=
0
;
y
<
mb_height
;
y
++
)
{
...
...
@@ -613,12 +613,12 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if
(
blk_type
!=
DCT_BLOCK
)
mss4_update_dc_cache
(
c
,
x
);
}
dst
[
0
]
+=
c
->
pic
.
linesize
[
0
]
*
16
;
dst
[
1
]
+=
c
->
pic
.
linesize
[
1
]
*
16
;
dst
[
2
]
+=
c
->
pic
.
linesize
[
2
]
*
16
;
dst
[
0
]
+=
c
->
pic
->
linesize
[
0
]
*
16
;
dst
[
1
]
+=
c
->
pic
->
linesize
[
1
]
*
16
;
dst
[
2
]
+=
c
->
pic
->
linesize
[
2
]
*
16
;
}
if
((
ret
=
av_frame_ref
(
data
,
&
c
->
pic
))
<
0
)
if
((
ret
=
av_frame_ref
(
data
,
c
->
pic
))
<
0
)
return
ret
;
*
got_frame
=
1
;
...
...
@@ -631,6 +631,10 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx)
MSS4Context
*
const
c
=
avctx
->
priv_data
;
int
i
;
c
->
pic
=
av_frame_alloc
();
if
(
!
c
->
pic
)
return
AVERROR
(
ENOMEM
);
if
(
mss4_init_vlcs
(
c
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Cannot initialise VLCs
\n
"
);
mss4_free_vlcs
(
c
);
...
...
@@ -656,7 +660,8 @@ static av_cold int mss4_decode_end(AVCodecContext *avctx)
MSS4Context
*
const
c
=
avctx
->
priv_data
;
int
i
;
av_frame_unref
(
&
c
->
pic
);
av_frame_free
(
&
c
->
pic
);
for
(
i
=
0
;
i
<
3
;
i
++
)
av_freep
(
&
c
->
prev_dc
[
i
]);
mss4_free_vlcs
(
c
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录