Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
1ae4518d
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,发现更多精彩内容 >>
提交
1ae4518d
编写于
10月 01, 2008
作者:
D
David Conrad
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cosmetics: reindent
Originally committed as revision 15505 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
10f38380
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
122 addition
and
122 deletion
+122
-122
libavcodec/vp3.c
libavcodec/vp3.c
+122
-122
未找到文件。
libavcodec/vp3.c
浏览文件 @
1ae4518d
...
@@ -814,152 +814,152 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
...
@@ -814,152 +814,152 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
if
(
s
->
keyframe
)
if
(
s
->
keyframe
)
return
0
;
return
0
;
memset
(
motion_x
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_x
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_y
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_y
,
0
,
6
*
sizeof
(
int
));
/* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
/* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
coding_mode
=
get_bits1
(
gb
);
coding_mode
=
get_bits1
(
gb
);
/* iterate through all of the macroblocks that contain 1 or more
/* iterate through all of the macroblocks that contain 1 or more
* coded fragments */
* coded fragments */
for
(
i
=
0
;
i
<
s
->
u_superblock_start
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
u_superblock_start
;
i
++
)
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
current_macroblock
=
s
->
superblock_macroblocks
[
i
*
4
+
j
];
current_macroblock
=
s
->
superblock_macroblocks
[
i
*
4
+
j
];
if
((
current_macroblock
==
-
1
)
||
if
((
current_macroblock
==
-
1
)
||
(
s
->
macroblock_coding
[
current_macroblock
]
==
MODE_COPY
))
(
s
->
macroblock_coding
[
current_macroblock
]
==
MODE_COPY
))
continue
;
continue
;
if
(
current_macroblock
>=
s
->
macroblock_count
)
{
if
(
current_macroblock
>=
s
->
macroblock_count
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad macroblock number (%d >= %d)
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad macroblock number (%d >= %d)
\n
"
,
current_macroblock
,
s
->
macroblock_count
);
current_macroblock
,
s
->
macroblock_count
);
return
1
;
return
1
;
}
}
current_fragment
=
s
->
macroblock_fragments
[
current_macroblock
*
6
];
current_fragment
=
s
->
macroblock_fragments
[
current_macroblock
*
6
];
if
(
current_fragment
>=
s
->
fragment_count
)
{
if
(
current_fragment
>=
s
->
fragment_count
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad fragment number (%d >= %d
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad fragment number (%d >= %d
\n
"
,
current_fragment
,
s
->
fragment_count
);
current_fragment
,
s
->
fragment_count
);
return
1
;
return
1
;
}
switch
(
s
->
macroblock_coding
[
current_macroblock
])
{
case
MODE_INTER_PLUS_MV
:
case
MODE_GOLDEN_MV
:
/* all 6 fragments use the same motion vector */
if
(
coding_mode
==
0
)
{
motion_x
[
0
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
motion_y
[
0
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
}
else
{
motion_x
[
0
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
motion_y
[
0
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
}
}
switch
(
s
->
macroblock_coding
[
current_macroblock
])
{
case
MODE_INTER_PLUS_MV
:
case
MODE_GOLDEN_MV
:
/* all 6 fragments use the same motion vector */
if
(
coding_mode
==
0
)
{
motion_x
[
0
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
motion_y
[
0
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
}
else
{
motion_x
[
0
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
motion_y
[
0
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
}
for
(
k
=
1
;
k
<
6
;
k
++
)
{
for
(
k
=
1
;
k
<
6
;
k
++
)
{
motion_x
[
k
]
=
motion_x
[
0
];
motion_x
[
k
]
=
motion_x
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
}
}
/* vector maintenance, only on MODE_INTER_PLUS_MV */
if
(
s
->
macroblock_coding
[
current_macroblock
]
==
MODE_INTER_PLUS_MV
)
{
prior_last_motion_x
=
last_motion_x
;
prior_last_motion_y
=
last_motion_y
;
last_motion_x
=
motion_x
[
0
];
last_motion_y
=
motion_y
[
0
];
}
break
;
case
MODE_INTER_FOURMV
:
/* vector maintenance, only on MODE_INTER_PLUS_MV */
/* vector maintenance */
if
(
s
->
macroblock_coding
[
current_macroblock
]
==
MODE_INTER_PLUS_MV
)
{
prior_last_motion_x
=
last_motion_x
;
prior_last_motion_x
=
last_motion_x
;
prior_last_motion_y
=
last_motion_y
;
prior_last_motion_y
=
last_motion_y
;
last_motion_x
=
motion_x
[
0
];
last_motion_y
=
motion_y
[
0
];
}
break
;
/* fetch 4 vectors from the bitstream, one for each
case
MODE_INTER_FOURMV
:
* Y fragment, then average for the C fragment vectors */
/* vector maintenance */
motion_x
[
4
]
=
motion_y
[
4
]
=
0
;
prior_last_motion_x
=
last_motion_x
;
for
(
k
=
0
;
k
<
4
;
k
++
)
{
prior_last_motion_y
=
last_motion_y
;
for
(
l
=
0
;
l
<
s
->
coded_fragment_list_index
;
l
++
)
if
(
s
->
coded_fragment_list
[
l
]
==
s
->
macroblock_fragments
[
6
*
current_macroblock
+
k
])
/* fetch 4 vectors from the bitstream, one for each
break
;
* Y fragment, then average for the C fragment vectors */
if
(
l
<
s
->
coded_fragment_list_index
)
{
motion_x
[
4
]
=
motion_y
[
4
]
=
0
;
if
(
coding_mode
==
0
)
{
for
(
k
=
0
;
k
<
4
;
k
++
)
{
motion_x
[
k
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
for
(
l
=
0
;
l
<
s
->
coded_fragment_list_index
;
l
++
)
motion_y
[
k
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
if
(
s
->
coded_fragment_list
[
l
]
==
s
->
macroblock_fragments
[
6
*
current_macroblock
+
k
])
}
else
{
break
;
motion_x
[
k
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
if
(
l
<
s
->
coded_fragment_list_index
)
{
motion_y
[
k
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)];
if
(
coding_mode
==
0
)
{
}
motion_x
[
k
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
last_motion_x
=
motion_x
[
k
];
motion_y
[
k
]
=
motion_vector_table
[
get_vlc2
(
gb
,
s
->
motion_vector_vlc
.
table
,
6
,
2
)];
last_motion_y
=
motion_y
[
k
];
}
else
{
}
else
{
motion_x
[
k
]
=
0
;
motion_x
[
k
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)]
;
motion_y
[
k
]
=
0
;
motion_y
[
k
]
=
fixed_motion_vector_table
[
get_bits
(
gb
,
6
)]
;
}
}
motion_x
[
4
]
+=
motion_x
[
k
];
last_motion_x
=
motion_x
[
k
];
motion_y
[
4
]
+=
motion_y
[
k
];
last_motion_y
=
motion_y
[
k
];
}
else
{
motion_x
[
k
]
=
0
;
motion_y
[
k
]
=
0
;
}
}
motion_x
[
4
]
+=
motion_x
[
k
];
motion_y
[
4
]
+=
motion_y
[
k
];
}
motion_x
[
5
]
=
motion_x
[
5
]
=
motion_x
[
4
]
=
RSHIFT
(
motion_x
[
4
],
2
);
motion_x
[
4
]
=
RSHIFT
(
motion_x
[
4
],
2
);
motion_y
[
5
]
=
motion_y
[
5
]
=
motion_y
[
4
]
=
RSHIFT
(
motion_y
[
4
],
2
);
motion_y
[
4
]
=
RSHIFT
(
motion_y
[
4
],
2
);
break
;
break
;
case
MODE_INTER_LAST_MV
:
case
MODE_INTER_LAST_MV
:
/* all 6 fragments use the last motion vector */
/* all 6 fragments use the last motion vector */
motion_x
[
0
]
=
last_motion_x
;
motion_x
[
0
]
=
last_motion_x
;
motion_y
[
0
]
=
last_motion_y
;
motion_y
[
0
]
=
last_motion_y
;
for
(
k
=
1
;
k
<
6
;
k
++
)
{
for
(
k
=
1
;
k
<
6
;
k
++
)
{
motion_x
[
k
]
=
motion_x
[
0
];
motion_x
[
k
]
=
motion_x
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
}
}
/* no vector maintenance (last vector remains the
/* no vector maintenance (last vector remains the
* last vector) */
* last vector) */
break
;
break
;
case
MODE_INTER_PRIOR_LAST
:
case
MODE_INTER_PRIOR_LAST
:
/* all 6 fragments use the motion vector prior to the
/* all 6 fragments use the motion vector prior to the
* last motion vector */
* last motion vector */
motion_x
[
0
]
=
prior_last_motion_x
;
motion_x
[
0
]
=
prior_last_motion_x
;
motion_y
[
0
]
=
prior_last_motion_y
;
motion_y
[
0
]
=
prior_last_motion_y
;
for
(
k
=
1
;
k
<
6
;
k
++
)
{
for
(
k
=
1
;
k
<
6
;
k
++
)
{
motion_x
[
k
]
=
motion_x
[
0
];
motion_x
[
k
]
=
motion_x
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
motion_y
[
k
]
=
motion_y
[
0
];
}
}
/* vector maintenance */
/* vector maintenance */
prior_last_motion_x
=
last_motion_x
;
prior_last_motion_x
=
last_motion_x
;
prior_last_motion_y
=
last_motion_y
;
prior_last_motion_y
=
last_motion_y
;
last_motion_x
=
motion_x
[
0
];
last_motion_x
=
motion_x
[
0
];
last_motion_y
=
motion_y
[
0
];
last_motion_y
=
motion_y
[
0
];
break
;
break
;
default:
default:
/* covers intra, inter without MV, golden without MV */
/* covers intra, inter without MV, golden without MV */
memset
(
motion_x
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_x
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_y
,
0
,
6
*
sizeof
(
int
));
memset
(
motion_y
,
0
,
6
*
sizeof
(
int
));
/* no vector maintenance */
/* no vector maintenance */
break
;
break
;
}
}
/* assign the motion vectors to the correct fragments */
/* assign the motion vectors to the correct fragments */
for
(
k
=
0
;
k
<
6
;
k
++
)
{
for
(
k
=
0
;
k
<
6
;
k
++
)
{
current_fragment
=
current_fragment
=
s
->
macroblock_fragments
[
current_macroblock
*
6
+
k
];
s
->
macroblock_fragments
[
current_macroblock
*
6
+
k
];
if
(
current_fragment
==
-
1
)
if
(
current_fragment
==
-
1
)
continue
;
continue
;
if
(
current_fragment
>=
s
->
fragment_count
)
{
if
(
current_fragment
>=
s
->
fragment_count
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad fragment number (%d >= %d)
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" vp3:unpack_vectors(): bad fragment number (%d >= %d)
\n
"
,
current_fragment
,
s
->
fragment_count
);
current_fragment
,
s
->
fragment_count
);
return
1
;
return
1
;
}
s
->
all_fragments
[
current_fragment
].
motion_x
=
motion_x
[
k
];
s
->
all_fragments
[
current_fragment
].
motion_y
=
motion_y
[
k
];
}
}
s
->
all_fragments
[
current_fragment
].
motion_x
=
motion_x
[
k
];
s
->
all_fragments
[
current_fragment
].
motion_y
=
motion_y
[
k
];
}
}
}
}
}
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录