Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
3df0d200
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,发现更多精彩内容 >>
提交
3df0d200
编写于
5月 29, 2014
作者:
D
Dirk Ausserhaus
提交者:
Kostya Shishkov
6月 01, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move Indeo4 frametypes into common header.
Signed-off-by:
N
Kostya Shishkov
<
kostya.shishkov@gmail.com
>
上级
38313626
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
32 deletion
+32
-32
libavcodec/indeo4.c
libavcodec/indeo4.c
+18
-31
libavcodec/ivi_common.c
libavcodec/ivi_common.c
+1
-1
libavcodec/ivi_common.h
libavcodec/ivi_common.h
+13
-0
未找到文件。
libavcodec/indeo4.c
浏览文件 @
3df0d200
...
...
@@ -34,19 +34,6 @@
#include "ivi_common.h"
#include "indeo4data.h"
/**
* Indeo 4 frame types.
*/
enum
{
FRAMETYPE_INTRA
=
0
,
FRAMETYPE_INTRA1
=
1
,
///< intra frame with slightly different bitstream coding
FRAMETYPE_INTER
=
2
,
///< non-droppable P-frame
FRAMETYPE_BIDIR
=
3
,
///< bidirectional frame
FRAMETYPE_INTER_NOREF
=
4
,
///< droppable P-frame
FRAMETYPE_NULL_FIRST
=
5
,
///< empty frame with no data
FRAMETYPE_NULL_LAST
=
6
///< empty frame with no data
};
#define IVI4_PIC_SIZE_ESC 7
...
...
@@ -132,7 +119,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
}
#if IVI4_STREAM_ANALYSER
if
(
ctx
->
frame_type
==
FRAMETYPE_BIDIR
)
if
(
ctx
->
frame_type
==
IVI4_
FRAMETYPE_BIDIR
)
ctx
->
has_b_frames
=
1
;
#endif
...
...
@@ -152,7 +139,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
ctx
->
data_size
=
get_bits1
(
&
ctx
->
gb
)
?
get_bits
(
&
ctx
->
gb
,
24
)
:
0
;
/* null frames don't contain anything else so we just return */
if
(
ctx
->
frame_type
>=
FRAMETYPE_NULL_FIRST
)
{
if
(
ctx
->
frame_type
>=
IVI4_
FRAMETYPE_NULL_FIRST
)
{
av_dlog
(
avctx
,
"Null frame encountered!
\n
"
);
return
0
;
}
...
...
@@ -327,7 +314,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band
->
glob_quant
=
get_bits
(
&
ctx
->
gb
,
5
);
if
(
!
get_bits1
(
&
ctx
->
gb
)
||
ctx
->
frame_type
==
FRAMETYPE_INTRA
)
{
if
(
!
get_bits1
(
&
ctx
->
gb
)
||
ctx
->
frame_type
==
IVI4_
FRAMETYPE_INTRA
)
{
transform_id
=
get_bits
(
&
ctx
->
gb
,
5
);
if
(
transform_id
>=
FF_ARRAY_ELEMS
(
transforms
)
||
!
transforms
[
transform_id
].
inv_trans
)
{
...
...
@@ -462,7 +449,7 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
offs
=
tile
->
ypos
*
band
->
pitch
+
tile
->
xpos
;
blks_per_mb
=
band
->
mb_size
!=
band
->
blk_size
?
4
:
1
;
mb_type_bits
=
ctx
->
frame_type
==
FRAMETYPE_BIDIR
?
2
:
1
;
mb_type_bits
=
ctx
->
frame_type
==
IVI4_
FRAMETYPE_BIDIR
?
2
:
1
;
/* scale factor for motion vectors */
mv_scale
=
(
ctx
->
planes
[
0
].
bands
[
0
].
mb_size
>>
3
)
-
(
band
->
mb_size
>>
3
);
...
...
@@ -477,7 +464,7 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
mb
->
buf_offs
=
mb_offset
;
if
(
get_bits1
(
&
ctx
->
gb
))
{
if
(
ctx
->
frame_type
==
FRAMETYPE_INTRA
)
{
if
(
ctx
->
frame_type
==
IVI4_
FRAMETYPE_INTRA
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Empty macroblock in an INTRA picture!
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -508,8 +495,8 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
if
(
!
ref_mb
)
return
AVERROR_INVALIDDATA
;
mb
->
type
=
ref_mb
->
type
;
}
else
if
(
ctx
->
frame_type
==
FRAMETYPE_INTRA
||
ctx
->
frame_type
==
FRAMETYPE_INTRA1
)
{
}
else
if
(
ctx
->
frame_type
==
IVI4_
FRAMETYPE_INTRA
||
ctx
->
frame_type
==
IVI4_
FRAMETYPE_INTRA1
)
{
mb
->
type
=
0
;
/* mb_type is always INTRA for intra-frames */
}
else
{
mb
->
type
=
get_bits
(
&
ctx
->
gb
,
mb_type_bits
);
...
...
@@ -577,29 +564,29 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
static
void
switch_buffers
(
IVI45DecContext
*
ctx
)
{
switch
(
ctx
->
prev_frame_type
)
{
case
FRAMETYPE_INTRA
:
case
FRAMETYPE_INTRA1
:
case
FRAMETYPE_INTER
:
case
IVI4_
FRAMETYPE_INTRA
:
case
IVI4_
FRAMETYPE_INTRA1
:
case
IVI4_
FRAMETYPE_INTER
:
ctx
->
buf_switch
^=
1
;
ctx
->
dst_buf
=
ctx
->
buf_switch
;
ctx
->
ref_buf
=
ctx
->
buf_switch
^
1
;
break
;
case
FRAMETYPE_INTER_NOREF
:
case
IVI4_
FRAMETYPE_INTER_NOREF
:
break
;
}
switch
(
ctx
->
frame_type
)
{
case
FRAMETYPE_INTRA
:
case
FRAMETYPE_INTRA1
:
case
IVI4_
FRAMETYPE_INTRA
:
case
IVI4_
FRAMETYPE_INTRA1
:
ctx
->
buf_switch
=
0
;
/* FALLTHROUGH */
case
FRAMETYPE_INTER
:
case
IVI4_
FRAMETYPE_INTER
:
ctx
->
dst_buf
=
ctx
->
buf_switch
;
ctx
->
ref_buf
=
ctx
->
buf_switch
^
1
;
break
;
case
FRAMETYPE_INTER_NOREF
:
case
FRAMETYPE_NULL_FIRST
:
case
FRAMETYPE_NULL_LAST
:
case
IVI4_
FRAMETYPE_INTER_NOREF
:
case
IVI4_
FRAMETYPE_NULL_FIRST
:
case
IVI4_
FRAMETYPE_NULL_LAST
:
break
;
}
}
...
...
@@ -607,7 +594,7 @@ static void switch_buffers(IVI45DecContext *ctx)
static
int
is_nonnull_frame
(
IVI45DecContext
*
ctx
)
{
return
ctx
->
frame_type
<
FRAMETYPE_NULL_FIRST
;
return
ctx
->
frame_type
<
IVI4_
FRAMETYPE_NULL_FIRST
;
}
...
...
libavcodec/ivi_common.c
浏览文件 @
3df0d200
...
...
@@ -1011,7 +1011,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
* That's exactly the same Intel decoders do.
*/
if
(
avctx
->
codec_id
==
AV_CODEC_ID_INDEO4
&&
ctx
->
frame_type
==
0
/*FRAMETYPE_INTRA*/
)
{
ctx
->
frame_type
==
IVI4_FRAMETYPE_INTRA
)
{
while
(
get_bits
(
&
ctx
->
gb
,
8
));
// skip version string
skip_bits_long
(
&
ctx
->
gb
,
64
);
// skip padding, TODO: implement correct 8-bytes alignment
if
(
get_bits_left
(
&
ctx
->
gb
)
>
18
&&
show_bits
(
&
ctx
->
gb
,
18
)
==
0x3FFF8
)
...
...
libavcodec/ivi_common.h
浏览文件 @
3df0d200
...
...
@@ -33,6 +33,19 @@
#include "get_bits.h"
#include <stdint.h>
/**
* Indeo 4 frame types.
*/
enum
{
IVI4_FRAMETYPE_INTRA
=
0
,
IVI4_FRAMETYPE_INTRA1
=
1
,
///< intra frame with slightly different bitstream coding
IVI4_FRAMETYPE_INTER
=
2
,
///< non-droppable P-frame
IVI4_FRAMETYPE_BIDIR
=
3
,
///< bidirectional frame
IVI4_FRAMETYPE_INTER_NOREF
=
4
,
///< droppable P-frame
IVI4_FRAMETYPE_NULL_FIRST
=
5
,
///< empty frame with no data
IVI4_FRAMETYPE_NULL_LAST
=
6
///< empty frame with no data
};
#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
#define IVI4_STREAM_ANALYSER 0
#define IVI5_IS_PROTECTED 0x20
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录