Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
22f3e8be
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,发现更多精彩内容 >>
提交
22f3e8be
编写于
11月 15, 2002
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dr1
Originally committed as revision 1216 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
0626afe9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
14 deletion
+33
-14
libavcodec/huffyuv.c
libavcodec/huffyuv.c
+33
-14
未找到文件。
libavcodec/huffyuv.c
浏览文件 @
22f3e8be
...
...
@@ -412,16 +412,18 @@ s->bgr32=1;
y_size
=
height
*
stride
;
s
->
linesize
[
0
]
=
stride
;
s
->
picture
[
0
]
=
av_mallocz
(
y_size
);
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_DR1
)){
s
->
linesize
[
0
]
=
stride
;
s
->
picture
[
0
]
=
av_mallocz
(
y_size
);
if
(
c_size
){
s
->
picture
[
1
]
=
av_mallocz
(
c_size
);
s
->
picture
[
2
]
=
av_mallocz
(
c_size
);
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
stride
/
2
;
if
(
c_size
){
s
->
picture
[
1
]
=
av_mallocz
(
c_size
);
s
->
picture
[
2
]
=
av_mallocz
(
c_size
);
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
stride
/
2
;
memset
(
s
->
picture
[
1
],
128
,
c_size
);
memset
(
s
->
picture
[
2
],
128
,
c_size
);
memset
(
s
->
picture
[
1
],
128
,
c_size
);
memset
(
s
->
picture
[
2
],
128
,
c_size
);
}
}
// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
...
...
@@ -651,9 +653,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
const
int
width
=
s
->
width
;
const
int
width2
=
s
->
width
>>
1
;
const
int
height
=
s
->
height
;
const
int
fake_ystride
=
s
->
interlaced
?
s
->
linesize
[
0
]
*
2
:
s
->
linesize
[
0
];
const
int
fake_ustride
=
s
->
interlaced
?
s
->
linesize
[
1
]
*
2
:
s
->
linesize
[
1
];
const
int
fake_vstride
=
s
->
interlaced
?
s
->
linesize
[
2
]
*
2
:
s
->
linesize
[
2
];
int
fake_ystride
,
fake_ustride
,
fake_vstride
;
int
i
;
AVPicture
*
picture
=
data
;
...
...
@@ -667,7 +667,24 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
bswap_buf
((
uint32_t
*
)
s
->
bitstream_buffer
,
(
uint32_t
*
)
buf
,
buf_size
/
4
);
init_get_bits
(
&
s
->
gb
,
s
->
bitstream_buffer
,
buf_size
);
if
(
avctx
->
flags
&
CODEC_FLAG_DR1
){
if
(
avctx
->
get_buffer_callback
(
avctx
,
s
->
width
,
s
->
height
,
I_TYPE
)
<
0
){
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
return
-
1
;
}
s
->
linesize
[
0
]
=
avctx
->
dr_stride
;
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
avctx
->
dr_uvstride
;
for
(
i
=
0
;
i
<
3
;
i
++
)
s
->
picture
[
i
]
=
avctx
->
dr_buffer
[
i
];
}
fake_ystride
=
s
->
interlaced
?
s
->
linesize
[
0
]
*
2
:
s
->
linesize
[
0
];
fake_ustride
=
s
->
interlaced
?
s
->
linesize
[
1
]
*
2
:
s
->
linesize
[
1
];
fake_vstride
=
s
->
interlaced
?
s
->
linesize
[
2
]
*
2
:
s
->
linesize
[
2
];
if
(
s
->
bitstream_bpp
<
24
){
int
y
,
cy
;
int
lefty
,
leftu
,
leftv
;
...
...
@@ -870,7 +887,9 @@ static int decode_end(AVCodecContext *avctx)
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
){
av_freep
(
&
s
->
picture
[
i
]);
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_DR1
))
av_freep
(
&
s
->
picture
[
i
]);
free_vlc
(
&
s
->
vlc
[
i
]);
}
...
...
@@ -1050,7 +1069,7 @@ AVCodec huffyuv_decoder = {
NULL
,
decode_end
,
decode_frame
,
0
,
CODEC_CAP_DR1
,
NULL
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录