Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
d0ce0634
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,发现更多精彩内容 >>
提交
d0ce0634
编写于
4月 14, 2017
作者:
D
Diego Biurrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clearvideo: Convert to the new bitstream reader
上级
189157c3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
12 deletion
+12
-12
libavcodec/clearvideo.c
libavcodec/clearvideo.c
+12
-12
未找到文件。
libavcodec/clearvideo.c
浏览文件 @
d0ce0634
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
*/
*/
#include "avcodec.h"
#include "avcodec.h"
#include "bitstream.h"
#include "bytestream.h"
#include "bytestream.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "idctdsp.h"
#include "internal.h"
#include "internal.h"
...
@@ -123,7 +123,7 @@ typedef struct CLVContext {
...
@@ -123,7 +123,7 @@ typedef struct CLVContext {
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
IDCTDSPContext
idsp
;
IDCTDSPContext
idsp
;
AVFrame
*
pic
;
AVFrame
*
pic
;
GetBitContext
gb
;
BitstreamContext
bc
;
int
mb_width
,
mb_height
;
int
mb_width
,
mb_height
;
VLC
dc_vlc
,
ac_vlc
;
VLC
dc_vlc
,
ac_vlc
;
int
luma_dc_quant
,
chroma_dc_quant
,
ac_quant
;
int
luma_dc_quant
,
chroma_dc_quant
,
ac_quant
;
...
@@ -135,11 +135,11 @@ typedef struct CLVContext {
...
@@ -135,11 +135,11 @@ typedef struct CLVContext {
static
inline
int
decode_block
(
CLVContext
*
ctx
,
int16_t
*
blk
,
int
has_ac
,
static
inline
int
decode_block
(
CLVContext
*
ctx
,
int16_t
*
blk
,
int
has_ac
,
int
ac_quant
)
int
ac_quant
)
{
{
GetBitContext
*
gb
=
&
ctx
->
gb
;
BitstreamContext
*
bc
=
&
ctx
->
bc
;
int
idx
=
1
,
last
=
0
,
val
,
skip
;
int
idx
=
1
,
last
=
0
,
val
,
skip
;
memset
(
blk
,
0
,
sizeof
(
*
blk
)
*
64
);
memset
(
blk
,
0
,
sizeof
(
*
blk
)
*
64
);
blk
[
0
]
=
get_vlc2
(
gb
,
ctx
->
dc_vlc
.
table
,
9
,
3
);
blk
[
0
]
=
bitstream_read_vlc
(
bc
,
ctx
->
dc_vlc
.
table
,
9
,
3
);
if
(
blk
[
0
]
<
0
)
if
(
blk
[
0
]
<
0
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
blk
[
0
]
-=
63
;
blk
[
0
]
-=
63
;
...
@@ -148,19 +148,19 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac,
...
@@ -148,19 +148,19 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac,
return
0
;
return
0
;
while
(
idx
<
64
&&
!
last
)
{
while
(
idx
<
64
&&
!
last
)
{
val
=
get_vlc2
(
gb
,
ctx
->
ac_vlc
.
table
,
9
,
2
);
val
=
bitstream_read_vlc
(
bc
,
ctx
->
ac_vlc
.
table
,
9
,
2
);
if
(
val
<
0
)
if
(
val
<
0
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
if
(
val
!=
0x1BFF
)
{
if
(
val
!=
0x1BFF
)
{
last
=
val
>>
12
;
last
=
val
>>
12
;
skip
=
(
val
>>
4
)
&
0xFF
;
skip
=
(
val
>>
4
)
&
0xFF
;
val
&=
0xF
;
val
&=
0xF
;
if
(
get_bits1
(
gb
))
if
(
bitstream_read_bit
(
bc
))
val
=
-
val
;
val
=
-
val
;
}
else
{
}
else
{
last
=
get_bits1
(
gb
);
last
=
bitstream_read_bit
(
bc
);
skip
=
get_bits
(
gb
,
6
);
skip
=
bitstream_read
(
bc
,
6
);
val
=
get_sbits
(
gb
,
8
);
val
=
bitstream_read_signed
(
bc
,
8
);
}
}
if
(
val
)
{
if
(
val
)
{
int
aval
=
FFABS
(
val
),
sign
=
val
<
0
;
int
aval
=
FFABS
(
val
),
sign
=
val
<
0
;
...
@@ -229,7 +229,7 @@ static int decode_mb(CLVContext *c, int x, int y)
...
@@ -229,7 +229,7 @@ static int decode_mb(CLVContext *c, int x, int y)
int
i
,
has_ac
[
6
],
off
;
int
i
,
has_ac
[
6
],
off
;
for
(
i
=
0
;
i
<
6
;
i
++
)
for
(
i
=
0
;
i
<
6
;
i
++
)
has_ac
[
i
]
=
get_bits1
(
&
c
->
gb
);
has_ac
[
i
]
=
bitstream_read_bit
(
&
c
->
bc
);
off
=
x
*
16
+
y
*
16
*
c
->
pic
->
linesize
[
0
];
off
=
x
*
16
+
y
*
16
*
c
->
pic
->
linesize
[
0
];
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
@@ -301,8 +301,8 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -301,8 +301,8 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data,
c
->
luma_dc_quant
=
32
;
c
->
luma_dc_quant
=
32
;
c
->
chroma_dc_quant
=
32
;
c
->
chroma_dc_quant
=
32
;
if
((
ret
=
init_get_bits8
(
&
c
->
gb
,
buf
+
bytestream2_tell
(
&
gb
),
if
((
ret
=
bitstream_init8
(
&
c
->
bc
,
buf
+
bytestream2_tell
(
&
gb
),
buf_size
-
bytestream2_tell
(
&
gb
)))
<
0
)
buf_size
-
bytestream2_tell
(
&
gb
)))
<
0
)
return
ret
;
return
ret
;
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录