Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ffafa53d
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,体验更适合开发者的 AI 搜索 >>
提交
ffafa53d
编写于
11月 27, 2018
作者:
M
Martin Vignali
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/proresdec : add 12b decoding
based on patch by Kieran Kunhya ticket 7163
上级
6a583261
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
15 deletion
+40
-15
libavcodec/proresdec2.c
libavcodec/proresdec2.c
+30
-5
tests/fate/prores.mak
tests/fate/prores.mak
+4
-4
tests/ref/fate/prores-alpha
tests/ref/fate/prores-alpha
+2
-2
tests/ref/fate/prores-alpha_skip
tests/ref/fate/prores-alpha_skip
+2
-2
tests/ref/fate/prores-transparency
tests/ref/fate/prores-transparency
+1
-1
tests/ref/fate/prores-transparency_skip
tests/ref/fate/prores-transparency_skip
+1
-1
未找到文件。
libavcodec/proresdec2.c
浏览文件 @
ffafa53d
...
...
@@ -155,15 +155,23 @@ static av_cold int decode_init(AVCodecContext *avctx)
break
;
case
MKTAG
(
'a'
,
'p'
,
'4'
,
'h'
):
avctx
->
profile
=
FF_PROFILE_PRORES_4444
;
avctx
->
bits_per_raw_sample
=
12
;
break
;
case
MKTAG
(
'a'
,
'p'
,
'4'
,
'x'
):
avctx
->
profile
=
FF_PROFILE_PRORES_XQ
;
avctx
->
bits_per_raw_sample
=
12
;
break
;
default:
avctx
->
profile
=
FF_PROFILE_UNKNOWN
;
av_log
(
avctx
,
AV_LOG_WARNING
,
"Unknown prores profile %d
\n
"
,
avctx
->
codec_tag
);
}
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Auto bitdepth precision. Use 10b decoding based on codec tag"
);
}
else
{
/* 12b */
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Auto bitdepth precision. Use 12b decoding based on codec tag"
);
}
ff_blockdsp_init
(
&
ctx
->
bdsp
,
avctx
);
ret
=
ff_proresdsp_init
(
&
ctx
->
prodsp
,
avctx
);
if
(
ret
<
0
)
{
...
...
@@ -211,6 +219,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
width
=
AV_RB16
(
buf
+
8
);
height
=
AV_RB16
(
buf
+
10
);
if
(
width
!=
avctx
->
width
||
height
!=
avctx
->
height
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"picture resolution change: %dx%d -> %dx%d
\n
"
,
avctx
->
width
,
avctx
->
height
,
width
,
height
);
...
...
@@ -237,9 +246,17 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
}
if
(
ctx
->
alpha_info
)
{
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUVA444P10
:
AV_PIX_FMT_YUVA422P10
;
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUVA444P10
:
AV_PIX_FMT_YUVA422P10
;
}
else
{
/* 12b */
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUVA444P12
:
AV_PIX_FMT_YUVA422P12
;
}
}
else
{
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUV444P10
:
AV_PIX_FMT_YUV422P10
;
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUV444P10
:
AV_PIX_FMT_YUV422P10
;
}
else
{
/* 12b */
avctx
->
pix_fmt
=
(
buf
[
12
]
&
0xC0
)
==
0xC0
?
AV_PIX_FMT_YUV444P12
:
AV_PIX_FMT_YUV422P12
;
}
}
avctx
->
color_primaries
=
buf
[
14
];
...
...
@@ -585,6 +602,7 @@ static void decode_slice_alpha(ProresContext *ctx,
}
block
=
blocks
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
memcpy
(
dst
,
block
,
16
*
blocks_per_slice
*
sizeof
(
*
dst
));
dst
+=
dst_stride
>>
1
;
...
...
@@ -606,6 +624,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
LOCAL_ALIGNED_16
(
int16_t
,
qmat_chroma_scaled
,[
64
]);
int
mb_x_shift
;
int
ret
;
uint16_t
val_no_chroma
;
slice
->
ret
=
-
1
;
//av_log(avctx, AV_LOG_INFO, "slice %d mb width %d mb x %d y %d\n",
...
...
@@ -643,7 +662,8 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
chroma_stride
=
pic
->
linesize
[
1
]
<<
1
;
}
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV444P10
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVA444P10
)
{
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV444P10
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVA444P10
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV444P12
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVA444P12
)
{
mb_x_shift
=
5
;
log2_chroma_blocks_per_mb
=
2
;
}
else
{
...
...
@@ -684,10 +704,15 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
else
{
size_t
mb_max_x
=
slice
->
mb_count
<<
(
mb_x_shift
-
1
);
size_t
i
,
j
;
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
val_no_chroma
=
511
;
}
else
{
/* 12b */
val_no_chroma
=
511
*
4
;
}
for
(
i
=
0
;
i
<
16
;
++
i
)
for
(
j
=
0
;
j
<
mb_max_x
;
++
j
)
{
*
(
uint16_t
*
)(
dest_u
+
(
i
*
chroma_stride
)
+
(
j
<<
1
))
=
511
;
*
(
uint16_t
*
)(
dest_v
+
(
i
*
chroma_stride
)
+
(
j
<<
1
))
=
511
;
*
(
uint16_t
*
)(
dest_u
+
(
i
*
chroma_stride
)
+
(
j
<<
1
))
=
val_no_chroma
;
*
(
uint16_t
*
)(
dest_v
+
(
i
*
chroma_stride
)
+
(
j
<<
1
))
=
val_no_chroma
;
}
}
...
...
tests/fate/prores.mak
浏览文件 @
ffafa53d
...
...
@@ -15,10 +15,10 @@ fate-prores-422: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/pror
fate-prores-422_hq
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_HQ.mov -pix_fmt yuv422p10le
fate-prores-422_lt
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
fate-prores-422_proxy
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt yuv422p10le
fate-prores-alpha
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuva444p1
0
le
fate-prores-alpha_skip
:
CMD = framecrc -flags +bitexact -skip_alpha 1 -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuv444p1
0
le
fate-prores-transparency
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/prores4444_with_transparency.mov -pix_fmt yuva444p1
0
le
fate-prores-transparency_skip
:
CMD = framecrc -flags +bitexact -skip_alpha 1 -i $(TARGET_SAMPLES)/prores/prores4444_with_transparency.mov -pix_fmt yuv444p1
0
le
fate-prores-alpha
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuva444p1
2
le
fate-prores-alpha_skip
:
CMD = framecrc -flags +bitexact -skip_alpha 1 -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuv444p1
2
le
fate-prores-transparency
:
CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/prores/prores4444_with_transparency.mov -pix_fmt yuva444p1
2
le
fate-prores-transparency_skip
:
CMD = framecrc -flags +bitexact -skip_alpha 1 -i $(TARGET_SAMPLES)/prores/prores4444_with_transparency.mov -pix_fmt yuv444p1
2
le
fate-prores-gray
:
CMD = framecrc -flags +bitexact -c:a aac_fixed -i $(TARGET_SAMPLES)/prores/gray.mov -pix_fmt yuv422p10le
#Test bsf prores-metadata
...
...
tests/ref/fate/prores-alpha
浏览文件 @
ffafa53d
...
...
@@ -3,5 +3,5 @@
#codec_id 0: rawvideo
#dimensions 0: 1920x1080
#sar 0: 0/1
0, 0, 0, 1, 16588800, 0x
8e4dac4
8
0, 1, 1, 1, 16588800, 0x
8e4dac4
8
0, 0, 0, 1, 16588800, 0x
b035f65
8
0, 1, 1, 1, 16588800, 0x
b035f65
8
tests/ref/fate/prores-alpha_skip
浏览文件 @
ffafa53d
...
...
@@ -3,5 +3,5 @@
#codec_id 0: rawvideo
#dimensions 0: 1920x1080
#sar 0: 0/1
0, 0, 0, 1, 12441600, 0x
f11685dd
0, 1, 1, 1, 12441600, 0x
f11685dd
0, 0, 0, 1, 12441600, 0x
65e009b8
0, 1, 1, 1, 12441600, 0x
65e009b8
tests/ref/fate/prores-transparency
浏览文件 @
ffafa53d
...
...
@@ -9,6 +9,6 @@
#sample_rate 1: 48000
#channel_layout 1: 3
#channel_layout_name 1: stereo
0, 0, 0, 1, 16588800, 0x
7163b01a
0, 0, 0, 1, 16588800, 0x
cfb3d806
1, 0, 0, 1024, 4096, 0x00000000
1, 1024, 1024, 896, 3584, 0x00000000
tests/ref/fate/prores-transparency_skip
浏览文件 @
ffafa53d
...
...
@@ -9,6 +9,6 @@
#sample_rate 1: 48000
#channel_layout 1: 3
#channel_layout_name 1: stereo
0, 0, 0, 1, 12441600, 0x
627d1548
0, 0, 0, 1, 12441600, 0x
74f53304
1, 0, 0, 1024, 4096, 0x00000000
1, 1024, 1024, 896, 3584, 0x00000000
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录